Java 类org.eclipse.jface.action.ToolBarManager 实例源码

项目:Hydrograph    文件:ExecutionTrackingConsole.java   
/**
 * Create the coolbar manager.
 *
 * @param style the style
 * @return the coolbar manager
 */
@Override
protected CoolBarManager createCoolBarManager(int style) {

    CoolBarManager coolBarManager = new CoolBarManager(style);

    actionFactory = new ActionFactory(this);

    ToolBarManager toolBarManager = new ToolBarManager();
    coolBarManager.add(toolBarManager);
    addtoolbarAction(toolBarManager, ImagePathConstant.CLEAR_EXEC_TRACKING_CONSOLE,
            actionFactory.getAction(ClearConsoleAction.class.getName()));
    addtoolbarAction(toolBarManager, ImagePathConstant.CONSOLE_SCROLL_LOCK, 
            actionFactory.getAction(ScrollLockAction.class.getName()));

    return coolBarManager;
}
项目:avro-schema-editor    文件:SchemaToolBarConfigurationImpl.java   
protected void fillEditionToolBar(ToolBarManager manager) {
    // add element
    AddContextualAction(manager, 
            new AddElementAction("Add new element", IAction.AS_PUSH_BUTTON, Notifications.notifyRefreshReveal(getContext())));      
    // remove element
    AddContextualAction(manager, 
            new RemoveElementAction("Remove element(s)", IAction.AS_PUSH_BUTTON, Notifications.NOT_REF));       
    // move up
    AddContextualAction(manager, 
            new MoveInDirectionAction(MoveInDirectionAction.getLabel(Direction.UP), IAction.AS_PUSH_BUTTON, Direction.UP, Notifications.NOT_REF));
    // move down
    AddContextualAction(manager,
            new MoveInDirectionAction(MoveInDirectionAction.getLabel(Direction.DOWN), IAction.AS_PUSH_BUTTON, Direction.DOWN, Notifications.NOT_REF));      
    // copy
    AddContextualAction(manager,        
            new CopyElementAction("Copy element(s)", IAction.AS_PUSH_BUTTON, Notifications.NONE));
    // paste
    AddContextualAction(manager,
            new PasteElementAction("Paste element(s)", IAction.AS_PUSH_BUTTON, Notifications.NOT_REF));
}
项目:subclipse    文件:SvnWizardLockPage.java   
private void addResourcesArea(Composite composite) {  
    ResourceSelectionTree.IToolbarControlCreator toolbarControlCreator = new ResourceSelectionTree.IToolbarControlCreator() {
  public void createToolbarControls(ToolBarManager toolbarManager) {
    toolbarManager.add(new ControlContribution("stealLock") {
      protected Control createControl(Composite parent) {
        stealButton = new Button(parent, SWT.CHECK);
        stealButton.setText(Policy.bind("LockDialog.stealLock")); //$NON-NLS-1$     
        return stealButton;
      }
    });
  }
  public int getControlCount() {
    return 1;
  }
};
    resourceSelectionTree = new ResourceSelectionTree(composite, SWT.NONE, "These files will be locked:", files, new HashMap(), null, false, toolbarControlCreator, null); //$NON-NLS-1$        
    resourceSelectionTree.setShowRemoveFromViewAction(false);
}
项目:javapasswordsafe    文件:PasswordSafeJFace.java   
/**
 * @see org.eclipse.jface.window.ApplicationWindow#createToolBarManager(int)
 */
