org.eclipse.jdt.ui.actions.OpenEditorActionGroup Java Examples

The following examples show how to use org.eclipse.jdt.ui.actions.OpenEditorActionGroup. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GWTJavaEditor.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Overwrite the OpenEditorActionGroup in the CompositeActionGroup with our
 * custom GWTOpenEditorActionGroup that contains our JSNI-aware GWTOpenAction.
 */
private void replaceOpenEditorAction(CompositeActionGroup actionGroup,
    GWTOpenEditorActionGroup newAction) throws Exception {

  // The fGroups backing array in CompositeActionGroup is private, so we have
  // to resort to reflection to update it.
  Field groupsField = CompositeActionGroup.class.getDeclaredField("fGroups");
  groupsField.setAccessible(true);
  ActionGroup[] actionGroups = (ActionGroup[]) groupsField.get(actionGroup);

  // Search the ActionGroup array and replace the OpenEditorActionGroup
  for (int i = 0; i < actionGroups.length; i++) {
    if (actionGroups[i] instanceof OpenEditorActionGroup) {
      actionGroups[i] = newAction;
      return;
    }
  }

  throw new Exception("No existing OpenEditorActionGroup found");
}
 
Example #2
Source File: NewSearchViewActionGroup.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public NewSearchViewActionGroup(IViewPart part) {
	Assert.isNotNull(part);
	OpenViewActionGroup openViewActionGroup;
	setGroups(new ActionGroup[]{
		new OpenEditorActionGroup(part),
		openViewActionGroup= new OpenViewActionGroup(part),
		new GenerateActionGroup(part),
		new RefactorActionGroup(part),
		new JavaSearchActionGroup(part)
	});
	openViewActionGroup.containsShowInMenu(false);
}
 
Example #3
Source File: JavaBrowsingPart.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected void createActions() {
	fActionGroups= new CompositeActionGroup(new ActionGroup[] {
			new NewWizardsActionGroup(this.getSite()),
			fOpenEditorGroup= new OpenEditorActionGroup(this),
			new OpenViewActionGroup(this),
			fCCPActionGroup= new CCPActionGroup(this),
			new GenerateActionGroup(this),
			new RefactorActionGroup(this),
			new ImportActionGroup(this),
			fBuildActionGroup= new BuildActionGroup(this),
			new JavaSearchActionGroup(this)});


	if (fHasWorkingSetFilter) {
		String viewId= getConfigurationElement().getAttribute("id"); //$NON-NLS-1$
		Assert.isNotNull(viewId);
		IPropertyChangeListener workingSetListener= new IPropertyChangeListener() {
			public void propertyChange(PropertyChangeEvent event) {
				doWorkingSetChanged(event);
			}
		};
		fWorkingSetFilterActionGroup= new WorkingSetFilterActionGroup(getSite(), workingSetListener);
		fViewer.addFilter(fWorkingSetFilterActionGroup.getWorkingSetFilter());
	}

	// Custom filter group
	if (fHasCustomFilter)
		fCustomFiltersActionGroup= new CustomFiltersActionGroup(this, fViewer);

	fToggleLinkingAction= new ToggleLinkingAction(this);
	fToggleLinkingAction.setActionDefinitionId(IWorkbenchCommandConstants.NAVIGATE_TOGGLE_LINK_WITH_EDITOR);
}
 
Example #4
Source File: CustomOpenActionProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void init(ICommonActionExtensionSite aConfig) {
    if (aConfig.getViewSite() instanceof ICommonViewerWorkbenchSite) {
        viewSite = (ICommonViewerWorkbenchSite) aConfig.getViewSite();
        openFileAction = new OpenEditorActionGroup((IViewPart) viewSite.getPart());
        contribute = true;
    }
    repositoryAccessor = new RepositoryAccessor();
    repositoryAccessor.init();
    fileStoreFinder = new FileStoreFinder();
}
 
Example #5
Source File: CallHierarchyViewPart.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private void makeActions() {
      fRefreshViewAction = new RefreshViewAction(this);
      fRefreshSingleElementAction= new RefreshElementAction(fCallHierarchyViewer);

new CallHierarchyOpenEditorHelper(fLocationViewer);
new CallHierarchyOpenEditorHelper(fCallHierarchyViewer);

fOpenLocationAction= new OpenLocationAction(this, getSite());
fLocationCopyAction= fLocationViewer.initCopyAction(getViewSite(), fClipboard);
      fFocusOnSelectionAction = new FocusOnSelectionAction(this);
      fCopyAction= new CopyCallHierarchyAction(this, fClipboard, fCallHierarchyViewer);
      fSearchScopeActions = new SearchScopeActionGroup(this, fDialogSettings);
      fShowSearchInDialogAction= new ShowSearchInDialogAction(this, fCallHierarchyViewer);
      fFiltersActionGroup = new CallHierarchyFiltersActionGroup(this,
              fCallHierarchyViewer);
      fHistoryDropDownAction = new HistoryDropDownAction(this);
      fHistoryDropDownAction.setEnabled(false);
      fCancelSearchAction = new CancelSearchAction(this);
      setCancelEnabled(false);
      fExpandWithConstructorsAction= new ExpandWithConstructorsAction(this, fCallHierarchyViewer);
      fRemoveFromViewAction= new RemoveFromViewAction(this, fCallHierarchyViewer);
      fPinViewAction= new PinCallHierarchyViewAction(this);
      fToggleOrientationActions = new ToggleOrientationAction[] {
              new ToggleOrientationAction(this, VIEW_ORIENTATION_VERTICAL),
              new ToggleOrientationAction(this, VIEW_ORIENTATION_HORIZONTAL),
              new ToggleOrientationAction(this, VIEW_ORIENTATION_AUTOMATIC),
              new ToggleOrientationAction(this, VIEW_ORIENTATION_SINGLE)
          };
fRemoveFromViewAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_DELETE);
      fToggleCallModeActions = new ToggleCallModeAction[] {
              new ToggleCallModeAction(this, CALL_MODE_CALLERS),
              new ToggleCallModeAction(this, CALL_MODE_CALLEES)
          };
      fToggleFieldModeActions = new SelectFieldModeAction[] {
              new SelectFieldModeAction(this, IJavaSearchConstants.REFERENCES),
              new SelectFieldModeAction(this, IJavaSearchConstants.READ_ACCESSES),
              new SelectFieldModeAction(this, IJavaSearchConstants.WRITE_ACCESSES)
          };
      fActionGroups = new CompositeActionGroup(new ActionGroup[] {
                  new OpenEditorActionGroup(this),
                  new OpenViewActionGroup(this),
			new CCPActionGroup(this, true),
                  new GenerateActionGroup(this),
                  new RefactorActionGroup(this),
                  new JavaSearchActionGroup(this),
                  fSearchScopeActions, fFiltersActionGroup
              });
  }
 
Example #6
Source File: JavaBrowsingPart.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
protected void setOpenEditorGroup(OpenEditorActionGroup openEditorGroup) {
	fOpenEditorGroup= openEditorGroup;
}
 
Example #7
Source File: JavaBrowsingPart.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
protected OpenEditorActionGroup getOpenEditorGroup() {
	return fOpenEditorGroup;
}