Search in sources :

Example 46 with IActionBars

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

the class XMLEditor method hookRetargetActions.

/**
	 * Add format action.
	 */
protected void hookRetargetActions() {
    super.hookRetargetActions();
    IActionBars bar = this.getEditorSite().getActionBars();
    bar.setGlobalActionHandler(ActionConstants.ACTION_FORMAT, actions.get(ActionConstants.ACTION_FORMAT));
    bar.updateActionBars();
}
Also used : IActionBars(org.eclipse.ui.IActionBars)

Example 47 with IActionBars

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

the class XMLEditor method unHookRetargetActions.

/**
	 * 
	 * Unhook retartet actions
	 * 
	 */
protected void unHookRetargetActions() {
    super.unHookRetargetActions();
    IActionBars bar = this.getEditorSite().getActionBars();
    bar.setGlobalActionHandler(ActionConstants.ACTION_FORMAT, null);
    bar.updateActionBars();
}
Also used : IActionBars(org.eclipse.ui.IActionBars)

Example 48 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 49 with IActionBars

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

the class ProblemsView method createPartControl.

@Override
public void createPartControl(Composite parent) {
    this.parent = parent;
    CorePlugin.getDefault().getRepositoryService().getProxyRepositoryFactory().addPropertyChangeListener(this);
    parent.setLayout(new FillLayout());
    viewer = new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
    final Tree tree = viewer.getTree();
    tree.setHeaderVisible(true);
    tree.setLinesVisible(true);
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            Problem problem = (Problem) selection.getFirstElement();
            if (problem != null && problem.isConcrete()) {
                if (problem.getNodeName() != null) {
                    selectInDesigner(problem.getJobInfo(), problem.getNodeName());
                } else if (problem instanceof TalendProblem) {
                    selectInRoutine((TalendProblem) problem);
                }
            }
        }
    });
    TreeColumn column1 = new TreeColumn(tree, SWT.CENTER);
    //$NON-NLS-1$
    column1.setText(Messages.getString("ProblemsView.description"));
    column1.setWidth(400);
    column1.setAlignment(SWT.LEFT);
    column1.setResizable(true);
    TreeColumn column2 = new TreeColumn(tree, SWT.LEFT);
    //$NON-NLS-1$
    column2.setText(Messages.getString("ProblemsView.resource"));
    column2.setWidth(400);
    column2.setResizable(true);
    ProblemViewProvider provider = new ProblemViewProvider();
    viewer.setLabelProvider(provider);
    viewer.setContentProvider(provider);
    resetContent();
    IActionBars actionBars = getViewSite().getActionBars();
    initMenu(actionBars.getMenuManager());
}
Also used : TreeViewer(org.eclipse.jface.viewers.TreeViewer) TalendProblem(org.talend.core.model.process.TalendProblem) TreeColumn(org.eclipse.swt.widgets.TreeColumn) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) Tree(org.eclipse.swt.widgets.Tree) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) Problem(org.talend.core.model.process.Problem) TalendProblem(org.talend.core.model.process.TalendProblem) FillLayout(org.eclipse.swt.layout.FillLayout) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IActionBars(org.eclipse.ui.IActionBars)

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

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