public void makeContributions(
     IMenuManager menuManager,
     IToolBarManager toolBarManager,
     IStatusLineManager statusLineManager) {
   super.makeContributions(menuManager, toolBarManager, statusLineManager);
   updateView();
 }
 @Override
 public void dispose() {
   super.dispose();
   DebugUITools.getDebugContextManager()
       .getContextService(getSite().getWorkbenchWindow())
       .removeDebugContextListener(this);
   fTerminalControl.disposeTerminal();
   fMenuManager.dispose();
   GdbUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(fPreferenceListener);
 }
 /**
  * Creates a new <code>DartSearchActionGroup</code>. The group requires that the selection
  * provided by the page's selection provider is of type <code>
  * org.eclipse.jface.viewers.IStructuredSelection</code>.
  *
  * @param page the page that owns this action group
  */
 public DartSearchActionGroup_OLD(Page page) {
   this(page.getSite());
 }
  @Override
  protected Control createControl(Composite parent) {
    Composite propertyComposite = new Composite(parent, SWT.BORDER);
    GridLayout layout = new GridLayout(1, false);
    layout.marginWidth = layout.marginHeight = 0;
    propertyComposite.setLayout(layout);
    if (mPage instanceof Page) {
      ((Page) mPage)
          .init(
              new IPageSite() {
                public void registerContextMenu(
                    String menuId, MenuManager menuManager, ISelectionProvider selectionProvider) {}

                public IActionBars getActionBars() {
                  return null;
                }

                public IWorkbenchPage getPage() {
                  return getWorkbenchWindow().getActivePage();
                }

                public ISelectionProvider getSelectionProvider() {
                  return null;
                }

                public Shell getShell() {
                  return getWorkbenchWindow().getShell();
                }

                public IWorkbenchWindow getWorkbenchWindow() {
                  return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
                }

                public void setSelectionProvider(ISelectionProvider provider) {}

                @SuppressWarnings("unchecked")
                public Object getAdapter(Class adapter) {
                  return null;
                }

                @SuppressWarnings("unchecked")
                public Object getService(Class api) {
                  return null;
                }

                @SuppressWarnings("unchecked")
                public boolean hasService(Class api) {
                  return false;
                }
              });
    }
    if (mPage instanceof PropertySheetPage) {
      ((PropertySheetPage) mPage).setPropertySourceProvider(this);
    }
    mPage.createControl(propertyComposite);
    mPage.setActionBars(new DummyActionBars());
    final Control control = mPage.getControl();
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    if (control instanceof Tree) {
      final Tree tree = (Tree) control;
      data.heightHint =
          tree.getItemHeight() * 13
              + (tree.getLinesVisible() ? 12 * tree.getGridLineWidth() : 0)
              + (tree.getHeaderVisible() ? tree.getHeaderHeight() : 0)
              + 2 * tree.getBorderWidth()
              + (tree.getHorizontalBar() != null ? tree.getHorizontalBar().getSize().x : 0);
      tree.addControlListener(
          new ControlAdapter() {
            @Override
            public void controlResized(ControlEvent e) {
              Rectangle area = tree.getClientArea();
              TreeColumn[] columns = tree.getColumns();
              if (area.width > 0) {
                columns[0].setWidth(area.width * 40 / 100);
                columns[1].setWidth(area.width - columns[0].getWidth() - 4);
              }
            }
          });
    } else if (control instanceof Composite) {
      control.addControlListener(
          new ControlAdapter() {
            @Override
            public void controlResized(ControlEvent e) {
              ((Composite) control).layout(true, true);
            }
          });
    }
    control.setLayoutData(data);
    ISelection selection;
    if (mCurrentWidget == null) {
      Collection<InstallOptionsModelTypeDef> typeDefs =
          InstallOptionsModel.INSTANCE.getControlTypeDefs();
      if (typeDefs.size() > 0) {
        InstallOptionsModelTypeDef typeDef = typeDefs.iterator().next();
        InstallOptionsElementFactory factory =
            InstallOptionsElementFactory.getFactory(typeDef.getType());
        mCurrentWidget = (InstallOptionsWidget) factory.getNewObject();
        mDialog.addChild(mCurrentWidget);
      }
    }

    if (mCurrentWidget != null) {
      mCurrentWidget.addModelCommandListener(InstallOptionsWidgetEditorDialog.this);
      mCurrentWidget.addPropertyChangeListener(InstallOptionsWidgetEditorDialog.this);
      if (mCurrentWidget.getParent() != null) {
        mCurrentWidget.getParent().addPropertyChangeListener(InstallOptionsWidgetEditorDialog.this);
      }
      selection = new StructuredSelection(mCurrentWidget);
    } else {
      selection = StructuredSelection.EMPTY;
    }

    mPage.selectionChanged(null, selection);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(mPage.getControl(), HELP_CONTEXT);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyComposite, HELP_CONTEXT);

    return propertyComposite;
  }
