Search in sources :

Example 11 with IViewSite

use of org.eclipse.ui.IViewSite in project org.csstudio.display.builder by kasemir.

the class PlaceHolderView method createPartControl.

@Override
public void createPartControl(final Composite parent) {
    final IViewSite site = getViewSite();
    parent.setLayout(new FillLayout());
    final Text text = new Text(parent, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
    text.setText("Placeholder for displays that should appear in this location.\n" + "Close after all displays have been arranged.");
    setPartName(site.getSecondaryId());
}
Also used : IViewSite(org.eclipse.ui.IViewSite) Text(org.eclipse.swt.widgets.Text) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 12 with IViewSite

use of org.eclipse.ui.IViewSite in project dsl-devkit by dsldevkit.

the class DynamicViewMenu method getMenu.

/**
 * Get the original menu which is used to find the menu item.
 */
private void getMenu() {
    final ToolBarManager toolBarManager = (ToolBarManager) ((IViewSite) reference.getPart(true).getSite()).getActionBars().getToolBarManager();
    PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {

        @Override
        public void run() {
            originalMenu = new Menu(toolBarManager.getControl());
        }
    });
}
Also used : IViewSite(org.eclipse.ui.IViewSite) UIThreadRunnable(org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable) SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) Menu(org.eclipse.swt.widgets.Menu) ToolBarManager(org.eclipse.jface.action.ToolBarManager)

Example 13 with IViewSite

use of org.eclipse.ui.IViewSite in project whole by wholeplatform.

the class DebugViewPart method createPartControl.

@Override
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    IViewSite viewSite = getViewSite();
    IActionBars actionBars = viewSite.getActionBars();
    IToolBarManager toolBarManager = actionBars.getToolBarManager();
    toolBarManager.add(getComponent().getBreakpoiontsDisableAction(getContext()));
    toolBarManager.add(getComponent().getResumeAction(getContext()));
    toolBarManager.add(getComponent().getTerminateAction(getContext()));
}
Also used : IViewSite(org.eclipse.ui.IViewSite) IToolBarManager(org.eclipse.jface.action.IToolBarManager) IActionBars(org.eclipse.ui.IActionBars)

Example 14 with IViewSite

use of org.eclipse.ui.IViewSite in project whole by wholeplatform.

the class ResultsViewPart method createPartControl.

@Override
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    IViewSite viewSite = getViewSite();
    IActionBars actionBars = viewSite.getActionBars();
    IToolBarManager toolBarManager = actionBars.getToolBarManager();
    toolBarManager.add(getComponent().getClearContentsAction());
}
Also used : IViewSite(org.eclipse.ui.IViewSite) IToolBarManager(org.eclipse.jface.action.IToolBarManager) IActionBars(org.eclipse.ui.IActionBars)

Example 15 with IViewSite

use of org.eclipse.ui.IViewSite in project egit by eclipse.

the class GitActionContributor method initialize.

@Override
public void initialize(ISynchronizePageConfiguration configuration) {
    super.initialize(configuration);
    ExpandAllModelAction expandAllAction = new ExpandAllModelAction(GitActionContributor_ExpandAll, configuration);
    expandAllAction.setImageDescriptor(EXPAND_ALL);
    appendToGroup(P_TOOLBAR_MENU, NAVIGATE_GROUP, expandAllAction);
    PullAction pullAction = new PullAction(UIText.GitActionContributor_Pull, configuration);
    pullAction.setImageDescriptor(PULL);
    appendToGroup(P_TOOLBAR_MENU, SYNCHRONIZE_GROUP, pullAction);
    PushAction pushAction = new PushAction(UIText.GitActionContributor_Push, configuration);
    pushAction.setImageDescriptor(PUSH);
    appendToGroup(P_TOOLBAR_MENU, SYNCHRONIZE_GROUP, pushAction);
    ISynchronizePageSite site = configuration.getSite();
    IWorkbenchSite ws = site.getWorkbenchSite();
    openWorkingFileAction = new OpenWorkingFileAction(ws.getWorkbenchWindow().getActivePage());
    site.getSelectionProvider().addSelectionChangedListener(openWorkingFileAction);
    if (ws instanceof IViewSite) {
        Object oldAction = configuration.getProperty(P_OPEN_ACTION);
        if (!(oldAction instanceof Action))
            return;
        final GitOpenInCompareAction openInCompareAction = new GitOpenInCompareAction(configuration, (Action) oldAction);
        configuration.setProperty(P_OPEN_ACTION, openInCompareAction);
    }
}
Also used : IWorkbenchSite(org.eclipse.ui.IWorkbenchSite) IViewSite(org.eclipse.ui.IViewSite) ExpandAllModelAction(org.eclipse.egit.ui.internal.synchronize.action.ExpandAllModelAction) GitOpenInCompareAction(org.eclipse.egit.ui.internal.synchronize.action.GitOpenInCompareAction) OpenWorkingFileAction(org.eclipse.egit.ui.internal.synchronize.action.OpenWorkingFileAction) PushAction(org.eclipse.egit.ui.internal.synchronize.action.PushAction) PullAction(org.eclipse.egit.ui.internal.synchronize.action.PullAction) Action(org.eclipse.jface.action.Action) PullAction(org.eclipse.egit.ui.internal.synchronize.action.PullAction) ISynchronizePageSite(org.eclipse.team.ui.synchronize.ISynchronizePageSite) OpenWorkingFileAction(org.eclipse.egit.ui.internal.synchronize.action.OpenWorkingFileAction) ExpandAllModelAction(org.eclipse.egit.ui.internal.synchronize.action.ExpandAllModelAction) GitModelObject(org.eclipse.egit.ui.internal.synchronize.model.GitModelObject) GitOpenInCompareAction(org.eclipse.egit.ui.internal.synchronize.action.GitOpenInCompareAction) PushAction(org.eclipse.egit.ui.internal.synchronize.action.PushAction)

Aggregations

IViewSite (org.eclipse.ui.IViewSite)15 FillLayout (org.eclipse.swt.layout.FillLayout)3 IActionBars (org.eclipse.ui.IActionBars)3 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 IStatusLineManager (org.eclipse.jface.action.IStatusLineManager)2 IToolBarManager (org.eclipse.jface.action.IToolBarManager)2 CheckStateChangedEvent (org.eclipse.jface.viewers.CheckStateChangedEvent)2 ICheckStateListener (org.eclipse.jface.viewers.ICheckStateListener)2 ITreeViewerListener (org.eclipse.jface.viewers.ITreeViewerListener)2 TreeExpansionEvent (org.eclipse.jface.viewers.TreeExpansionEvent)2 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 GridData (org.eclipse.swt.layout.GridData)2 Group (org.eclipse.swt.widgets.Group)2 TreeItem (org.eclipse.swt.widgets.TreeItem)2 WorkbenchLabelProvider (org.eclipse.ui.model.WorkbenchLabelProvider)2 ProjectRepositoryNode (org.talend.core.repository.model.ProjectRepositoryNode)2 RepositoryLabelProvider (org.talend.core.repository.ui.view.RepositoryLabelProvider)2 IRepositoryNode (org.talend.repository.model.IRepositoryNode)2