@Override
protected ToolBarManager createToolBarManager(final int style) {
    final ToolBarManager toolBarManager = new ToolBarManager(style);

    toolBarManager.add(newFileAction);
    toolBarManager.add(openFileAction);
    toolBarManager.add(saveFileAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(copyUsernameAction);
    toolBarManager.add(copyPasswordAction);
    toolBarManager.add(copyURLAction);
    toolBarManager.add(openUrlAction);
    toolBarManager.add(clearClipboardAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(addRecordAction);
    toolBarManager.add(editRecordAction);
    toolBarManager.add(deleteRecordAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(helpAction);
    return toolBarManager;
}
项目:xstreamer    文件:BrowserActionBarAdvisor.java   
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
    IToolBarManager toolBar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
    coolBar.add(new ToolBarContributionItem(toolBar, "standard")); //$NON-NLS-1$

    // For the Back and Forward actions, force their text to be shown on the toolbar,
    // not just their image.  For the remaining actions, the ActionContributionItem
    // is created implicitly with the default presentation mode.
    ActionContributionItem backCI = new ActionContributionItem(backAction);
    backCI.setMode(ActionContributionItem.MODE_FORCE_TEXT);
    toolBar.add(backCI);

    ActionContributionItem forwardCI = new ActionContributionItem(forwardAction);
    forwardCI.setMode(ActionContributionItem.MODE_FORCE_TEXT);
    toolBar.add(forwardCI);

    toolBar.add(stopAction);
    toolBar.add(refreshAction);
}
项目:PDFReporter-Studio    文件:TFContainer.java   
public TFContainer(Composite parent, int style) {
    super(parent, style);
    GridLayout layout = new GridLayout(2,false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = 0;
    setLayout(layout);

    toolBar = new ToolBar(this, SWT.HORIZONTAL | SWT.FLAT | SWT.WRAP | SWT.RIGHT);

    additionalToolbar = new ToolBar(this, SWT.HORIZONTAL | SWT.FLAT | SWT.WRAP | SWT.RIGHT);
    GridData additionalToolbarGD = new GridData(SWT.RIGHT, SWT.CENTER, true, false);
    additionalToolbar.setLayoutData(additionalToolbarGD);
    additionalToolbarManager = new ToolBarManager(additionalToolbar);

    content = new Composite(this, SWT.NONE);
    stackLayout = new StackLayout();
    stackLayout.marginWidth = 0;
    stackLayout.marginHeight = 0;
    content.setLayout(stackLayout);
    content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
}
项目:PDFReporter-Studio    文件:LeftToolBarManager.java   
@Override
protected void createToolBar(Composite parent) {
    prmtbar = new Composite(parent, SWT.NONE);
    prmtbar.setLayout(new GridLayout(2, false));
    prmtbar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    label = new Label(prmtbar, SWT.NONE);
    label.setText(Messages.LeftToolBarManager_label);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    topToolBar = new ToolBar(prmtbar, SWT.FLAT | SWT.WRAP | SWT.RIGHT);

    tbManager = new ToolBarManager(topToolBar);

    fillToolbar(tbManager);

    refreshToolbar();
}
项目:limpet    文件:ApplicationWorkbenchWindowAdvisor.java   
public Control createEmptyWindowContents(Composite parent)
{
  final IWorkbenchWindow window = getWindowConfigurer().getWindow();
  Composite composite = new Composite(parent, SWT.NONE);
  composite.setLayout(new GridLayout(2, false));
  Display display = composite.getDisplay();
  Color bgCol = display.getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND);
  composite.setBackground(bgCol);
  Label label = new Label(composite, SWT.WRAP);
  label.setForeground(display
      .getSystemColor(SWT.COLOR_TITLE_INACTIVE_FOREGROUND));
  label.setBackground(bgCol);
  label.setFont(JFaceResources.getFontRegistry().getBold(
      JFaceResources.DEFAULT_FONT));
  String msg = IDEWorkbenchMessages.IDEWorkbenchAdvisor_noPerspective;
  label.setText(msg);
  ToolBarManager toolBarManager = new ToolBarManager();
  // TODO: should obtain the open perspective action from ActionFactory
  openPerspectiveAction =
      ActionFactory.OPEN_PERSPECTIVE_DIALOG.create(window);
  toolBarManager.add(openPerspectiveAction);
  ToolBar toolBar = toolBarManager.createControl(composite);
  toolBar.setBackground(bgCol);
  return composite;
}
项目:APICloud-Studio    文件:AbstractDocumentationHover.java   
public IInformationControl doCreateInformationControl(Shell parent)
{
    if (BrowserInformationControl.isAvailable(parent))
    {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        CustomBrowserInformationControl iControl = new CustomBrowserInformationControl(parent, null, tbm);
        iControl.setBackgroundColor(documentationHover.getBackgroundColor());
        iControl.setForegroundColor(documentationHover.getForegroundColor());
        documentationHover.populateToolbarActions(tbm, iControl);
        tbm.update(true);
        documentationHover.installLinkListener(iControl);
        return iControl;
    }
    else
    {
        return new DefaultInformationControl(parent, true);
    }
}
项目:APICloud-Studio    文件:CustomAbstractInformationControl.java   
private void createToolBar(ToolBarManager toolBarManager)
{
    final Composite bars = new Composite(fStatusComposite, SWT.NONE);
    bars.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));

    GridLayout layout = new GridLayout(3, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    bars.setLayout(layout);

    fToolBar = toolBarManager.createControl(bars);
    GridData gd = new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
    fToolBar.setLayoutData(gd);

    Composite spacer = new Composite(bars, SWT.NONE);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd.widthHint = 0;
    gd.heightHint = 0;
    spacer.setLayoutData(gd);

    addMoveSupport(spacer);
    addResizeSupportIfNecessary(bars);
}
项目:APICloud-Studio    文件:SvnWizardLockPage.java   
private void addResourcesArea(Composite composite) {  
    ResourceSelectionTree.IToolbarControlCreator toolbarControlCreator = new ResourceSelectionTree.IToolbarControlCreator() {
  public void createToolbarControls(ToolBarManager toolbarManager) {
    toolbarManager.add(new ControlContribution("stealLock") {
      protected Control createControl(Composite parent) {
        stealButton = new Button(parent, SWT.CHECK);
        stealButton.setText(Policy.bind("LockDialog.stealLock")); //$NON-NLS-1$     
        return stealButton;
      }
    });
  }
  public int getControlCount() {
    return 1;
  }
};
    resourceSelectionTree = new ResourceSelectionTree(composite, SWT.NONE, "These files will be locked:", files, new HashMap(), null, false, toolbarControlCreator, null); //$NON-NLS-1$        
    resourceSelectionTree.setShowRemoveFromViewAction(false);
}
项目:APICloud-Studio    文件:JSTextHover.java   
@Override
public void populateToolbarActions(ToolBarManager tbm, CustomBrowserInformationControl iControl)
{
    final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
    final OpenHelpAction openHelpAction = new OpenHelpAction(iControl);
    tbm.add(openDeclarationAction);
    tbm.add(openHelpAction);
    IInputChangedListener inputChangeListener = new IInputChangedListener()
    {
        public void inputChanged(Object newInput)
        {
            if (newInput instanceof BrowserInformationControlInput)
            {
                openDeclarationAction.update();
                openHelpAction.update();
            }
        }
    };
    iControl.addInputChangeListener(inputChangeListener);
}
项目:APICloud-Studio    文件:WebBrowserViewer.java   
private void createNavigationBar(Composite parent)
{
    toolBarManager = new ToolBarManager(SWT.FLAT);
    toolBarManager.add(consoleAction);
    toolBarManager.add(backAction);
    toolBarManager.add(forwardAction);
    toolBarManager.add(stopAction);
    toolBarManager.add(refreshAction);
    ToolBar toolbar = toolBarManager.createControl(parent);
    toolbar.setLayoutData(GridDataFactory.fillDefaults().create());

    urlCombo = new Combo(parent, SWT.DROP_DOWN);
    urlCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
    urlCombo.addListener(SWT.DefaultSelection, new Listener() {

        @Override
        public void handleEvent(Event e) {
            setURL(urlCombo.getText());
        }
    });

    ToolBarManager toolBarManager2 = new ToolBarManager(SWT.FLAT);
    toolBarManager2.add(goAction);
    toolbar = toolBarManager2.createControl(parent);
    toolbar.setLayoutData(GridDataFactory.fillDefaults().create());
}
项目:APICloud-Studio    文件:HTMLTextHover.java   
@Override
public void populateToolbarActions(ToolBarManager tbm, CustomBrowserInformationControl iControl)
{
    // @formatter:off
    /*
    final OpenDOMReferenceAction openReferenceAction = new OpenDOMReferenceAction(iControl);
    tbm.add(openReferenceAction);
    IInputChangedListener inputChangeListener = new IInputChangedListener()
    {

        public void inputChanged(Object newInput)
        {
            if (newInput instanceof BrowserInformationControlInput)
            {
                openReferenceAction.update();
            }
        }
    };
    iControl.addInputChangeListener(inputChangeListener);
    */
    // @formatter:on
}
项目:durian-swt    文件:CoatMuxTest.java   
@Test
public void ctabFolderTest() {
    InteractiveTest.testCoat("Test coat mux layout behavior inside a CTabFolder.", cmp -> {
        Layouts.setGrid(cmp);
        CTabFolder folder = new CTabFolder(cmp, SWT.BORDER | SWT.CLOSE);
        Layouts.setGridData(folder).grabAll();

        ToolBarManager manager = new ToolBarManager();
        manager.add(Actions.create("Add", () -> {
            CTabItem item = new CTabItem(folder, SWT.NONE);
            item.setText("New control");
            Composite parent = new Composite(folder, SWT.NONE);
            randomColorMux(parent);
            item.setControl(parent);
            item.addListener(SWT.Dispose, e -> item.getControl().dispose());
            folder.setSelection(item);
        }));
        Layouts.setGridData(manager.createControl(cmp)).grabHorizontal();
    });
}
项目:mytourbook    文件:DialogSelectMap3Color.java   
private void createUI_20_Actions(final Composite parent) {

        final Composite container = new Composite(parent, SWT.NONE);
        GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
        GridLayoutFactory
                .fillDefaults()//
                .numColumns(2)
                .extendedMargins(2, 0, 3, 2)
                .applyTo(container);
        {

            final ToolBar toolbar = new ToolBar(container, SWT.FLAT);

            final ToolBarManager tbm = new ToolBarManager(toolbar);

            tbm.add(_actionAddColor);
            tbm.add(_actionEditSelectedColor);
            tbm.add(_actionEditAllColors);

            tbm.update(true);
        }
    }
项目:mytourbook    文件:PhotoToolTipUI.java   
private void fillActionBar() {

        /*
         * fill exit toolbar
         */
        final ToolBarManager exitToolbarManager = new ToolBarManager(_ttToolbarControlExit);

        exitToolbarManager.add(_actionCloseToolTip);
        exitToolbarManager.add(_actionPinToolTip);
        exitToolbarManager.add(_actionToolTipLocation);

        exitToolbarManager.update(true);

        /*
         * fill gallery toolbar
         */
        _galleryToolbarManager = new ToolBarManager(_galleryToolbarControl);

        _galleryToolbarManager.add(_actionToggleGalleryOrientation);
        _galleryToolbarManager.add(new Separator());
    }
项目:mytourbook    文件:ValuePointToolTipUI.java   
private void createUI_030_Actions(final Composite parent) {

        /*
         * create toolbar
         */
        _toolbarControl = new ToolBar(parent, SWT.FLAT);
        GridDataFactory.fillDefaults()//
//              .align(SWT.END, SWT.FILL)
                .align(SWT.END, SWT.BEGINNING)
                .applyTo(_toolbarControl);
        _toolbarControl.setForeground(_fgColor);
        _toolbarControl.setBackground(_bgColor);
//      _toolbarControl.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));
//      _toolbarControl.setBackground(_fgToolbar);

        final ToolBarManager tbm = new ToolBarManager(_toolbarControl);

        tbm.add(_actionOpenTooltipMenu);

        tbm.update(true);
    }
项目:mytourbook    文件:SlideoutStatisticOptions.java   
private void createUI_12_Actions(final Composite parent) {

        final ToolBar toolbar = new ToolBar(parent, SWT.FLAT);
        GridDataFactory
                .fillDefaults()//
                .grab(true, false)
                .align(SWT.END, SWT.BEGINNING)
                .applyTo(toolbar);

        final ToolBarManager tbm = new ToolBarManager(toolbar);

        tbm.add(_actionRestoreDefaults);
        tbm.add(_actionPrefDialog);

        tbm.update(true);
    }
项目:mytourbook    文件:PicDirImages.java   
/**
 * fill gallery actionbar
 * 
 * @param galleryActionBarContainer
 */
private void createUI_20_GalleryToolbars(final Composite galleryActionBarContainer) {

    /*
     * toolbar actions
     */
    _galleryToolbar = new ToolBar(galleryActionBarContainer, SWT.FLAT);
    GridDataFactory.fillDefaults()//
            .align(SWT.BEGINNING, SWT.CENTER)
            .applyTo(_galleryToolbar);

    final ToolBarManager tbm = new ToolBarManager(_galleryToolbar);

    tbm.add(_actionToggleFolderGallery);
    tbm.add(_actionNavigateBackward);
    tbm.add(_actionNavigateForward);

    tbm.update(true);
}
项目:n4js    文件:TestResultsView.java   
private void contributeToActionBars() {
    final IActionBars bars = getViewSite().getActionBars();
    fillLocalPullDown(bars.getMenuManager());
    fillLocalToolBar(bars.getToolBarManager());
    // a custom tool bar works slightly differently:
    final ToolBarManager m = new ToolBarManager(toolBar);
    fillCustomToolBar(m);
    m.update(true);
}
项目:android-uiautomatorviewer    文件:UiAutomatorViewer.java   
@Override
protected Control createContents(Composite parent) {
  Composite c = new Composite(parent, SWT.BORDER);

  GridLayout gridLayout = new GridLayout(1, false);
  gridLayout.marginWidth = 0;
  gridLayout.marginHeight = 0;
  gridLayout.horizontalSpacing = 0;
  gridLayout.verticalSpacing = 0;
  c.setLayout(gridLayout);

  GridData gd = new GridData(GridData.FILL_HORIZONTAL);
  c.setLayoutData(gd);

  ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
  toolBarManager.add(new OpenFilesAction(this));
  toolBarManager.add(new ScreenshotAction(this, false));
  toolBarManager.add(new ScreenshotAction(this, true));
  toolBarManager.add(new SaveScreenShotAction(this));
  ToolBar tb = toolBarManager.createControl(c);
  tb.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

  mUiAutomatorView = new UiAutomatorView(c, SWT.BORDER);
  mUiAutomatorView.setLayoutData(new GridData(GridData.FILL_BOTH));

  return parent;
}
项目:neoscada    文件:ApplicationActionBarAdvisor.java   
@Override
protected void fillCoolBar ( final ICoolBarManager coolBar )
{
    final IToolBarManager toolbar = new ToolBarManager ( SWT.FLAT | SWT.RIGHT );
    coolBar.add ( new ToolBarContributionItem ( toolbar, "main" ) );
    toolbar.add ( getAction ( ActionFactory.NEW_WIZARD_DROP_DOWN.getId () ) );
    coolBar.add ( new GroupMarker ( IWorkbenchActionConstants.MB_ADDITIONS ) );
}
项目:Hydrograph    文件:ComponentFigure.java   
private ComponentTooltip getToolBarToolTip(Shell parent, org.eclipse.swt.graphics.Rectangle toltipBounds) {
    ToolBarManager toolBarManager = new ToolBarManager();
    ComponentTooltip tooltip = new ComponentTooltip(component,parent, toolBarManager, propertyToolTipInformation);
    org.eclipse.swt.graphics.Point location = new org.eclipse.swt.graphics.Point(toltipBounds.x, toltipBounds.y);
    tooltip.setLocation(location);
    tooltip.setSize(toltipBounds.width + 20, toltipBounds.height + 20);
    return tooltip;
}
项目:Hydrograph    文件:ComponentTooltip.java   
/**
 * 
 * create tooltip with toolbar
 * 
 * @param parent
 * @param toolBarManager
 * @param propertyToolTipInformation
 */
public ComponentTooltip(Component component,Shell parent, ToolBarManager toolBarManager,Map<String,PropertyToolTipInformation> propertyToolTipInformation) {
    super(parent, toolBarManager);
    this.toolBarManager= getToolBarManager();
    this.component=component;
    this.componentToolTipInformation = propertyToolTipInformation;      
    logger.debug("ComponentTooltip.ComponentTooltip: Creating tooltip with toolbar: " + this.toolBarManager + " , " + this.componentToolTipInformation.toString());
    create();
}
项目:Hydrograph    文件:DebugDataViewer.java   
private void addtoolbarAction(ToolBarManager toolBarManager, final ImagePathConstant imagePath, Action action) {

        ImageDescriptor exportImageDescriptor = new ImageDescriptor() {
            @Override
            public ImageData getImageData() {
                return imagePath.getImageFromRegistry().getImageData();
            }
        };
        action.setImageDescriptor(exportImageDescriptor);
        toolBarManager.add(action);
    }
项目:Hydrograph    文件:ApplicationActionBarAdvisor.java   
@Override
  protected void fillCoolBar(ICoolBarManager coolBar) {
    super.fillCoolBar(coolBar);
    IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.LEFT);
coolBar.add(new ToolBarContributionItem(toolbar, HYDROGRAPH_UI_GRAPH_TOOLBAR_ID));

  }
