Search in sources :

Example 51 with IActionBars

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

the class TalendPaletteHelper method checkAndInitToolBar2.

private static void checkAndInitToolBar2() {
    //
    IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (activeWorkbenchWindow == null || activeWorkbenchWindow.getActivePage() == null) {
        return;
    }
    boolean isTalendEditor = false;
    IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
    IEditorPart activePart = activePage.getActiveEditor();
    if (activePart != null && activePart instanceof AbstractMultiPageTalendEditor) {
        isTalendEditor = true;
    }
    IViewPart paletteViewPart = activePage.findView(PaletteView.ID);
    if (paletteViewPart != null) {
        // find existing or not, and add it.
        IActionBars actionBars = paletteViewPart.getViewSite().getActionBars();
        // ShowStandardAction showStandardAction = ShowStandardAction.getInstance();
        // updatePaletteActions(actionBars, showStandardAction, isTalendEditor);
        //
        // ShowFavoriteAction showFavoriteAction = ShowFavoriteAction.getInstance();
        // updatePaletteActions(actionBars, showFavoriteAction, isTalendEditor);
        //
        // if (ShowFavoriteAction.state) {
        // showStandardAction.doSetEnable();
        // }
        OpenPaletteFilterAction openPaletteFilterAction = OpenPaletteFilterAction.getInstance();
        updatePaletteActions(actionBars, openPaletteFilterAction, isTalendEditor);
        actionBars.updateActionBars();
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IViewPart(org.eclipse.ui.IViewPart) OpenPaletteFilterAction(org.talend.repository.ui.actions.OpenPaletteFilterAction) AbstractMultiPageTalendEditor(org.talend.designer.core.ui.AbstractMultiPageTalendEditor) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IEditorPart(org.eclipse.ui.IEditorPart) IActionBars(org.eclipse.ui.IActionBars)

Example 52 with IActionBars

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

the class ESBRuntimeConsolePageParticipant method init.

@Override
public void init(IPageBookViewPage page, IConsole console) {
    if (page.getControl() instanceof StyledText) {
        StyledText viewer = (StyledText) page.getControl();
        AnsiConsoleStyleListener myListener = new AnsiConsoleStyleListener();
        viewer.addLineStyleListener(myListener);
        ESBRunContainerPlugin.getDefault().addViewer(viewer, this);
    }
    startRuntimeAction = new StartRuntimeAction(true, page.getControl().getShell());
    haltRuntimeAction = new StopRuntimeAction(page.getControl().getShell());
    openRuntimeInfoAction = new OpenRuntimeInfoAction();
    openRuntimePrefsAction = new OpenRuntimePrefsAction();
    serverListener = new RuntimeStatusChangeListener() {

        @Override
        public void stopRunning() {
            Display.getDefault().asyncExec(new Runnable() {

                @Override
                public void run() {
                    startRuntimeAction.setEnabled(true);
                    haltRuntimeAction.setEnabled(false);
                    openRuntimeInfoAction.setEnabled(false);
                }
            });
        }

        @Override
        public void startRunning() {
            Display.getDefault().asyncExec(new Runnable() {

                @Override
                public void run() {
                    startRuntimeAction.setEnabled(false);
                    haltRuntimeAction.setEnabled(true);
                    openRuntimeInfoAction.setEnabled(true);
                }
            });
        }

        @Override
        public void featureUninstalled(int id) {
        }

        @Override
        public void featureInstalled(int id) {
        }
    };
    RuntimeServerController.getInstance().addStatusChangeListener(serverListener);
    IActionBars actionBars = page.getSite().getActionBars();
    configureToolBar(actionBars.getToolBarManager());
}
Also used : AnsiConsoleStyleListener(org.talend.designer.esb.runcontainer.ui.console.ansi.AnsiConsoleStyleListener) StartRuntimeAction(org.talend.designer.esb.runcontainer.ui.actions.StartRuntimeAction) StyledText(org.eclipse.swt.custom.StyledText) RuntimeStatusChangeListener(org.talend.designer.esb.runcontainer.server.RuntimeStatusChangeListener) StopRuntimeAction(org.talend.designer.esb.runcontainer.ui.actions.StopRuntimeAction) OpenRuntimeInfoAction(org.talend.designer.esb.runcontainer.ui.actions.OpenRuntimeInfoAction) OpenRuntimePrefsAction(org.talend.designer.esb.runcontainer.ui.actions.OpenRuntimePrefsAction) IActionBars(org.eclipse.ui.IActionBars)

Example 53 with IActionBars

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

the class CpuDumpEditor method contributeToActionBars.

/**
     * Contributes to action bars.
     */
private void contributeToActionBars() {
    IActionBars actionBars = getEditorSite().getActionBars();
    actionBars.setGlobalActionHandler(JdtActionConstants.OPEN, new OpenDeclarationAction());
    actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), new FindAction());
    actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), new CopyAction());
}
Also used : OpenDeclarationAction(org.talend.designer.runtime.visualization.internal.actions.OpenDeclarationAction) FindAction(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.actions.FindAction) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) IActionBars(org.eclipse.ui.IActionBars)

