@Override public void initialize(final ISynchronizePageConfiguration configuration) { super.initialize(configuration); site = configuration.getSite(); final IWorkbenchSite ws = site.getWorkbenchSite(); if (ws instanceof IViewSite) { this.configuration = configuration; final Shell shell = site.getShell(); customCompareAction = new ExternalCompareAction(shell); undoAction = new UndoPendingChangeAction(shell); getLatestAction = new GetLatestAction(shell); getSpecificAction = new GetSpecificAction(shell); checkoutAction = new CheckoutAction(shell); undoAction = new UndoPendingChangeAction(shell); checkinAction = new CheckinAction(shell); historyAction = new ViewHistoryAction(shell); } else { this.configuration = null; } }
public Object execute(ExecutionEvent event) throws ExecutionException { final IWorkbenchSite site = HandlerUtil.getActiveSite(event); final ICommandService cs = (ICommandService) site .getService(ICommandService.class); final IHandlerService hs = (IHandlerService) site .getService(IHandlerService.class); final Command command = cs .getCommand(IWorkbenchCommandConstants.FILE_IMPORT); try { hs.executeCommand(ParameterizedCommand.generateCommand(command, Collections.singletonMap( IWorkbenchCommandConstants.FILE_IMPORT_PARM_WIZARDID, SessionImportWizard.ID)), null); } catch (CommandException e) { EclEmmaUIPlugin.log(e); } return null; }
public Object execute(ExecutionEvent event) throws ExecutionException { final IWorkbenchSite site = HandlerUtil.getActiveSite(event); final ICommandService cs = (ICommandService) site .getService(ICommandService.class); final IHandlerService hs = (IHandlerService) site .getService(IHandlerService.class); final Command command = cs .getCommand(IWorkbenchCommandConstants.FILE_EXPORT); try { hs.executeCommand(ParameterizedCommand.generateCommand(command, Collections.singletonMap( IWorkbenchCommandConstants.FILE_EXPORT_PARM_WIZARDID, SessionExportWizard.ID)), null); } catch (CommandException e) { EclEmmaUIPlugin.log(e); } return null; }
/** * Returns an OSGi service from {@link ExecutionEvent}. It looks up a service in the following * locations (if exist) in the given order: * * {@code HandlerUtil.getActiveSite(event)} * {@code HandlerUtil.getActiveEditor(event).getEditorSite()} * {@code HandlerUtil.getActiveEditor(event).getSite()} * {@code HandlerUtil.getActiveWorkbenchWindow(event)} * {@code PlatformUI.getWorkbench()} */ public static <T> T getService(ExecutionEvent event, Class<T> api) { IWorkbenchSite activeSite = HandlerUtil.getActiveSite(event); if (activeSite != null) { return activeSite.getService(api); } IEditorPart activeEditor = HandlerUtil.getActiveEditor(event); if (activeEditor != null) { IEditorSite editorSite = activeEditor.getEditorSite(); if (editorSite != null) { return editorSite.getService(api); } IWorkbenchPartSite site = activeEditor.getSite(); if (site != null) { return site.getService(api); } } IWorkbenchWindow workbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event); if (workbenchWindow != null) { return workbenchWindow.getService(api); } return PlatformUI.getWorkbench().getService(api); }
/** * Execute the operation in the undo context, in a job. * * If the operation is an IDisplayOperation, and both the widget and site are provided, * then the job will be created as a DisplayOperationJob. * * If the operation can not be executed, it will be disposed. * * @param operation * @param undoContext * @param widget * @param site */ public static void execute(final IUndoableOperation operation, IUndoContext undoContext, final Widget widget, final IWorkbenchSite site) { IOperationHistory history = OperationHistoryFactory.getOperationHistory(); IAdaptable adaptable = null; if ((operation instanceof IDisplayOperation) && (widget != null) && (site != null)) { IDisplayOperation displayOperation = (IDisplayOperation) operation; adaptable = new IDisplayOperation.Adaptable(displayOperation, widget, site); } if (undoContext != null) { operation.addContext(undoContext); } try { history.execute(operation, null, adaptable); } catch (ExecutionException e) { // should never occur LogUtil.error(e); } }
/** * Creates a new <code>ImplementorsSearchGroup</code>. The group requires * that the selection provided by the given selection provider is of type * {@link IStructuredSelection}. * * @param site the site that will own the action group. * @param specialSelectionProvider the selection provider used instead of the * sites selection provider. * * @since 3.4 */ public ImplementorsSearchGroup(IWorkbenchSite site, ISelectionProvider specialSelectionProvider) { fSite= site; fGroupId= IContextMenuConstants.GROUP_SEARCH; fFindImplementorsAction= new FindImplementorsAction(site); fFindImplementorsAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_IMPLEMENTORS_IN_WORKSPACE); fFindImplementorsInProjectAction= new FindImplementorsInProjectAction(site); fFindImplementorsInProjectAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_IMPLEMENTORS_IN_PROJECT); fFindImplementorsInWorkingSetAction= new FindImplementorsInWorkingSetAction(site); fFindImplementorsInWorkingSetAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_IMPLEMENTORS_IN_WORKING_SET); // register the actions as selection listeners ISelectionProvider provider= specialSelectionProvider == null ? fSite.getSelectionProvider() : specialSelectionProvider; ISelection selection= provider.getSelection(); registerAction(fFindImplementorsAction, provider, selection, specialSelectionProvider); registerAction(fFindImplementorsInProjectAction, provider, selection, specialSelectionProvider); registerAction(fFindImplementorsInWorkingSetAction, provider, selection, specialSelectionProvider); }
/** * Creates a new <code>WriteReferencesSearchGroup</code>. The group requires * that the selection provided by the given selection provider is of type * {@link IStructuredSelection}. * * @param site the site that will own the action group. * @param specialSelectionProvider the selection provider used instead of the * sites selection provider. * * @since 3.4 */ public WriteReferencesSearchGroup(IWorkbenchSite site, ISelectionProvider specialSelectionProvider) { fSite= site; fGroupId= IContextMenuConstants.GROUP_SEARCH; fFindWriteReferencesAction= new FindWriteReferencesAction(site); fFindWriteReferencesAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_WRITE_ACCESS_IN_WORKSPACE); fFindWriteReferencesInProjectAction= new FindWriteReferencesInProjectAction(site); fFindWriteReferencesInProjectAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_WRITE_ACCESS_IN_PROJECT); fFindWriteReferencesInHierarchyAction= new FindWriteReferencesInHierarchyAction(site); fFindWriteReferencesInHierarchyAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_WRITE_ACCESS_IN_HIERARCHY); fFindWriteReferencesInWorkingSetAction= new FindWriteReferencesInWorkingSetAction(site); fFindWriteReferencesInWorkingSetAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_WRITE_ACCESS_IN_WORKING_SET); // register the actions as selection listeners ISelectionProvider provider= specialSelectionProvider == null ? fSite.getSelectionProvider() : specialSelectionProvider; ISelection selection= provider.getSelection(); registerAction(fFindWriteReferencesAction, provider, selection, specialSelectionProvider); registerAction(fFindWriteReferencesInProjectAction, provider, selection, specialSelectionProvider); registerAction(fFindWriteReferencesInHierarchyAction, provider, selection, specialSelectionProvider); registerAction(fFindWriteReferencesInWorkingSetAction, provider, selection, specialSelectionProvider); }
/** * Creates a new <code>DeclarationsSearchGroup</code>. The group requires * that the selection provided by the given selection provider is of type * {@link IStructuredSelection}. * * @param site the site that will own the action group. * @param specialSelectionProvider the selection provider used instead of the * sites selection provider. * * @since 3.4 */ public DeclarationsSearchGroup(IWorkbenchSite site, ISelectionProvider specialSelectionProvider) { fSite= site; fGroupId= IContextMenuConstants.GROUP_SEARCH; fFindDeclarationsAction= new FindDeclarationsAction(site); fFindDeclarationsAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_WORKSPACE); fFindDeclarationsInProjectAction= new FindDeclarationsInProjectAction(site); fFindDeclarationsInProjectAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_PROJECTS); fFindDeclarationsInHierarchyAction= new FindDeclarationsInHierarchyAction(site); fFindDeclarationsInHierarchyAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_HIERARCHY); fFindDeclarationsInWorkingSetAction= new FindDeclarationsInWorkingSetAction(site); fFindDeclarationsInWorkingSetAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_DECLARATIONS_IN_WORKING_SET); // register the actions as selection listeners ISelectionProvider provider= specialSelectionProvider == null ? fSite.getSelectionProvider() : specialSelectionProvider; ISelection selection= provider.getSelection(); registerAction(fFindDeclarationsAction, provider, selection, specialSelectionProvider); registerAction(fFindDeclarationsInProjectAction, provider, selection, specialSelectionProvider); registerAction(fFindDeclarationsInHierarchyAction, provider, selection, specialSelectionProvider); registerAction(fFindDeclarationsInWorkingSetAction, provider, selection, specialSelectionProvider); }
/** * Creates a new <code>ReadReferencesSearchGroup</code>. The group requires * that the selection provided by the given selection provider is of type * {@link IStructuredSelection}. * * @param site the site that will own the action group. * @param specialSelectionProvider the selection provider used instead of the * sites selection provider. * * @since 3.4 */ public ReadReferencesSearchGroup(IWorkbenchSite site, ISelectionProvider specialSelectionProvider) { fSite= site; fGroupId= IContextMenuConstants.GROUP_SEARCH; fFindReadReferencesAction= new FindReadReferencesAction(site); fFindReadReferencesAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_WRITE_ACCESS_IN_WORKSPACE); fFindReadReferencesInProjectAction= new FindReadReferencesInProjectAction(site); fFindReadReferencesInProjectAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_READ_ACCESS_IN_PROJECT); fFindReadReferencesInHierarchyAction= new FindReadReferencesInHierarchyAction(site); fFindReadReferencesInHierarchyAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_WRITE_ACCESS_IN_HIERARCHY); fFindReadReferencesInWorkingSetAction= new FindReadReferencesInWorkingSetAction(site); fFindReadReferencesInWorkingSetAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_WRITE_ACCESS_IN_WORKING_SET); // register the actions as selection listeners ISelectionProvider provider= specialSelectionProvider == null ? fSite.getSelectionProvider() : specialSelectionProvider; ISelection selection= provider.getSelection(); registerAction(fFindReadReferencesAction, provider, selection, specialSelectionProvider); registerAction(fFindReadReferencesInProjectAction, provider, selection, specialSelectionProvider); registerAction(fFindReadReferencesInHierarchyAction, provider, selection, specialSelectionProvider); registerAction(fFindReadReferencesInWorkingSetAction, provider, selection, specialSelectionProvider); }
private BuildActionGroup(IWorkbenchSite site, ISelectionProvider specialSelectionProvider, RefreshAction refreshAction) { fSelectionProvider= specialSelectionProvider != null ? specialSelectionProvider : site.getSelectionProvider(); fBuildAction= new BuildAction(new ShellProviderAdapter(site.getShell()), IncrementalProjectBuilder.INCREMENTAL_BUILD); fBuildAction.setText(ActionMessages.BuildAction_label); fBuildAction.setActionDefinitionId(IWorkbenchCommandConstants.PROJECT_BUILD_PROJECT); fRefreshAction= refreshAction; fRefreshAction.setActionDefinitionId(IWorkbenchCommandConstants.FILE_REFRESH); if (specialSelectionProvider != null) { fRefreshAction.setSpecialSelectionProvider(specialSelectionProvider); } fSelectionProvider.addSelectionChangedListener(fBuildAction); fSelectionProvider.addSelectionChangedListener(fRefreshAction); }
public static void schedule(Job job, IWorkbenchSite site) { if (site != null) { IWorkbenchSiteProgressService siteProgress = (IWorkbenchSiteProgressService) site.getAdapter(IWorkbenchSiteProgressService.class); if (siteProgress != null) { siteProgress.schedule(job, 0, true /* use half-busy cursor */); return; } } job.schedule(); }
private void createSiteActions(IWorkbenchSite site, ISelectionProvider specialProvider) { ISelectionProvider provider = specialProvider != null ? specialProvider : site.getSelectionProvider(); fOpenPropertiesDialog = new PropertyDialogAction(site, provider); fOpenPropertiesDialog.setActionDefinitionId(IWorkbenchCommandConstants.FILE_PROPERTIES); initialize(provider); }
private TypeScriptSearchActionGroup(IWorkbenchSite site) { fReferencesGroup= new ReferencesSearchGroup(site); // fReadAccessGroup= new ReadReferencesSearchGroup(site); // fWriteAccessGroup= new WriteReferencesSearchGroup(site); // fDeclarationsGroup= new DeclarationsSearchGroup(site); //// fImplementorsGroup= new ImplementorsSearchGroup(site); // fOccurrencesGroup= new OccurrencesSearchGroup(site); }
/** * Creates a new <code>RenameAction</code>. The action requires * that the selection provided by the site's selection provider is of type <code> * org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public RenameAction(IWorkbenchSite site) { super(site); setText(RefactoringMessages.RenameAction_text); fRenameJavaElement= new RenameTypeScriptElementAction(site); fRenameJavaElement.setText(getText()); // fRenameResource= new RenameResourceAction(site); // fRenameResource.setText(getText()); // PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.RENAME_ACTION); }
/** * Creates a new <code>ReferencesSearchGroup</code>. The group requires that * the selection provided by the site's selection provider is of type <code> * org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site * the view part that owns this action group */ public ReferencesSearchGroup(IWorkbenchSite site) { fSite = site; fGroupId = IContextMenuConstants.GROUP_SEARCH; // fFindReferencesAction= new FindReferencesAction(site); // fFindReferencesAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_REFERENCES_IN_WORKSPACE); fFindReferencesInProjectAction = new FindReferencesInProjectAction(site); fFindReferencesInProjectAction .setActionDefinitionId(ITypeScriptEditorActionDefinitionIds.SEARCH_REFERENCES_IN_PROJECT); // fFindReferencesInHierarchyAction= new // FindReferencesInHierarchyAction(site); // fFindReferencesInHierarchyAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_REFERENCES_IN_HIERARCHY); // fFindReferencesInWorkingSetAction= new // FindReferencesInWorkingSetAction(site); // fFindReferencesInWorkingSetAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_REFERENCES_IN_WORKING_SET); // register the actions as selection listeners ISelectionProvider provider = fSite.getSelectionProvider(); ISelection selection = provider.getSelection(); // registerAction(fFindReferencesAction, provider, selection); registerAction(fFindReferencesInProjectAction, provider, selection); // registerAction(fFindReferencesInHierarchyAction, provider, // selection); // registerAction(fFindReferencesInWorkingSetAction, provider, // selection); }
/** * Creates a new <code>OpenAction</code>. The action requires that the * selection provided by the site's selection provider is of type <code> * org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site * the site providing context information for this action */ public OpenAction(IWorkbenchSite site) { super(site); setText(ActionMessages.OpenAction_label); setToolTipText(ActionMessages.OpenAction_tooltip); setDescription(ActionMessages.OpenAction_description); // PlatformUI.getWorkbench().getHelpSystem().setHelp(this, // IJavaHelpContextIds.OPEN_ACTION); }
@Override public void setEnabled(Object evaluationContext) { Object activeSite = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_SITE_NAME); Object activeEditor = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_EDITOR_NAME); if (activeSite instanceof IWorkbenchSite && activeEditor instanceof AbstractThemeableEditor) { ICommandService commandService = (ICommandService) ((IWorkbenchSite) activeSite) .getService(ICommandService.class); Command command = commandService.getCommand(COMMAND_ID); State state = command.getState(RegistryToggleState.STATE_ID); state.setValue(((AbstractThemeableEditor) activeEditor).getWordWrapEnabled()); } }
@Override public void displayExecute(Widget widget, IWorkbenchSite site) { SELECTION_MODE oldMode = planTimeline.getSelectionMode(); try { planTimeline.setSelectionMode(SELECTION_MODE.NONE); super.displayExecute(widget, site); } finally { planTimeline.setSelectionMode(oldMode); } }
@Override public Object getAdapter(Class adapter) { if (adapter == Widget.class) { return widget; } if (adapter == IWorkbenchSite.class) { return site; } return super.getAdapter(adapter); }
/** * Creates a new <code>AddJavaDocStubAction</code>. The action requires * that the selection provided by the site's selection provider is of type <code> * org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public AddJavaDocStubAction(IWorkbenchSite site) { super(site); setText(ActionMessages.AddJavaDocStubAction_label); setDescription(ActionMessages.AddJavaDocStubAction_description); setToolTipText(ActionMessages.AddJavaDocStubAction_tooltip); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.ADD_JAVADOC_STUB_ACTION); }
/** * Creates a new <code>OccurrencesSearchGroup</code>. The group requires * that the selection provided by the given selection provider is of type * {@link IStructuredSelection}. * * @param site the site that will own the action group. * @param specialSelectionProvider the selection provider used instead of the * sites selection provider. * * @since 3.4 */ public OccurrencesSearchGroup(IWorkbenchSite site, ISelectionProvider specialSelectionProvider) { fSite= site; fGroupId= IContextMenuConstants.GROUP_SEARCH; fOccurrencesInFileAction= new FindOccurrencesInFileAction(site); fOccurrencesInFileAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_OCCURRENCES_IN_FILE); // Need to reset the label fOccurrencesInFileAction.setText(SearchMessages.Search_FindOccurrencesInFile_shortLabel); fExceptionOccurrencesAction= new FindExceptionOccurrencesAction(site); fExceptionOccurrencesAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_EXCEPTION_OCCURRENCES_IN_FILE); fFindImplementorOccurrencesAction= new FindImplementOccurrencesAction(site); fFindImplementorOccurrencesAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_IMPLEMENT_OCCURRENCES_IN_FILE); fBreakContinueTargetOccurrencesAction= new FindBreakContinueTargetOccurrencesAction(site); fBreakContinueTargetOccurrencesAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_BREAK_CONTINUE_TARGET_OCCURRENCES); fMethodExitOccurrencesAction= new FindMethodExitOccurrencesAction(site); fMethodExitOccurrencesAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SEARCH_METHOD_EXIT_OCCURRENCES); // register the actions as selection listeners ISelectionProvider provider= specialSelectionProvider == null ? fSite.getSelectionProvider() : specialSelectionProvider; ISelection selection= provider.getSelection(); registerAction(fOccurrencesInFileAction, provider, selection, specialSelectionProvider); registerAction(fExceptionOccurrencesAction, provider, selection, specialSelectionProvider); registerAction(fFindImplementorOccurrencesAction, provider, selection, specialSelectionProvider); registerAction(fBreakContinueTargetOccurrencesAction, provider, selection, specialSelectionProvider); registerAction(fMethodExitOccurrencesAction, provider, selection, specialSelectionProvider); }
private AddFolderToBuildpathAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) { super(site, selectionTarget, BuildpathModifierAction.ADD_SEL_SF_TO_BP); fContext= context; setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddSelSFToCP_label); setImageDescriptor(JavaPluginImages.DESC_ELCL_ADD_AS_SOURCE_FOLDER); setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddSelSFToCP_tooltip); }
/** * Creates a new <code>MoveAction</code>. The action requires * that the selection provided by the site's selection provider is of type <code> * org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public MoveAction(IWorkbenchSite site) { super(site); setText(RefactoringMessages.MoveAction_text); fMoveStaticMembersAction= new MoveStaticMembersAction(site); fMoveInstanceMethodAction= new MoveInstanceMethodAction(site); fReorgMoveAction= new ReorgMoveAction(site); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.MOVE_ACTION); }
/** * Creates a new <code>ProjectActionGroup</code>. The group requires * that the selection provided by the given selection provider is of type * {@link IStructuredSelection}. * * @param site the site that will own the action group. * @param selectionProvider the selection provider used instead of the * page selection provider. * * @since 3.4 */ public ProjectActionGroup(IWorkbenchSite site, ISelectionProvider selectionProvider) { fSelectionProvider= selectionProvider; ISelection selection= selectionProvider.getSelection(); fCloseAction= new CloseResourceAction(site); fCloseAction.setActionDefinitionId(IWorkbenchCommandConstants.PROJECT_CLOSE_PROJECT); fCloseUnrelatedAction= new CloseUnrelatedProjectsAction(site); fCloseUnrelatedAction.setActionDefinitionId(IWorkbenchCommandConstants.PROJECT_CLOSE_UNRELATED_PROJECTS); fOpenAction= new OpenProjectAction(site); fOpenAction.setActionDefinitionId(IWorkbenchCommandConstants.PROJECT_OPEN_PROJECT); if (selection instanceof IStructuredSelection) { IStructuredSelection s= (IStructuredSelection)selection; fOpenAction.selectionChanged(s); fCloseAction.selectionChanged(s); fCloseUnrelatedAction.selectionChanged(s); } fSelectionChangedListener= new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { ISelection s= event.getSelection(); if (s instanceof IStructuredSelection) { performSelectionChanged((IStructuredSelection) s); } } }; selectionProvider.addSelectionChangedListener(fSelectionChangedListener); IWorkspace workspace= ResourcesPlugin.getWorkspace(); workspace.addResourceChangeListener(fOpenAction); workspace.addResourceChangeListener(fCloseAction); workspace.addResourceChangeListener(fCloseUnrelatedAction); }
public ResetAllOutputFoldersAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context, IJavaProject javaProject) { super(site, selectionTarget, BuildpathModifierAction.RESET_ALL_OUTPUT_FOLDERS); fContext= context; fJavaProject= javaProject; setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Reset_tooltip); setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Reset_tooltip); }
public CopyToClipboardAction(IWorkbenchSite site, Clipboard clipboard) { super(site); setText(ReorgMessages.CopyToClipboardAction_text); setDescription(ReorgMessages.CopyToClipboardAction_description); fClipboard= clipboard; ISharedImages workbenchImages= getWorkbenchSharedImages(); setDisabledImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED)); setImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY)); setHoverImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY)); update(getSelection()); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.COPY_ACTION); }
public ReorgCopyAction(IWorkbenchSite site) { super(site); setText(ReorgMessages.ReorgCopyAction_3); setDescription(ReorgMessages.ReorgCopyAction_4); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.COPY_ACTION); }
/** * Creates a new <code>RefreshAction</code>. The action requires * that the selection provided by the site's selection provider is of type <code> * org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public RefreshAction(IWorkbenchSite site) { super(site); setText(ActionMessages.RefreshAction_label); setToolTipText(ActionMessages.RefreshAction_toolTip); JavaPluginImages.setLocalImageDescriptors(this, "refresh.gif");//$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.REFRESH_ACTION); }
/** * Creates a new <code>FormatAllAction</code>. The action requires * that the selection provided by the site's selection provider is of type <code> * org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public FormatAllAction(IWorkbenchSite site) { super(site); setText(ActionMessages.FormatAllAction_label); setToolTipText(ActionMessages.FormatAllAction_tooltip); setDescription(ActionMessages.FormatAllAction_description); fCleanUpDelegate= new MultiFormatAction(site); }
/** * Creates a new <code>OpenCallHierarchyAction</code>. The action requires * that the selection provided by the site's selection provider is of type * <code>org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public OpenCallHierarchyAction(IWorkbenchSite site) { super(site); setText(CallHierarchyMessages.OpenCallHierarchyAction_label); setToolTipText(CallHierarchyMessages.OpenCallHierarchyAction_tooltip); setDescription(CallHierarchyMessages.OpenCallHierarchyAction_description); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CALL_HIERARCHY_OPEN_ACTION); }
/** * Creates a new <code>ChangeTypeAction</code>. The action requires that * the selection provided by the site's selection provider is of type * <code>org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public ChangeTypeAction(IWorkbenchSite site) { super(site); setText(RefactoringMessages.ChangeTypeAction_label); setToolTipText(RefactoringMessages.ChangeTypeAction_tooltipText); setDescription(RefactoringMessages.ChangeTypeAction_description); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CHANGE_TYPE_ACTION); }
private IWorkbenchSite getSite() { IWorkbenchPage page= JavaPlugin.getActivePage(); if (page != null) { IWorkbenchPart part= page.getActivePart(); if (part != null) return part.getSite(); } return null; }
/** * Creates a new <code>GenerateConstructorUsingFieldsAction</code>. The action requires * that the selection provided by the site's selection provider is of type <code> * org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public GenerateNewConstructorUsingFieldsAction(IWorkbenchSite site) { super(site); setText(ActionMessages.GenerateConstructorUsingFieldsAction_label); setDescription(ActionMessages.GenerateConstructorUsingFieldsAction_description); setToolTipText(ActionMessages.GenerateConstructorUsingFieldsAction_tooltip); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CREATE_NEW_CONSTRUCTOR_ACTION); }
/** * Creates a new <code>InlineAction</code>. The action requires * that the selection provided by the site's selection provider is of type <code> * org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param site the site providing context information for this action */ public InlineAction(IWorkbenchSite site) { super(site); setText(RefactoringMessages.InlineAction_Inline); fInlineTemp = new InlineTempAction(site); fInlineConstant = new InlineConstantAction(site); fInlineMethod = new InlineMethodAction(site); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.INLINE_ACTION); }