项目:Hydrograph    文件:ExecutionTrackingConsole.java   
/**
 * Addtoolbar action.
 *
 * @param toolBarManager the tool bar manager
 * @param imagePath the image path
 * @param action the action
 */
private void addtoolbarAction(ToolBarManager toolBarManager, final ImagePathConstant imagePath, Action action) {

    ImageDescriptor exportImageDescriptor = new ImageDescriptor() {
        @Override
        public ImageData getImageData() {
            return imagePath.getImageFromRegistry().getImageData();
        }
    };
    action.setImageDescriptor(exportImageDescriptor);
    toolBarManager.add(action);
}
项目:solidity-ide    文件:CustomCSSHelpHoverProvider.java   
protected void configureControl(
        IXtextBrowserInformationControl control, ToolBarManager tbm,
        String font) {
    OpenInHelpAction openHelpAction = new OpenInHelpAction();
    openHelpAction.setEnabled(true);
    tbm.add(openHelpAction);
    tbm.update(true);
}
项目:avro-schema-editor    文件:StudioToolBarConfigurationImpl.java   
@Override
public void fillToolBar(ToolBarManager manager, String toolBarId) {
    if (TOP_TOOLBAR_ID.equals(toolBarId)) {
        fillTopToolBar(manager);
    } else if (toolBarId.equals(getToolBarId(Kind.EDITION))) {
        fillEditionToolBar(manager);
    }
}
项目:avro-schema-editor    文件:SchemaViewer.java   
protected ToolBarManager createToolBar(Composite parent, int style) {
    ToolBarManager toolbarManager = new ToolBarManager(style);

    int gridDataStyle = isBeginning(style) ? GridData.HORIZONTAL_ALIGN_BEGINNING : GridData.HORIZONTAL_ALIGN_END;

       ToolBar toolbar = toolbarManager.createControl(parent);
       GridData toolbarLayoutdata = new GridData(gridDataStyle);
       toolbarLayoutdata.heightHint = 25;
       toolbar.setLayoutData(toolbarLayoutdata);

    return toolbarManager;
}
项目:avro-schema-editor    文件:SchemaToolBarConfigurationImpl.java   
@Override
public void fillToolBar(ToolBarManager manager, String toolBarId) {
    Kind toolBarKind = getToolBarKind(toolBarId);
    if (toolBarKind != null) {
        fillToolBar(manager, toolBarKind);
    }
}
项目:avro-schema-editor    文件:SchemaToolBarConfigurationImpl.java   
protected void fillToolBar(ToolBarManager manager, Kind toolBarKind) {
    switch (toolBarKind) {
    case EDITION:
        fillEditionToolBar(manager);
        break;
    default:
        populateToolBar(manager, getToolBarId(toolBarKind));
        break;
    }
}
项目:DarwinSPL    文件:DwprofileTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl iControl = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl(parent, FONT, tbm);
        final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
        tbm.add(openDeclarationAction);
        final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();

        IInputChangedListener inputChangeListener = new IInputChangedListener() {
            public void inputChanged(Object newInput) {
                if (newInput == null) {
                    selectionProvider.setSelection(new StructuredSelection());
                } else if (newInput instanceof de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput) {
                    de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput input = (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput) newInput;
                    Object inputElement = input.getInputElement();
                    selectionProvider.setSelection(new StructuredSelection(inputElement));
                    // If there is an element of type EObject in the input element, the button to open
                    // the declaration will be set enable
                    boolean isEObjectInput = inputElement instanceof EObject;
                    openDeclarationAction.setEnabled(isEObjectInput);
                    if (isEObjectInput) {
                        String simpleName = inputElement.getClass().getSimpleName();
                        simpleName = simpleName.substring(0, simpleName.length() - 4);
                        openDeclarationAction.setText("Open " + simpleName);
                    } else                          openDeclarationAction.setText("Open Declaration");
                }
            }
        };
        iControl.addInputChangeListener(inputChangeListener);

        tbm.update(true);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}