Example 54 with IActionBars

use of org.eclipse.ui.IActionBars in project bndtools by bndtools.

the class JAREditorContributor method setActivePage.

/*
     * (non-JavaDoc) Method declared in AbstractMultiPageEditorActionBarContributor.
     */
@Override
public void setActivePage(IEditorPart part) {
    if (activeEditorPart == part)
        return;
    activeEditorPart = part;
    IActionBars actionBars = getActionBars();
    if (actionBars != null) {
        ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;
        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction(editor, ITextEditorActionConstants.DELETE));
        actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction(editor, ITextEditorActionConstants.UNDO));
        actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction(editor, ITextEditorActionConstants.REDO));
        actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction(editor, ITextEditorActionConstants.CUT));
        actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction(editor, ITextEditorActionConstants.COPY));
        actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction(editor, ITextEditorActionConstants.PASTE));
        actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction(editor, ITextEditorActionConstants.SELECT_ALL));
        actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), getAction(editor, ITextEditorActionConstants.FIND));
        actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(editor, IDEActionFactory.BOOKMARK.getId()));
        actionBars.updateActionBars();
    }
}
Also used : ITextEditor(org.eclipse.ui.texteditor.ITextEditor) IActionBars(org.eclipse.ui.IActionBars)

Example 55 with IActionBars

use of org.eclipse.ui.IActionBars in project eclipse.platform.text by eclipse.

the class AbstractTextEditor method registerUndoRedoAction.

/**
 * Registers the given undo/redo action under the given ID and ensures that previously installed
 * actions get disposed. It also takes care of re-registering the new action with the global
 * action handler.
 *
 * @param actionId the action id under which to register the action
 * @param action the action to register or <code>null</code> to dispose them
 * @since 3.1
 */
private void registerUndoRedoAction(String actionId, OperationHistoryActionHandler action) {
    IAction oldAction = getAction(actionId);
    if (oldAction instanceof OperationHistoryActionHandler)
        ((OperationHistoryActionHandler) oldAction).dispose();
    if (action == null)
        return;
    setAction(actionId, action);
    IActionBars actionBars = getEditorSite().getActionBars();
    if (actionBars != null)
        actionBars.setGlobalActionHandler(actionId, action);
}
Also used : OperationHistoryActionHandler(org.eclipse.ui.operations.OperationHistoryActionHandler) IAction(org.eclipse.jface.action.IAction) IActionBars(org.eclipse.ui.IActionBars)

Aggregations

IActionBars (org.eclipse.ui.IActionBars)65 IToolBarManager (org.eclipse.jface.action.IToolBarManager)21 Action (org.eclipse.jface.action.Action)19 IMenuManager (org.eclipse.jface.action.IMenuManager)8 RecordAction (com.cubrid.cubridmanager.ui.monitoring.editor.internal.RecordAction)6 IAction (org.eclipse.jface.action.IAction)6 Separator (org.eclipse.jface.action.Separator)6 TableLayout (org.eclipse.jface.viewers.TableLayout)3 GridLayout (org.eclipse.swt.layout.GridLayout)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 MenuManager (org.eclipse.jface.action.MenuManager)2 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 Menu (org.eclipse.swt.widgets.Menu)2 Tree (org.eclipse.swt.widgets.Tree)2 CopyAction (org.talend.designer.runtime.visualization.internal.actions.CopyAction)2 HttpClient (aQute.bnd.http.HttpClient)1