/** * Initializes this action delegate with the workbench window it will work in. * * @param window the window that provides the context for this delegate */ public void init(IWorkbenchWindow window) { workbench = window.getWorkbench(); }
/** * @see AbstractOpenWizardAction#init */ public void init(IWorkbenchWindow window) { setWorkbench(window.getWorkbench()); }
/** * Get the progress service for the workbnech, * * @return IProgressService */ private IProgressService getWorkbenchProgressService() { return site.getWorkbenchWindow().getWorkbench().getProgressService(); }
private ParameterizedCommand getParametrizedCommand(String workbenchCommand) { final ICommandService commandService = window.getWorkbench().getService(ICommandService.class); final Command command = commandService.getCommand(workbenchCommand); ParameterizedCommand parameterizedCommand = new ParameterizedCommand(command, null); return parameterizedCommand; }
@Override protected ParameterizedCommand getForwardCommand() { final ICommandService commandService = window.getWorkbench().getService(ICommandService.class); final Command command = commandService.getCommand(ORG_ECLIPSE_UI_WINDOW_OPEN_EDITOR_DROP_DOWN); ParameterizedCommand commandF = new ParameterizedCommand(command, null); return commandF; }
protected ISharedImages getSharedImages() { if (fSharedImages == null) fSharedImages = getPage().getWorkbenchWindow().getWorkbench().getSharedImages(); return fSharedImages; } }
final protected TriggerSequence[] getInvokingCommandKeySequences() { if (invokingCommandKeySequences == null) { if (invokingCommand != null) { IBindingService bindingService = Adapters.adapt(window.getWorkbench(), IBindingService.class); invokingCommandKeySequences = bindingService.getActiveBindingsFor(invokingCommand.getId()); } } return invokingCommandKeySequences; }
@Override public void run() { if (workbenchWindow == null) { // action has been disposed return; } //This may take a while, so use the busy indicator BusyIndicator.showWhile(null, () -> workbenchWindow.getWorkbench().getHelpSystem().displaySearch()); }
@Override protected ParameterizedCommand getForwardCommand() { final ICommandService commandService = window.getWorkbench().getService(ICommandService.class); final Command command = commandService.getCommand(IWorkbenchCommandConstants.WINDOW_NEXT_PERSPECTIVE); ParameterizedCommand commandF = new ParameterizedCommand(command, null); return commandF; }
@Override public void run() { if (workbenchWindow == null) { // action has been disposed return; } //This may take a while, so use the busy indicator BusyIndicator.showWhile(null, () -> workbenchWindow.getWorkbench().getHelpSystem().displayHelp()); }
@Override public IExtensionTracker getExtensionTracker() { if (tracker == null) { tracker = new UIExtensionTracker(getWorkbenchWindow().getWorkbench().getDisplay()); } return tracker; }
@Override protected ParameterizedCommand getForwardCommand() { final ICommandService commandService = window.getWorkbench().getService(ICommandService.class); final Command command = commandService.getCommand(IWorkbenchCommandConstants.WINDOW_NEXT_EDITOR); ParameterizedCommand commandF = new ParameterizedCommand(command, null); return commandF; }
@Override public void run(IIntroSite site, Properties params) { IIntroManager introManager = site.getWorkbenchWindow().getWorkbench().getIntroManager(); IIntroPart introPart = introManager.getIntro(); if (introPart != null) { introManager.closeIntro(introPart); } openWizard(site.getShell(), site.getWorkbenchWindow().getWorkbench(), null, "ccw.project.new.wizard"); }
@Override protected CommonViewer createCommonViewer(Composite aParent) { CommonViewer viewer = super.createCommonViewer(aParent); IThemeManager themeManager = getSite().getWorkbenchWindow().getWorkbench().getThemeManager(); new GradientDrawer(themeManager, viewer) { @Override protected boolean shouldApplyGradient(org.eclipse.swt.widgets.Event event) { return event.item.getData() instanceof RepositoryCategory; } }; return viewer; }
private String getEditorId(IFileStore fileStore) { IWorkbench workbench= fWindow.getWorkbench(); IEditorRegistry editorRegistry= workbench.getEditorRegistry(); IEditorDescriptor descriptor= editorRegistry.getDefaultEditor(fileStore.getName()); if (descriptor != null) return descriptor.getId(); return EditorsUI.DEFAULT_TEXT_EDITOR_ID; }
@Override public void dispose() { getWindow().getWorkbench().getWorkingSetManager() .removePropertyChangeListener(listener); super.dispose(); contextMenuCreator.dispose(); }
private ActionDelegateHelper() { fCurrentWindow= JDIDebugUIPlugin.getActiveWorkbenchWindow(); if (fCurrentWindow != null) { fCurrentWindow.getWorkbench().addWindowListener(this); fCurrentWindow.getPartService().addPartListener(this); IWorkbenchPage page= fCurrentWindow.getActivePage(); if (page != null) { IEditorPart part= page.getActiveEditor(); checkToSetTextEditor(part); } } }
/** * The <code>PropertySheet</code> implementation of this <code>IWorkbenchPart</code> * method creates a <code>PageBook</code> control with its default page showing. */ public void createPartControl(Composite parent) { super.createPartControl(parent); getSite().getPage().getWorkbenchWindow().getWorkbench().getHelpSystem() .setHelp(getPageBook(), IPropertiesHelpContextIds.PROPERTY_SHEET_VIEW); }
private void handleNewFragment() { NewFragmentProjectWizard wizard = new NewFragmentProjectWizard(); wizard.init(PDEPlugin.getActiveWorkbenchWindow().getWorkbench(), null); WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); dialog.create(); SWTUtil.setDialogSize(dialog, 400, 500); if (dialog.open() == Window.OK) { addPlugin(wizard.getFragmentId(), wizard.getFragmentVersion()); } }
private void handleNewPlugin() { NewPluginProjectWizard wizard = new NewPluginProjectWizard(); wizard.init(PDEPlugin.getActiveWorkbenchWindow().getWorkbench(), null); WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); dialog.create(); SWTUtil.setDialogSize(dialog, 400, 500); if (dialog.open() == Window.OK) { addPlugin(wizard.getPluginId(), wizard.getPluginVersion()); } }