项目:DarwinSPL    文件:HyexpressionTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl iControl = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl(parent, FONT, tbm);
        final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
        tbm.add(openDeclarationAction);
        final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();

        IInputChangedListener inputChangeListener = new IInputChangedListener() {
            public void inputChanged(Object newInput) {
                if (newInput == null) {
                    selectionProvider.setSelection(new StructuredSelection());
                } else if (newInput instanceof eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput) {
                    eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput input = (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput) newInput;
                    Object inputElement = input.getInputElement();
                    selectionProvider.setSelection(new StructuredSelection(inputElement));
                    // If there is an element of type EObject in the input element, the button to open
                    // the declaration will be set enable
                    boolean isEObjectInput = inputElement instanceof EObject;
                    openDeclarationAction.setEnabled(isEObjectInput);
                    if (isEObjectInput) {
                        String simpleName = inputElement.getClass().getSimpleName();
                        simpleName = simpleName.substring(0, simpleName.length() - 4);
                        openDeclarationAction.setText("Open " + simpleName);
                    } else                          openDeclarationAction.setText("Open Declaration");
                }
            }
        };
        iControl.addInputChangeListener(inputChangeListener);

        tbm.update(true);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}
项目:DarwinSPL    文件:HyvalidityformulaTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl iControl = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl(parent, FONT, tbm);
        final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
        tbm.add(openDeclarationAction);
        final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();

        IInputChangedListener inputChangeListener = new IInputChangedListener() {
            public void inputChanged(Object newInput) {
                if (newInput == null) {
                    selectionProvider.setSelection(new StructuredSelection());
                } else if (newInput instanceof eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput) {
                    eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput input = (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput) newInput;
                    Object inputElement = input.getInputElement();
                    selectionProvider.setSelection(new StructuredSelection(inputElement));
                    // If there is an element of type EObject in the input element, the button to open
                    // the declaration will be set enable
                    boolean isEObjectInput = inputElement instanceof EObject;
                    openDeclarationAction.setEnabled(isEObjectInput);
                    if (isEObjectInput) {
                        String simpleName = inputElement.getClass().getSimpleName();
                        simpleName = simpleName.substring(0, simpleName.length() - 4);
                        openDeclarationAction.setText("Open " + simpleName);
                    } else                          openDeclarationAction.setText("Open Declaration");
                }
            }
        };
        iControl.addInputChangeListener(inputChangeListener);

        tbm.update(true);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}
