Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPartSite


    schedule(job);
  }

  private IWorkbenchPartSite getPartSite() {
    final IWorkbenchPart part = getHistoryPageSite().getPart();
    IWorkbenchPartSite site = null;
    if (part != null)
      site = part.getSite();
    return site;
  }
View Full Code Here


      site = part.getSite();
    return site;
  }

  private void schedule(final Job j) {
    IWorkbenchPartSite site = getPartSite();
    if (site != null) {
      final IWorkbenchSiteProgressService p;
      p = (IWorkbenchSiteProgressService) site
          .getAdapter(IWorkbenchSiteProgressService.class);
      if (p != null) {
        p.schedule(j, 0, true /* use half-busy cursor */);
        return;
      }
 
View Full Code Here

  public void showErrorMessage(String msg) {
    IWorkbench wb = PlatformUI.getWorkbench();
    IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
    IWorkbenchPage page = win.getActivePage();
    IWorkbenchPart part = page.getActivePart();
    IWorkbenchPartSite site = part.getSite();
    IViewSite vSite = ( IViewSite ) site;
    IActionBars actionBars =  vSite.getActionBars();

    if( actionBars == null )
      return;
View Full Code Here

   
   
    //viewer.setSorter(new CFCMethodsNameSorter());
    viewer.setInput(lastInput);
    try {
      IWorkbenchPartSite site = getSite();
     
      IWorkbenchPage page = site.getPage();
     
      //iep.addPropertyListener(this);
      page.addPartListener(this);
    }
    catch (Exception e) {
View Full Code Here

 
  public void reload(boolean forced) {
    try {
      if (autoRefresh || forced) {
          lastInput = getRootInput();
          IWorkbenchPartSite site = getSite();
        IWorkbenchWindow window =  site.getWorkbenchWindow();
        IWorkbenchPage page = window.getActivePage();
        IEditorPart iep = page.getActiveEditor();
          if (iep != null) {
            CFCMethodsFile = ((FileEditorInput)iep.getEditorInput()).getFile();
            fileLabel.setText(CFCMethodsFile.getFullPath().toString());
View Full Code Here

    store.setValue("componentRoot", root);

  }

  protected IStructuredSelection getSelection() {
    IWorkbenchPartSite site = Workbench.getInstance().getActiveWorkbenchWindow()
    .getActivePage().getActivePart().getSite();
    if (site != null && site.getSelectionProvider() != null) {
      final ISelection partSelection = site
          .getSelectionProvider().getSelection();
      if (partSelection != null) {
        if (partSelection instanceof IStructuredSelection) {
          return (IStructuredSelection) partSelection;
        } else if (partSelection instanceof ITextSelection) {
          IResource resource = ResourceUtil.getResource(site.getWorkbenchWindow().getActivePage()
              .getActiveEditor().getEditorInput());
          if(resource != null) {
            return new StructuredSelection(resource);
          }
          else return new StructuredSelection();
View Full Code Here

    private OpenFileAction fOpenAction;
    private PropertyDialogAction fOpenPropertiesDialog;

    public NewTextSearchActionGroup(IViewPart part) {
        Assert.isNotNull(part);
        IWorkbenchPartSite site = part.getSite();
        fSelectionProvider = site.getSelectionProvider();
        fPage = site.getPage();
        fOpenPropertiesDialog = new PropertyDialogAction(site, fSelectionProvider);
        fOpenAction = new OpenFileAction(fPage);
        ISelection selection = fSelectionProvider.getSelection();

        if (selection instanceof IStructuredSelection)
View Full Code Here

           
            if (path == null || path.length() == 0) {
                return null;
            }
            IType[] types = model.findTypes(path, MatchRule.EXACT, 0, 0, SearchEngine.createWorkspaceScope(PHPLanguageToolkit.getDefault()), new NullProgressMonitor());
            IWorkbenchPartSite site = Workbench.getInstance().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getSite();

            if (types.length > 10) {
                Logger.debugMSG("Found more than ten (" + types.length +") types during xml hyperlink detection...");
                return null;
            }
View Full Code Here

                IWorkbenchWindow win = wb.getActiveWorkbenchWindow();

                IWorkbenchPage page = win.getActivePage();

                IWorkbenchPart part = page.getActivePart();
                IWorkbenchPartSite site = part.getSite();

                IViewSite vSite = (IViewSite) site;

                IActionBars actionBars = vSite.getActionBars();
                if ( actionBars == null )
View Full Code Here

  protected ITextSelection getSelection() {
    final IEditorPart ep = getEditorPart();
    if (ep == null)
      return null;
    final IWorkbenchPartSite ws = ep.getEditorSite();
    if (ws == null)
      return null;
    final ISelectionProvider sp = ws.getSelectionProvider();
    if (sp == null)
      return null;
    final ISelection sel = sp.getSelection();
    if (sel == null || !(sel instanceof ITextSelection))
      return null;
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkbenchPartSite

Copyright © 2018 www.massapicom. 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.