Search in sources :

Example 1 with IActionBars

use of org.eclipse.ui.IActionBars in project GT by Tencent.

the class DevicesView method createLocalToolBar.

/**
	 * 初始化工具栏
	 */
private void createLocalToolBar() {
    IActionBars bars = getViewSite().getActionBars();
    IToolBarManager manager = bars.getToolBarManager();
    manager.add(testAction);
    manager.add(refreshAction);
    manager.add(openLogWithChartAction);
    manager.add(openResultDirAction);
}
Also used : IToolBarManager(org.eclipse.jface.action.IToolBarManager) IActionBars(org.eclipse.ui.IActionBars)

Example 2 with IActionBars

use of org.eclipse.ui.IActionBars in project GT by Tencent.

the class PMAPView method createLocalToolBar.

/**
	 * 添加工具条
	 */
private void createLocalToolBar() {
    IActionBars bars = getViewSite().getActionBars();
    IToolBarManager manager = bars.getToolBarManager();
    manager.add(openLogAction);
}
Also used : IToolBarManager(org.eclipse.jface.action.IToolBarManager) IActionBars(org.eclipse.ui.IActionBars)

Example 3 with IActionBars

use of org.eclipse.ui.IActionBars in project dbeaver by serge-rider.

the class EntityEditorContributor method registerSearchActions.

public static void registerSearchActions(IEditorPart activeEditor) {
    if (activeEditor == null) {
        return;
    }
    IActionBars actionBars = activeEditor.getEditorSite().getActionBars();
    if (activeEditor instanceof ISearchContextProvider) {
        ISearchContextProvider provider = (ISearchContextProvider) activeEditor;
        if (provider.isSearchPossible()) {
            ContextSearchAction findAction = new ContextSearchAction(provider, ISearchContextProvider.SearchType.NONE);
            findAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE);
            actionBars.setGlobalActionHandler(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE, findAction);
            ContextSearchAction findNextAction = new ContextSearchAction(provider, ISearchContextProvider.SearchType.NEXT);
            findNextAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_NEXT);
            actionBars.setGlobalActionHandler(IWorkbenchActionDefinitionIds.FIND_NEXT, findNextAction);
            ContextSearchAction findPrevAction = new ContextSearchAction(provider, ISearchContextProvider.SearchType.PREVIOUS);
            findPrevAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_PREVIOUS);
            actionBars.setGlobalActionHandler(IWorkbenchActionDefinitionIds.FIND_PREVIOUS, findPrevAction);
        }
    } else {
        actionBars.setGlobalActionHandler(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE, null);
        actionBars.setGlobalActionHandler(IWorkbenchActionDefinitionIds.FIND_NEXT, null);
        actionBars.setGlobalActionHandler(IWorkbenchActionDefinitionIds.FIND_PREVIOUS, null);
    }
    actionBars.updateActionBars();
}
Also used : ISearchContextProvider(org.jkiss.dbeaver.ui.ISearchContextProvider) ContextSearchAction(org.jkiss.dbeaver.ui.actions.common.ContextSearchAction) IActionBars(org.eclipse.ui.IActionBars)

Example 4 with IActionBars

use of org.eclipse.ui.IActionBars in project azure-tools-for-java by Microsoft.

the class ServiceExplorerView method contributeToActionBars.

private void contributeToActionBars() {
    IActionBars bars = getViewSite().getActionBars();
    fillLocalToolBar(bars.getToolBarManager());
    updateActions();
    try {
        Runnable signInOutListener = new Runnable() {

            @Override
            public void run() {
                updateActions();
            }
        };
        AuthMethodManager.getInstance().addSignInEventListener(signInOutListener);
        AuthMethodManager.getInstance().addSignOutEventListener(signInOutListener);
    } catch (Exception ex) {
        DefaultLoader.getUIHelper().logError(ex.getMessage(), ex);
    }
}
Also used : IActionBars(org.eclipse.ui.IActionBars) AzureCmdException(com.microsoft.azuretools.azurecommons.helpers.AzureCmdException)

Example 5 with IActionBars

use of org.eclipse.ui.IActionBars in project tdi-studio-se by Talend.

the class JobHierarchyViewPart method createPartControl.