项目:DarwinSPL    文件:HydatavalueTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl iControl = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl(parent, FONT, tbm);
        final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
        tbm.add(openDeclarationAction);
        final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();

        IInputChangedListener inputChangeListener = new IInputChangedListener() {
            public void inputChanged(Object newInput) {
                if (newInput == null) {
                    selectionProvider.setSelection(new StructuredSelection());
                } else if (newInput instanceof eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput) {
                    eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput input = (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput) newInput;
                    Object inputElement = input.getInputElement();
                    selectionProvider.setSelection(new StructuredSelection(inputElement));
                    // If there is an element of type EObject in the input element, the button to open
                    // the declaration will be set enable
                    boolean isEObjectInput = inputElement instanceof EObject;
                    openDeclarationAction.setEnabled(isEObjectInput);
                    if (isEObjectInput) {
                        String simpleName = inputElement.getClass().getSimpleName();
                        simpleName = simpleName.substring(0, simpleName.length() - 4);
                        openDeclarationAction.setText("Open " + simpleName);
                    } else                          openDeclarationAction.setText("Open Declaration");
                }
            }
        };
        iControl.addInputChangeListener(inputChangeListener);

        tbm.update(true);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}
项目:DarwinSPL    文件:HymappingTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl iControl = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl(parent, FONT, tbm);
        final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
        tbm.add(openDeclarationAction);
        final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();

        IInputChangedListener inputChangeListener = new IInputChangedListener() {
            public void inputChanged(Object newInput) {
                if (newInput == null) {
                    selectionProvider.setSelection(new StructuredSelection());
                } else if (newInput instanceof eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput) {
                    eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput input = (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput) newInput;
                    Object inputElement = input.getInputElement();
                    selectionProvider.setSelection(new StructuredSelection(inputElement));
                    // If there is an element of type EObject in the input element, the button to open
                    // the declaration will be set enable
                    boolean isEObjectInput = inputElement instanceof EObject;
                    openDeclarationAction.setEnabled(isEObjectInput);
                    if (isEObjectInput) {
                        String simpleName = inputElement.getClass().getSimpleName();
                        simpleName = simpleName.substring(0, simpleName.length() - 4);
                        openDeclarationAction.setText("Open " + simpleName);
                    } else                          openDeclarationAction.setText("Open Declaration");
                }
            }
        };
        iControl.addInputChangeListener(inputChangeListener);

        tbm.update(true);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}