Beispiel #5
0
 @Override
 public void init(IPageSite pageSite) {
   super.init(pageSite);
   getSite().setSelectionProvider(null);
 }
 public void init(IPageSite pageSite) {
   super.init(pageSite);
 }
 public void init(org.eclipse.ui.part.IPageSite pageSite) {
   super.init(pageSite);
 }
Beispiel #8
0
 /*
  *  (non-Javadoc)
  * @see org.eclipse.ui.part.IPageBookViewPage#init(org.eclipse.ui.part.IPageSite)
  */
 public void init(IPageSite pageSite) {
   super.init(pageSite);
   pageSite.setSelectionProvider(this);
 }
 /**
  * Creates a new <code>FindOccurrencesInFileAction</code>. The action requires that the selection
  * provided by the page's selection provider is of type <code>
  * org.eclipse.jface.viewers.IStructuredSelection</code>.
  *
  * @param page the page providing context information for this action
  */
 public FindOccurrencesInFileAction(Page page) {
   this(page.getSite());
 }
 /**
  * Releases the palette viewer from the edit domain
  *
  * @see Page#dispose()
  */
 public void dispose() {
   if (provider.getEditDomain().getPaletteViewer() == viewer)
     provider.getEditDomain().setPaletteViewer(null);
   super.dispose();
   viewer = null;
 }
 /**
  * Creates a new <code>GenerateActionGroup</code>. The group requires that the selection provided
  * by the page's selection provider is of type <code>
  * org.eclipse.jface.viewers.IStructuredSelection</code>.
  *
  * @param page the page that owns this action group
  */
 public GenerateIncludePathActionGroup(Page page) {
   this(page.getSite());
 }
 /** Dispose of this page. */
 public void dispose() {
   /* removes the listener */
   this.model.removeModelChangedListener(this);
   super.dispose();
 }
 /**
  * Creates a new <code>OpenActionGroup</code>. The group requires that the selection provided by
  * the given selection provider is of type {@link IStructuredSelection}.
  *
  * @param page the page that owns this action group
  * @param selectionProvider the selection provider used instead of the page selection provider.
  * @since 3.2
  */
 public OpenViewActionGroup(Page page, ISelectionProvider selectionProvider) {
   createSiteActions(page.getSite(), selectionProvider);
 }
 /**
  * Creates a new <code>OpenActionGroup</code>. The group requires that the selection provided by
  * the page's selection provider is of type {@link IStructuredSelection}.
  *
  * @param page the page that owns this action group
  */
 public OpenViewActionGroup(Page page) {
   createSiteActions(page.getSite(), null);
 }
 /**
  * Creates a new <code>GenerateActionGroup</code>. The group requires that the selection provided
  * by the page's selection provider is of type <code>
  * org.eclipse.jface.viewers.IStructuredSelection</code>.
  *
  * @param page the page that owns this action group
  */
 public GenerateActionGroup(Page page) {
   this(page.getSite());
 }
 /**
  * Creates a new <code>GenerateActionGroup</code>. The group requires that the selection provided
  * by the page's selection provider is of type <code>
  * org.eclipse.jface.viewers.IStructuredSelection</code>.
  *
  * @param page the page that owns this action group
  */
 public GenerateBuildPathActionGroup(Page page) {
   this(page.getSite());
 }