@Override
public void createPartControl(Composite container) {
    fParent = container;
    addResizeListener(fParent);
    fPagebook = new PageBook(container, SWT.NONE);
    // page 1 of page book (no hierarchy label)
    fNoHierarchyShownLabel = new Label(fPagebook, SWT.TOP + SWT.LEFT + SWT.WRAP);
    fNoHierarchyShownLabel.setText(showEmptyLabel);
    // page 2 of page book (viewers)
    fTypeMethodsSplitter = new SashForm(fPagebook, SWT.VERTICAL);
    fTypeMethodsSplitter.setVisible(false);
    fTypeViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
    Control typeViewerControl = createTypeViewerControl(fTypeViewerViewForm);
    fTypeViewerViewForm.setContent(typeViewerControl);
    dependencyViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
    fTypeMethodsSplitter.setWeights(new int[] { 65, 35 });
    Control dependencyViewerPart = createMethodViewerControl(dependencyViewerViewForm);
    dependencyViewerViewForm.setContent(dependencyViewerPart);
    dependencyViewerPaneLabel = new CLabel(dependencyViewerViewForm, SWT.NONE);
    dependencyViewerViewForm.setTopLeft(dependencyViewerPaneLabel);
    ToolBar methodViewerToolBar = new ToolBar(dependencyViewerViewForm, SWT.FLAT | SWT.WRAP);
    dependencyViewerViewForm.setTopCenter(methodViewerToolBar);
    initDragAndDrop();
    MenuManager menu = new MenuManager();
    menu.add(focusOnTypeAction);
    fNoHierarchyShownLabel.setMenu(menu.createContextMenu(fNoHierarchyShownLabel));
    fPagebook.showPage(fNoHierarchyShownLabel);
    int layout;
    try {
        layout = fDialogSettings.getInt(DIALOGSTORE_VIEWLAYOUT);
        if (layout < 0 || layout > 3) {
            layout = VIEW_LAYOUT_AUTOMATIC;
        }
    } catch (NumberFormatException e) {
        layout = VIEW_LAYOUT_AUTOMATIC;
    }
    // force the update
    fCurrentLayout = -1;
    // will fill the main tool bar
    setViewLayout(layout);
    // set the filter menu items
    IActionBars actionBars = getViewSite().getActionBars();
    IMenuManager viewMenu = actionBars.getMenuManager();
    // for (int i = 0; i < fViewActions.length; i++) {
    // ToggleViewAction action = fViewActions[i];
    // viewMenu.add(action);
    // action.setEnabled(false);
    // }
    // viewMenu.add(new Separator());
    // IMenuManager layoutSubMenu = new MenuManager(TypeHierarchyMessages.TypeHierarchyViewPart_layout_submenu);
    //$NON-NLS-1$
    IMenuManager layoutSubMenu = new MenuManager(Messages.getString("FocusOnJobAction.TypeHierarchyViewPart_layout_submenu"));
    viewMenu.add(layoutSubMenu);
    for (int i = 0; i < fToggleOrientationActions.length; i++) {
        layoutSubMenu.add(fToggleOrientationActions[i]);
    }
    viewMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    // selection provider
    int nHierarchyViewers = fAllViewers.length;
    StructuredViewer[] trackedViewers = new StructuredViewer[nHierarchyViewers + 1];
    for (int i = 0; i < nHierarchyViewers; i++) {
        trackedViewers[i] = fAllViewers[i];
    }
    trackedViewers[nHierarchyViewers] = dependencyViewer;
    fSelectionProviderMediator = new SelectionProviderMediator(trackedViewers, getCurrentViewer());
    getSite().setSelectionProvider(fSelectionProviderMediator);
    ActionGroup[] actionGroups = new ActionGroup[] { new JobActionGroup() };
    fActionGroups = new CompositeActionGroup(actionGroups);
    fActionGroups.fillActionBars(actionBars);
}
Also used : CLabel(org.eclipse.swt.custom.CLabel) CompositeActionGroup(org.eclipse.jdt.internal.ui.actions.CompositeActionGroup) CLabel(org.eclipse.swt.custom.CLabel) Label(org.eclipse.swt.widgets.Label) SelectionProviderMediator(org.eclipse.jdt.internal.ui.viewsupport.SelectionProviderMediator) Point(org.eclipse.swt.graphics.Point) SashForm(org.eclipse.swt.custom.SashForm) ViewForm(org.eclipse.swt.custom.ViewForm) Control(org.eclipse.swt.widgets.Control) PageBook(org.eclipse.ui.part.PageBook) ActionGroup(org.eclipse.ui.actions.ActionGroup) CompositeActionGroup(org.eclipse.jdt.internal.ui.actions.CompositeActionGroup) ToolBar(org.eclipse.swt.widgets.ToolBar) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) StructuredViewer(org.eclipse.jface.viewers.StructuredViewer) IActionBars(org.eclipse.ui.IActionBars) Separator(org.eclipse.jface.action.Separator)

Aggregations

IActionBars (org.eclipse.ui.IActionBars)45 IToolBarManager (org.eclipse.jface.action.IToolBarManager)20 Action (org.eclipse.jface.action.Action)17 RecordAction (com.cubrid.cubridmanager.ui.monitoring.editor.internal.RecordAction)6 Separator (org.eclipse.jface.action.Separator)5 TableLayout (org.eclipse.jface.viewers.TableLayout)3 ActionManager (com.cubrid.common.ui.spi.action.ActionManager)2 ApplyServerInfo (com.cubrid.cubridmanager.core.broker.model.ApplyServerInfo)2 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)2 BrokerStatusSettingDlg (com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerStatusSettingDlg)2 ArrayList (java.util.ArrayList)2 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Tree (org.eclipse.swt.widgets.Tree)2 CopyAction (org.talend.designer.runtime.visualization.internal.actions.CopyAction)2 HttpClient (aQute.bnd.http.HttpClient)1 RemoteRepositoryPlugin (aQute.bnd.service.RemoteRepositoryPlugin)1 RepositoryPlugin (aQute.bnd.service.RepositoryPlugin)1 ContinueSearchElement (bndtools.model.repo.ContinueSearchElement)1 RepositoryBundle (bndtools.model.repo.RepositoryBundle)1