Search in sources :

Example 6 with IActionBars

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

the class AttributesTab method createViewer.

/**
     * Creates the viewer.
     * 
     * @param propertySheet The property sheet
     */
private void createViewer(PropertySheet propertySheet) {
    filteredTree = new PropertiesFilteredTree(this, propertySheet.getViewSite().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(section);
            actions.add(showInTimelineAction);
            return actions;
        }

        @Override
        public void menuAboutToshow() {
        // do nothing
        }
    };
    viewer = filteredTree.getViewer();
    filteredTree.setEditingSupport(new MyEditingSupport(viewer));
    contentProvider = new AttributeContentProvider();
    viewer.setContentProvider(contentProvider);
    viewer.setLabelProvider(new AttributeLabelProvider(viewer));
    viewer.setInput(new Object());
}
Also used : CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) Action(org.eclipse.jface.action.Action) ShowInTimelineAction(org.talend.designer.runtime.visualization.internal.actions.ShowInTimelineAction) CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) PropertiesFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.PropertiesFilteredTree) ShowInTimelineAction(org.talend.designer.runtime.visualization.internal.actions.ShowInTimelineAction) ArrayList(java.util.ArrayList) List(java.util.List) IActionBars(org.eclipse.ui.IActionBars)

Example 7 with IActionBars

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

the class MultiPageEditorContributor method setActivePage.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.part.MultiPageEditorActionBarContributor#setActivePage(org.eclipse.ui.IEditorPart)
     */
@Override
public void setActivePage(final IEditorPart activeEditor) {
    if ((activeEditorPart == activeEditor) || (activeEditor == null)) {
        return;
    }
    activeEditorPart = activeEditor;
    if (activeEditor instanceof TalendEditor) {
        RootEditPart editPart = ((TalendEditor) activeEditor).getViewer().getRootEditPart();
        if (editPart != null && editPart instanceof TalendScalableFreeformRootEditPart) {
            ZoomManager manager = ((TalendScalableFreeformRootEditPart) ((TalendEditor) activeEditor).getViewer().getRootEditPart()).getZoomManager();
            item.setZoomManager(manager);
        }
    } else {
        item.setZoomManager(null);
    }
    IActionBars actionBars = getActionBars();
    if (actionBars != null) {
        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction(activeEditor, ActionFactory.DELETE.getId()));
        actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction(activeEditor, ActionFactory.UNDO.getId()));
        actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction(activeEditor, ActionFactory.REDO.getId()));
        actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction(activeEditor, ActionFactory.CUT.getId()));
        actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction(activeEditor, ActionFactory.COPY.getId()));
        actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction(activeEditor, ActionFactory.PASTE.getId()));
        actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction(activeEditor, ActionFactory.SELECT_ALL.getId()));
        actionBars.setGlobalActionHandler(ToggleSubjobsAction.ID, getAction(activeEditor, ToggleSubjobsAction.ID));
        // see bug 0003656: Actions in the main menu "View" are always disabled.
        activateActionsInViewMenu(activeEditor, actionBars, VIEW_MENU_ACTIONS_ID);
        // MOD mzhao bug 8710
        if (showAndRunProcessAction != null) {
            actionBars.setGlobalActionHandler(showAndRunProcessAction.getActionDefinitionId(), showAndRunProcessAction);
        }
        actionBars.updateActionBars();
    }
}
Also used : TalendScalableFreeformRootEditPart(org.talend.designer.core.ui.editor.TalendScalableFreeformRootEditPart) ZoomManager(org.eclipse.gef.editparts.ZoomManager) TalendEditor(org.talend.designer.core.ui.editor.TalendEditor) AbstractTalendEditor(org.talend.designer.core.ui.editor.AbstractTalendEditor) IActionBars(org.eclipse.ui.IActionBars) TalendScalableFreeformRootEditPart(org.talend.designer.core.ui.editor.TalendScalableFreeformRootEditPart) RootEditPart(org.eclipse.gef.RootEditPart)

Example 8 with IActionBars

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

the class CpuSection method contributeToActionBars.

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

Example 9 with IActionBars

use of org.eclipse.ui.IActionBars in project cubrid-manager by CUBRID.

the class QueryEditorPart method hookRetragetActions.

protected void hookRetragetActions() {
    ActionManager actionManager = ActionManager.getInstance();
    IActionBars bar = this.getEditorSite().getActionBars();
    bar.setGlobalActionHandler(UndoAction.ID, actionManager.getAction(UndoAction.ID));
    bar.setGlobalActionHandler(RedoAction.ID, actionManager.getAction(RedoAction.ID));
    IAction action = actionManager.getAction(CutAction.ID);
    action.setEnabled(true);
    bar.setGlobalActionHandler(CutAction.ID, action);
    IAction copyAction = actionManager.getAction(CopyAction.ID);
    bar.setGlobalActionHandler(CopyAction.ID, copyAction);
    copyAction.setEnabled(true);
    IAction pasteAction = actionManager.getAction(PasteAction.ID);
    bar.setGlobalActionHandler(PasteAction.ID, pasteAction);
    pasteAction.setEnabled(true);
    bar.setGlobalActionHandler(FindReplaceAction.ID, actionManager.getAction(FindReplaceAction.ID));
    bar.setGlobalActionHandler(QueryOpenAction.ID, actionManager.getAction(QueryOpenAction.ID));
    bar.updateActionBars();
}
Also used : ActionManager(com.cubrid.common.ui.spi.action.ActionManager) IAction(org.eclipse.jface.action.IAction) IActionBars(org.eclipse.ui.IActionBars)

Example 10 with IActionBars

use of org.eclipse.ui.IActionBars in project cubrid-manager by CUBRID.

the class DatabaseDashboardViewPart method makeActions.

/**
	 * This method is to create actions at tool bar
	 *
	 */
private void makeActions() {
    Action settingAction = new Action() {

        public void run() {
            fireChartSetting();
        }
    };
    settingAction.setText(Messages.chartSettingTxt);
    settingAction.setToolTipText(Messages.chartSettingTxt);
    settingAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/setting-small.png"));
    final IActionBars bars = getViewSite().getActionBars();
    IToolBarManager manager = bars.getToolBarManager();
    manager.add(settingAction);
    RecordAction recordAction = new RecordAction();
    recordAction.setRecorder(this);
    recordAction.setPrepareTooltip(Messages.dbDashboardMonitorStartRecordTooltip);
    recordAction.setRecordTooltip(Messages.dbDashboardRecordingTooltip);
    recordAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/monitor/prepare_record.png"));
    recordAction.setToolTipText(Messages.dbDashboardMonitorStartRecordTooltip);
    manager.add(recordAction);
}
Also used : RecordAction(com.cubrid.cubridmanager.ui.monitoring.editor.internal.RecordAction) Action(org.eclipse.jface.action.Action) IToolBarManager(org.eclipse.jface.action.IToolBarManager) RecordAction(com.cubrid.cubridmanager.ui.monitoring.editor.internal.RecordAction) 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