@Override public void doOperation(int operation) { if (operation == OpenQuickOutlineHandler.QUICK_OUTLINE && outlinePresenter != null) { outlinePresenter.showInformation(); return; } super.doOperation(operation); }
@Override public void doOperation(int operation) { if (operation == QUICK_OUTLINE && outlinePresenter != null) { outlinePresenter.showInformation(); return; } super.doOperation(operation); }
protected void installFoldingSupport(ProjectionViewer projectionViewer) { foldingStructureProvider.install(this, projectionViewer); projectionViewer.doOperation(ProjectionViewer.TOGGLE); }
/** * Does the actual toggling of projection. */ private void toggleFolding() { ISourceViewer sourceViewer= getSourceViewer(); if (sourceViewer instanceof ProjectionViewer) { ProjectionViewer pv= (ProjectionViewer) sourceViewer; if (pv.isProjectionMode() != isFoldingEnabled()) { if (pv.canDoOperation(ProjectionViewer.TOGGLE)) pv.doOperation(ProjectionViewer.TOGGLE); } } }
/** * Does the actual toggling of projection. */ private void toggleFolding() { ISourceViewer sourceViewer= getSourceViewer(); if (sourceViewer instanceof ProjectionViewer) { ProjectionViewer pv= (ProjectionViewer) sourceViewer; if (pv.isProjectionMode() != isFoldingEnabled()) { if (pv.canDoOperation(ProjectionViewer.TOGGLE)) pv.doOperation(ProjectionViewer.TOGGLE); } } }
/** * Does the actual toggling of projection. */ private void toggleFolding() { ISourceViewer sourceViewer= getSourceViewer(); if (sourceViewer instanceof ProjectionViewer) { ProjectionViewer pv= (ProjectionViewer) sourceViewer; if (pv.isProjectionMode() != isFoldingEnabled()) { if (pv.canDoOperation(ProjectionViewer.TOGGLE)) pv.doOperation(ProjectionViewer.TOGGLE); } } }
protected XtextEditor openEditor(IFile file) throws Exception { IEditorPart openEditor = openEditor(file, getEditorId()); XtextEditor xtextEditor = EditorUtils.getXtextEditor(openEditor); if (xtextEditor != null) { ISourceViewer sourceViewer = xtextEditor.getInternalSourceViewer(); ((ProjectionViewer)sourceViewer).doOperation(ProjectionViewer.EXPAND_ALL); return xtextEditor; } else if (openEditor instanceof ErrorEditorPart) { Field field = openEditor.getClass().getDeclaredField("error"); field.setAccessible(true); throw new IllegalStateException("Couldn't open the editor.",((Status)field.get(openEditor)).getException()); } else { fail("Opened Editor with id:" + getEditorId() + ", is not an XtextEditor"); } return null; }
@Override public void createPartControl(Composite parent) { super.createPartControl(parent); ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer(); createFoldingSupport(projectionViewer); if (isFoldingEnabled()) { projectionViewer.doOperation(ProjectionViewer.TOGGLE); } }
@Override public void doOperation(int operation) { // Ensure underlying text widget is defined if ((getTextWidget() == null) || getTextWidget().isDisposed()) { return; } // Handle quick outline operation if (operation == QUICK_OUTLINE) { if (fOutlinePresenter != null) { fOutlinePresenter.showInformation(); } return; } // Handle default operations super.doOperation(operation); }
@Override public void doOperation(int operation) { if (getTextWidget() == null || !redraws()) { return; } switch (operation) { case CONTENTASSIST_PROPOSALS: String msg = fContentAssistant.showPossibleCompletions(); setStatusLineErrorMessage(msg); return; default: break; } super.doOperation(operation); } }
private void syncProjectionModeWithPreferences() { ProjectionViewer viewer = (ProjectionViewer) getSourceViewer(); if (viewer.isProjectionMode() != WikiTextUiPlugin.getDefault().getPreferences().isEditorFolding()) { viewer.doOperation(ProjectionViewer.TOGGLE); } }
public void doOperation(int operation) { if (getTextWidget() == null) return; switch (operation) { case SHOW_OUTLINE: if (fOutlinePresenter != null) fOutlinePresenter.showInformation(); return; case OPEN_STRUCTURE: if (fStructurePresenter != null) fStructurePresenter.showInformation(); return; case SHOW_HIERARCHY: if (fHierarchyPresenter != null) fHierarchyPresenter.showInformation(); return; } super.doOperation(operation); }
@Override public void doOperation(int operation) { if (getTextWidget() == null) return; switch (operation) { case SHOW_OUTLINE: if (fOutlinePresenter != null) fOutlinePresenter.showInformation(); return; case OPEN_STRUCTURE: if (fStructurePresenter != null) fStructurePresenter.showInformation(); return; case SHOW_HIERARCHY: if (fHierarchyPresenter != null) fHierarchyPresenter.showInformation(); return; } super.doOperation(operation); }
@Override public void doOperation(int operation) { if (getTextWidget() == null) return; switch (operation) { case SHOW_OUTLINE: if (fOutlinePresenter != null) fOutlinePresenter.showInformation(); return; case OPEN_STRUCTURE: if (fStructurePresenter != null) fStructurePresenter.showInformation(); return; case SHOW_HIERARCHY: if (fHierarchyPresenter != null) fHierarchyPresenter.showInformation(); return; } super.doOperation(operation); }
if (pv.isProjectionMode() != isFoldingEnabled()) { if (pv.canDoOperation(ProjectionViewer.TOGGLE)) { pv.doOperation(ProjectionViewer.TOGGLE);
@Override public void createPartControl(Composite parent) { // Over-ride to add code-folding support super.createPartControl(parent); if (getSourceViewer() instanceof ProjectionViewer) { ProjectionViewer viewer =(ProjectionViewer)getSourceViewer(); projectionSupport = new ProjectionSupport(viewer,getAnnotationAccess(),getSharedColors()); projectionSupport.install(); //turn projection mode on viewer.doOperation(ProjectionViewer.TOGGLE); } }
projectionSupport = new ProjectionSupport( projectionViewer, getAnnotationAccess(), getSharedColors() ); projectionSupport.install(); projectionViewer.doOperation( ProjectionViewer.TOGGLE );
@Override public void createPartControl(Composite parent) { super.createPartControl(parent); ProjectionViewer viewer = getProjectionViewer(); projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors()); projectionSupport.install(); // turn projection mode on viewer.doOperation(ProjectionViewer.TOGGLE); annotationModel = viewer.getProjectionAnnotationModel(); getPreferenceStore().addPropertyChangeListener(preferenceChangeListener); }
@Override public void createPartControl(Composite parent) { super.createPartControl(parent); ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer(); createFoldingSupport(projectionViewer); if (isFoldingEnabled()) { projectionViewer.doOperation(ProjectionViewer.TOGGLE); } if (fMarkOccurrenceAnnotations) { installOccurrencesFinder(); } getEditorSite().getShell().addShellListener(fActivationListener); fEditorSelectionChangedListener = new EditorSelectionChangedListener(); fEditorSelectionChangedListener.install(getSelectionProvider()); }
viewer.doOperation( ProjectionViewer.TOGGLE );