@Override
  public void editorContextMenuAboutToShow(IMenuManager menu) {
    editorExtension.fillContextMenu(menu);
    // ColoredSourceFile sourceFile = getSourceFile();
    // ToggleTextColorContext context = new
    // ToggleTextColorContext(sourceFile,
    // this.getSelectionProvider().getSelection());
    // try {
    // List<IFeature> visibleFeatures = new ArrayList<IFeature>(sourceFile
    // .getFeatureModel().getVisibleFeatures());
    // Collections.sort(visibleFeatures);
    // for (IFeature feature : visibleFeatures) {
    // menu.add(new ToggleTextColorAction(context, feature));
    // }
    // menu.add(new ToggleAllFeatureSubmenu(context, sourceFile
    // .getFeatureModel().getFeatures()));
    // } catch (JavaModelException e) {
    // e.printStackTrace();
    // }
    // menu.add(new ColorRefAction(sourceFile.getResource()));
    //
    // menu.add(new ColorProjectionSubmenu(this, context));

    super.editorContextMenuAboutToShow(menu);
  }
  @Override
  public void doSave(IProgressMonitor progressMonitor) {
    boolean wasDirty = isDirty();
    super.doSave(progressMonitor);

    editorExtension.afterSave(wasDirty);
  }
示例#3
0
  @Override
  public void dispose() {
    colorManager.dispose();
    ISourceViewer sourceViewer = getSourceViewer();
    if (sourceViewer instanceof ITextViewerExtension) {
      ((ITextViewerExtension) sourceViewer).removeVerifyKeyListener(bracketInserter);
    }

    super.dispose();
  }
示例#4
0
  @Override
  public void createPartControl(Composite parent) {
    setSourceViewerConfiguration(new Configuration(colorManager, this, getPreferenceStore()));

    super.createPartControl(parent);

    ISourceViewer sourceViewer = getSourceViewer();
    if (sourceViewer instanceof ITextViewerExtension) {
      bracketInserter.setSourceViewer(sourceViewer);
      bracketInserter.addBrackets('{', '}');
      ((ITextViewerExtension) sourceViewer).prependVerifyKeyListener(bracketInserter);
    }
  }
示例#5
0
  @Override
  protected void createActions() {
    super.createActions();

    setAction("QuickFormat", null);

    IAction formatAction = new KotlinFormatAction(this);
    formatAction.setText("Format");
    formatAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.FORMAT);
    setAction("Format", formatAction);
    markAsStateDependentAction("Format", true);
    markAsSelectionDependentAction("Format", true);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(formatAction, IJavaHelpContextIds.FORMAT_ACTION);

    IAction openDeclarationAction = new OpenDeclarationAction(this);
    openDeclarationAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_EDITOR);
    openDeclarationAction.setText(ActionMessages.OpenAction_declaration_label);
    setAction("OpenEditor", openDeclarationAction);
  }
  @Override
  public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    installCodeColoring();
    if (isMarkingOccurrences()) uninstallOccurrencesFinder();

    // InlineProjectionJavaViewer viewer = (InlineProjectionJavaViewer)
    // getViewer();
    //
    // InlineProjectionSupport projectionSupport = new
    // InlineProjectionSupport(
    // viewer, getAnnotationAccess(), getSharedColors());
    // projectionSupport.install();TODO: disabled inline projection
    // viewer.doOperation(ProjectionViewer.TOGGLE);
    //
    // viewer.disableProjection();
    // viewer.enableInlineProjection();

    editorExtension.createErrorPanel(parent);
    editorExtension.alignErrorPanel(parent);
    editorExtension.initKeepColorManager();
    // editorExtension.installAlternativeAnnotations();
  }
 @Override
 protected void doSetInput(IEditorInput input) throws CoreException {
   super.doSetInput(input);
   installCodeColoring();
 }
 public void reconciled(CompilationUnit ast, boolean forced, IProgressMonitor progressMonitor) {
   super.reconciled(ast, forced, progressMonitor);
   Object[] listeners = fReconcilingListeners.getListeners();
   for (int i = 0, length = listeners.length; i < length; ++i)
     ((IJavaReconcilingListener) listeners[i]).reconciled(ast, forced, progressMonitor);
 }