项目:DarwinSPL    文件:HyconstraintsTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl iControl = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl(parent, FONT, tbm);
        final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
        tbm.add(openDeclarationAction);
        final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();

        IInputChangedListener inputChangeListener = new IInputChangedListener() {
            public void inputChanged(Object newInput) {
                if (newInput == null) {
                    selectionProvider.setSelection(new StructuredSelection());
                } else if (newInput instanceof eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput) {
                    eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput input = (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput) newInput;
                    Object inputElement = input.getInputElement();
                    selectionProvider.setSelection(new StructuredSelection(inputElement));
                    // If there is an element of type EObject in the input element, the button to open
                    // the declaration will be set enable
                    boolean isEObjectInput = inputElement instanceof EObject;
                    openDeclarationAction.setEnabled(isEObjectInput);
                    if (isEObjectInput) {
                        String simpleName = inputElement.getClass().getSimpleName();
                        simpleName = simpleName.substring(0, simpleName.length() - 4);
                        openDeclarationAction.setText("Open " + simpleName);
                    } else                          openDeclarationAction.setText("Open Declaration");
                }
            }
        };
        iControl.addInputChangeListener(inputChangeListener);

        tbm.update(true);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}
项目:DarwinSPL    文件:HymanifestTextHover.java   
public IInformationControl doCreateInformationControl(Shell parent) {
    if (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl.isAvailable(parent)) {
        ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
        eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl iControl = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl(parent, FONT, tbm);
        final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
        tbm.add(openDeclarationAction);
        final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();

        IInputChangedListener inputChangeListener = new IInputChangedListener() {
            public void inputChanged(Object newInput) {
                if (newInput == null) {
                    selectionProvider.setSelection(new StructuredSelection());
                } else if (newInput instanceof eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput) {
                    eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput input = (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput) newInput;
                    Object inputElement = input.getInputElement();
                    selectionProvider.setSelection(new StructuredSelection(inputElement));
                    // If there is an element of type EObject in the input element, the button to open
                    // the declaration will be set enable
                    boolean isEObjectInput = inputElement instanceof EObject;
                    openDeclarationAction.setEnabled(isEObjectInput);
                    if (isEObjectInput) {
                        String simpleName = inputElement.getClass().getSimpleName();
                        simpleName = simpleName.substring(0, simpleName.length() - 4);
                        openDeclarationAction.setText("Open " + simpleName);
                    } else                          openDeclarationAction.setText("Open Declaration");
                }
            }
        };
        iControl.addInputChangeListener(inputChangeListener);

        tbm.update(true);
        return iControl;
    } else {
        return new DefaultInformationControl(parent, true);
    }
}