Examples of IWorkbenchBrowserSupport


Examples of org.eclipse.ui.browser.IWorkbenchBrowserSupport

  public Object execute(ExecutionEvent event) throws ExecutionException {
     
      try {
       

      IWorkbenchBrowserSupport support =
          PlatformUI.getWorkbench().getBrowserSupport();
        IWebBrowser browser = support.createBrowser("otro.browser");
      //  browser.openURL(new URL("http://www.eclipse.org"));

      UrlDialog url = new UrlDialog(HandlerUtil.getActiveShell(event));
      url.open();
      String feedUrl = url.getUrl();
View Full Code Here

Examples of org.eclipse.ui.browser.IWorkbenchBrowserSupport

import org.eclipse.ui.browser.IWorkbenchBrowserSupport;

public class BrowserUtil {
  public static IWebBrowser openSystemBrowser(String browserid, String url,boolean embed) {
    try {
      IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
      IWebBrowser browser = null;
      if(embed){
        browser = browserSupport.createBrowser(browserid); //$NON-NLS-1$
      }else{
        browser = browserSupport.getExternalBrowser();
      }
      browser.openURL(new URL(url));
      return browser;
    } catch (Exception e) {
      return null;
View Full Code Here

Examples of org.eclipse.ui.browser.IWorkbenchBrowserSupport

            while (href.startsWith("/")) { //$NON-NLS-1$
                href = href.substring(1);
            }
            href = "file:///" + href; //$NON-NLS-1$
        }
    IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
    try {
      IWebBrowser browser = support.getExternalBrowser();
      browser.openURL(new URL(urlEncodeForSpaces(href.toCharArray())));
    }
    catch (MalformedURLException e) {
      openWebBrowserError(href, e);
    }
View Full Code Here

Examples of org.eclipse.ui.browser.IWorkbenchBrowserSupport

        Display.getDefault().syncExec(new Runnable() {
            public void run() {
                URL url;
                try {
                    url = new URL("http://localhost:8888");
                    IWorkbenchBrowserSupport browserSupport = WebBrowserUIPlugin
                            .getInstance().getWorkbench().getBrowserSupport();
                    IWebBrowser browser = browserSupport.createBrowser(
                            IWorkbenchBrowserSupport.LOCATION_BAR
                                    | IWorkbenchBrowserSupport.NAVIGATION_BAR,
                            null, null, null);
                    browser.openURL(url);
                } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.ui.browser.IWorkbenchBrowserSupport

        try {
            url = new URL(event.location);
        } catch (MalformedURLException ignored) {
            return;
        }
        IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
        try {
            IWebBrowser newBrowser = support.createBrowser(browserId);
            browserId = newBrowser.getId();
            newBrowser.openURL(url);
            return;
        } catch (PartInitException e) {
            FindbugsPlugin.getDefault().logException(e, "Can't open external browser");
View Full Code Here

Examples of org.eclipse.ui.browser.IWorkbenchBrowserSupport

    IContentAnalyzer contentAnalyzer = new ContentAnalyzer();
    return contentAnalyzer.findContentType(file);
  }

  private void openWebBrowser(IWorkbenchWindow window, String url, String title) {
    IWorkbenchBrowserSupport browserSupport = window.getWorkbench().getBrowserSupport();
    IWebBrowser browser;
    URL targetURL = null;

    try {
      targetURL = new URL(url);
    } catch (MalformedURLException e) {
      String pluginID = EclipastiePlugin.PLUGINNAME;
      IStatus status = new Status(IStatus.ERROR, pluginID, String.format(Messages.Message_ErrorReported, e.getLocalizedMessage()));
      ErrorDialog.openError(window.getShell(),
          String.format(Messages.Message_Error, EclipastiePlugin.PLUGINNAME),
          String.format(Messages.Message_ErrorWhileOpeningInBrowser, url),
          status);
      return;
    }

    try {
      browser = browserSupport.createBrowser(
          IWorkbenchBrowserSupport.AS_EDITOR
          | IWorkbenchBrowserSupport.LOCATION_BAR
          | IWorkbenchBrowserSupport.NAVIGATION_BAR,
        null,
        title,
View Full Code Here

Examples of org.eclipse.ui.browser.IWorkbenchBrowserSupport

        public void run() {
          URL url;
          try {
            url = new URL(urlString);
            IWorkbenchBrowserSupport browserSupport = WebBrowserUIPlugin.getInstance().getWorkbench().getBrowserSupport();
            IWebBrowser browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.NAVIGATION_BAR, null, null, null);
            browser.openURL(url);
          } catch (MalformedURLException e1) {
            LaunchingPlugin.getDefault().log(e1);
          } catch (PartInitException e) {
            LaunchingPlugin.getDefault().log(e);
View Full Code Here

Examples of org.eclipse.ui.browser.IWorkbenchBrowserSupport

   */
  public void run(IAction action) {

    //System.out.println("action.getText---" + action.getText());
   
    IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
      IWebBrowser browser;
      try {
         
       
        browser = support.createBrowser(""+System.currentTimeMillis());
        browser.openURL(new URL("http://www.salesforce.com/us/developer/docs/apexcode/index.htm"));
      } catch (PartInitException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (MalformedURLException e) {
View Full Code Here

Examples of org.eclipse.ui.browser.IWorkbenchBrowserSupport

   */
  public Object execute(ExecutionEvent event) throws ExecutionException {
    // IWorkbenchWindow window =
    // HandlerUtil.getActiveWorkbenchWindowChecked(event);

    IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
    IWebBrowser browser;
    try {

      IWorkbench wb = PlatformUI.getWorkbench();
      IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
      Object data = wb.getDisplay().getActiveShell().getData();
      IWorkbenchPage page = win.getActivePage();
      IEditorPart editorPart = page.getActiveEditor();
      ITextEditor editor = (ITextEditor) editorPart;
      ISelectionProvider sp = editor.getSelectionProvider();
      ITextSelection selection = (ITextSelection) sp.getSelection();

      IDocumentProvider documentProvider = editor.getDocumentProvider();
      IDocument document = documentProvider.getDocument(editorPart
          .getEditorInput());

     
      ITextSelection textSelection = (ITextSelection) editorPart
          .getSite().getSelectionProvider().getSelection();
      int cursorLocation = textSelection.getOffset();
      int lineNumber = document.getLineOfOffset(cursorLocation);
      IRegion lineInformation = document.getLineInformation(lineNumber);
      String lineText = document.get().substring(
          lineInformation.getOffset(),
          lineInformation.getOffset() + lineInformation.getLength());
      String offsetWord = getOffsetWord(lineText, cursorLocation
          - lineInformation.getOffset());
      // System.out.println("offsetWord" + offsetWord);
      //
      String word = offsetWord.substring(offsetWord.lastIndexOf(":") + 1,
          offsetWord.length());
      List<Tag> tagInfoAsList = VisualForceTagDefinition.getTagInfoAsList();
      String tagInEditor = "apex:" + word;
      boolean found=false;
      for (Tag tag : tagInfoAsList) {
        if(tag.getTagName().equalsIgnoreCase(tagInEditor)){
          found = true;
        }
      }
     

      browser = support.createBrowser("" + System.currentTimeMillis());
     
      if (found) {
        browser.openURL(new URL(
            "http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_"
                + word + ".htm"));
View Full Code Here

Examples of org.eclipse.ui.browser.IWorkbenchBrowserSupport

   */
  public void run(IAction action) {

    //System.out.println("action.getText---" + action.getText());
   
    IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
      IWebBrowser browser;
      try {
       
       
        browser = support.createBrowser(""+System.currentTimeMillis());
        browser.openURL(new URL("http://www.salesforce.com/us/developer/docs/pages/index.htm"));
      } catch (PartInitException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (MalformedURLException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.