Search in sources :

Example 41 with IActionBars

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

the class MultiPageEditorContributor method dispose.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.part.EditorActionBarContributor#dispose()
     */
@Override
public void dispose() {
    super.dispose();
    IActionBars actionBars = getActionBars();
    if (actionBars != null) {
        actionBars.clearGlobalActionHandlers();
    }
    for (RetargetAction action : retargetActions) {
        getPage().removePartListener(action);
    }
    activeEditorPart = null;
    designActionKeys = null;
    retargetActions = null;
    registry = null;
}
Also used : ToggleSubjobsRetargetAction(org.talend.designer.core.ui.action.ToggleSubjobsRetargetAction) UndoRetargetAction(org.eclipse.gef.ui.actions.UndoRetargetAction) ZoomOutRetargetAction(org.eclipse.gef.ui.actions.ZoomOutRetargetAction) ZoomInRetargetAction(org.eclipse.gef.ui.actions.ZoomInRetargetAction) RetargetAction(org.eclipse.ui.actions.RetargetAction) RedoRetargetAction(org.eclipse.gef.ui.actions.RedoRetargetAction) DeleteRetargetAction(org.eclipse.gef.ui.actions.DeleteRetargetAction) IActionBars(org.eclipse.ui.IActionBars)

Example 42 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 43 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 44 with IActionBars

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

the class OverviewSection method createControls.

/*
     * @see AbstractJvmPropertySection#createControls(Composite)
     */
@Override
protected void createControls(final Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    composite.setLayout(layout);
    viewer = new PropertiesFilteredTree(composite, getActionBars()) {

        private ShowInTimelineAction showInTimelineAction;

        @Override
        protected List<Action> createActions(IActionBars actionBars) {
            List<Action> actions = new ArrayList<Action>();
            CopyAction copyAction = CopyAction.createCopyAction(actionBars);
            actions.add(copyAction);
            showInTimelineAction = new MyShowInTimelineAction(OverviewSection.this);
            actions.add(showInTimelineAction);
            return actions;
        }

        @Override
        public void menuAboutToshow() {
        // do nothing
        }
    }.getViewer();
    viewer.setContentProvider(new OverviewContentProvider(overviewProperties));
    viewer.setLabelProvider(new OverviewLabelProvider());
    ((Tree) viewer.getControl()).addFocusListener(new FocusAdapter() {

        @Override
        public void focusLost(FocusEvent e) {
            storeTreeExpansionState();
        }
    });
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.OVERVIEW_PAGE);
}
Also used : FocusAdapter(org.eclipse.swt.events.FocusAdapter) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) Action(org.eclipse.jface.action.Action) RefreshAction(org.talend.designer.runtime.visualization.internal.actions.RefreshAction) ShowInTimelineAction(org.talend.designer.runtime.visualization.internal.actions.ShowInTimelineAction) Composite(org.eclipse.swt.widgets.Composite) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) ArrayList(java.util.ArrayList) PropertiesFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesFilteredTree) FocusEvent(org.eclipse.swt.events.FocusEvent) GridLayout(org.eclipse.swt.layout.GridLayout) ShowInTimelineAction(org.talend.designer.runtime.visualization.internal.actions.ShowInTimelineAction) PropertiesFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesFilteredTree) Tree(org.eclipse.swt.widgets.Tree) IActionBars(org.eclipse.ui.IActionBars)

Example 45 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)

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