Package org.eclipse.ui

Examples of org.eclipse.ui.IViewReference


     * @deprecated - use to {@link ApplicationGIS#getView(boolean, String))}
     */
    public static IViewPart getView(boolean show, String id){
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        IViewReference[] view = page.getViewReferences();
        IViewReference infoRef=null;
        for (IViewReference reference : view) {
            if( reference.getId().equals(id) ){
                infoRef=reference;
                break;
            }
        }
        // JONES: need to get the part and set the selection to null so that the last selected feature
        // will not flash (because it will not be in list any more).
        IViewPart infoView=null;
        if( infoRef == null ) {
            try {
                infoView= page.showView(id);
            } catch (PartInitException e1) {
                return null;
            }
            if( infoView==null ){
                return null;
            }
        }
        if( infoRef!=null )
            return (IViewPart) infoRef.getPart(show);
       
        return null;
   
    }
View Full Code Here


        IWorkbench wb = PlatformUI.getWorkbench();
        // IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
        IWorkbenchWindow[] winArray = wb.getWorkbenchWindows();
        final IWorkbenchPage page = winArray[0].getActivePage();
        // IWorkbenchPage page = win.getActivePage();
        final IViewReference viewRef = page.findViewReference(MergeView.ID);
        // If there is an opened MergeView then close it!
        if (viewRef != null) {
            Display.getDefault().asyncExec(new Runnable() {
                @Override
                public void run() {
                    page.hideView(viewRef.getView(false));
                }
            });
        }
    }
View Full Code Here

 
  public static void launchJob(String viewId) {
        IWorkbench work = PlatformUI.getWorkbench();
        IWorkbenchWindow window = work.getActiveWorkbenchWindow();
        IWorkbenchPage page = window.getActivePage();
        IViewReference ref = window.getActivePage().findViewReference(viewId);
        if( ref != null ) {
            IWorkbenchPart part = ref.getPart(false);
            if ( part != null && page.isPartVisible(part)) {
              if( part instanceof CommonNavigator)
                new UpdateSelectionJob((CommonNavigator)part).schedule();
            }
        }
View Full Code Here

        Perspective persp = getPerspective();

        WorkbenchPage page = getPage();

        IViewReference oldFastView = null;
        if (persp != null) {
            oldFastView = persp.getActiveFastView();

            if (page != null) {
                page.hideFastView();
View Full Code Here

        ToolBar toolBar = getToolBar();

        Menu menu = fastViewBarMenuManager.createContextMenu(toolBar);

        IViewReference selectedView = getViewAt(pt);
        contextContributionItem.setTarget(selectedView);

        menu.setLocation(pt.x, pt.y);
        menu.setVisible(true);
    }
View Full Code Here

        ToolItem[] items = fastViewBar.getControl().getItems();

        updateLayoutData();

        for (int idx = 0; idx < items.length; idx++) {
            IViewReference view = getViewFor(items[idx]);

            viewOrientation.put(view.getId(), new Integer(
                    isHorizontal(view) ? SWT.HORIZONTAL : SWT.VERTICAL));
        }
    }
View Full Code Here

        /* (non-Javadoc)
         * @see org.eclipse.ui.internal.dnd.IDropTarget#drop()
         */
        public void drop() {
            IViewReference view = getViewFor(position);

            Iterator iter = panes.iterator();
            while (iter.hasNext()) {
                ViewPane pane = (ViewPane) iter.next();
                IViewReference ref = pane.getViewReference();
                getPerspective().getFastViewManager().addViewReference(FASTVIEWBAR_ID, getIndex(view), ref, true);
//                getPage().addFastView(pane.getViewReference());
//                getPage().getActivePerspective().moveFastView(
//                        pane.getViewReference(), view);
            }
View Full Code Here

        viewOrientation.put(refToSet.getId(), new Integer(newState));
        Perspective persp = getPerspective();

        if (persp != null) {
            IViewReference ref = persp.getActiveFastView();
            if (ref != null) {
                persp.setActiveFastView(null);
            }
            persp.setActiveFastView(refToSet);
        }
View Full Code Here

    // });
    // }
  }

  public static IViewPart getView(String id, String id2) {
    IViewReference viewReferences[] = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
            .getActivePage().getViewReferences();
    for (int i = 0; i < viewReferences.length; i++) {
      if (id.equals(viewReferences[i].getId()) && id2.equals(viewReferences[i].getSecondaryId())) {
        return viewReferences[i].getView(false);
      }
View Full Code Here

public class MenuRenamePlaylistHandler extends AbstractHandler implements
    IHandler {

  private void closeViewByID(String id) {
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    IViewReference view = null;
    IViewReference[] tabView = page.getViewReferences();
   
    for (int i = 0; i < tabView.length; i++) {
      if ((tabView[i].getSecondaryId() != null) &&
          (tabView[i].getSecondaryId().equals(id))) {
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IViewReference

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.