public SyntaxColoringPreferencePage() {
   super();
   LogManager.logDebug("Start SyntaxColoringPreferencePage:", this);
   setPreferenceStore(IDEPlugin.getDefault().getPreferenceStore());
   setDescription(Localization.getString("SyntaxColoringPreferencePage.SyntaxColoringOptions"));
   LogManager.logDebug("End SyntaxColoringPreferencePage:", this);
 }
Ejemplo n.º 2
0
 /**
  * An accessor method for the <code>CScanner</code> associated with this editor. This method is
  * used in order to dispatch notifications to the <code>CScanner</code> when the color preferences
  * have been changed. The <code>CEditor</code> class calls this method to get the <code>CScanner
  * </code> associated with it, and then it reinitializes that <code>CScanner</code> using the
  * <code>CScanner.initializeScanner</code> method.
  *
  * @return the instance of the CScanner associated with this instance
  */
 protected CScanner getCScanner() {
   LogManager.logDebug("Start getCScanner:", this);
   if (scanner == null) {
     scanner = new CScanner(colorManager);
   }
   LogManager.logDebug("End getCScanner: returnVal-" + scanner, this);
   return scanner;
 }
Ejemplo n.º 3
0
 protected void setupDocument(IDocument document) {
   LogManager.logDebug("Start setupDocument: document-" + document, this);
   if (document != null) {
     IDocumentPartitioner partitioner =
         new FastPartitioner(new CPartitionScanner(), new String[] {CPartitionScanner.C_COMMENT});
     partitioner.connect(document);
     document.setDocumentPartitioner(partitioner);
   }
   LogManager.logDebug("End setupDocument:", this);
 }
Ejemplo n.º 4
0
 public ITextDoubleClickStrategy getDoubleClickStrategy(
     ISourceViewer sourceViewer, String contentType) {
   LogManager.logDebug(
       "Start getDoubleClickStrategy: sourceViewer-"
           + sourceViewer
           + ", contentType-"
           + contentType,
       this);
   if (doubleClickStrategy == null) doubleClickStrategy = new DoubleClickStrategy();
   LogManager.logDebug("End getDoubleClickStrategy: returnVal-" + doubleClickStrategy, this);
   return doubleClickStrategy;
 }
 public void dispose() {
   LogManager.logInfo("Disposing", this);
   super.dispose();
   stpDC.dispose();
   stpKC.dispose();
   stpEC.dispose();
   stpEE.dispose();
   stpCC.dispose();
   stpTC.dispose();
   stpSC.dispose();
   cDC.dispose();
   cKC.dispose();
   cPC.dispose();
   cCC.dispose();
   cTC.dispose();
   cSC.dispose();
   stpDC = null;
   stpKC = null;
   stpEC = null;
   stpEE = null;
   stpCC = null;
   stpTC = null;
   stpSC = null;
   cDC = null;
   cKC = null;
   cPC = null;
   cCC = null;
   cTC = null;
   cSC = null;
 }
  private ColorFieldEditor createColorFieldEditor(String name, String lblText, Composite parent) {
    LogManager.logDebug(
        "Start createColorFieldEditor: name-"
            + name
            + ", lblText-"
            + lblText
            + ", parent-"
            + parent,
        this);
    ColorFieldEditor cfe = new ColorFieldEditor(name, lblText, parent);
    cfe.setPage(this);
    cfe.setPreferenceStore(getPreferenceStore());
    cfe.load();

    LogManager.logDebug("End createColorFieldEditor: returnVal-" + cfe, this);
    return cfe;
  }
Ejemplo n.º 7
0
  public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    LogManager.logDebug("Start getPresentationReconciler: sourceViewer-" + sourceViewer, this);
    PresentationReconciler reconciler = new PresentationReconciler();

    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getCScanner());
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
    IPreferenceStore store = IDEPlugin.getDefault().getPreferenceStore();
    RGB comment = PreferenceConverter.getColor(store, IDEPreferenceConstants.P_C_COMMENT_COLOR);
    NonRuleBasedDamagerRepairer ndr =
        new NonRuleBasedDamagerRepairer(new TextAttribute(colorManager.getColor(comment)));
    reconciler.setDamager(ndr, CPartitionScanner.C_COMMENT);
    reconciler.setRepairer(ndr, CPartitionScanner.C_COMMENT);

    LogManager.logDebug("End getPresentationReconciler: returnVal-" + reconciler, this);
    return reconciler;
  }
  public boolean performOk() {
    LogManager.logDebug("Start performOk:", this);
    stpDC.store();
    stpKC.store();
    stpEC.store();
    stpEE.store();
    stpCC.store();
    stpTC.store();
    stpSC.store();
    cDC.store();
    cKC.store();
    cPC.store();
    cCC.store();
    cTC.store();
    cSC.store();

    LogManager.logDebug("End performOk returnVal-true", this);
    return true;
  }
  protected void performDefaults() {
    LogManager.logDebug("Start performDefaults:", this);
    stpDC.loadDefault();
    stpKC.loadDefault();
    stpEC.loadDefault();
    stpEE.loadDefault();
    stpCC.loadDefault();
    stpTC.loadDefault();
    stpSC.loadDefault();
    cDC.loadDefault();
    cKC.loadDefault();
    cPC.loadDefault();
    cCC.loadDefault();
    cTC.loadDefault();
    cSC.loadDefault();

    super.performDefaults();
    LogManager.logDebug("End performDefaults:", this);
  }
  protected Control createContents(Composite parent) {
    LogManager.logDebug("Start createContents: parent-" + parent, this);
    final TabFolder tabFolder = new TabFolder(parent, SWT.BORDER);

    // STP Editor
    TabItem stpEditor = new TabItem(tabFolder, SWT.NULL);
    stpEditor.setText(Localization.getString("SyntaxColoringPreferencePage.STPEditor"));
    Composite comp = new Composite(tabFolder, SWT.NULL);
    stpEditor.setControl(comp);

    stpDC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_STP_DEFAULT_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.DefaultColor"),
            comp);
    stpKC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_STP_KEYWORD_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.KeywordColor"),
            comp);
    stpEC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_STP_EMBEDDED_C_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.EmbeddedCColor"),
            comp);
    stpEE =
        createColorFieldEditor(
            IDEPreferenceConstants.P_STP_EMBEDDED_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.EmbeddedColor"),
            comp);
    stpCC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_STP_COMMENT_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.CommentColor"),
            comp);
    stpTC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_STP_TYPE_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.TypeColor"),
            comp);
    stpSC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_STP_STRING_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.StringColor"),
            comp);

    // C Editor
    TabItem cEditor = new TabItem(tabFolder, SWT.NULL);
    cEditor.setText(Localization.getString("SyntaxColoringPreferencePage.CEditor"));
    comp = new Composite(tabFolder, SWT.NULL);
    cEditor.setControl(comp);

    cDC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_C_DEFAULT_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.DefaultColor"),
            comp);
    cKC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_C_KEYWORD_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.KeywordColor"),
            comp);
    cPC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_C_PREPROCESSOR_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.PreprocessorColor"),
            comp);
    cCC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_C_COMMENT_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.CommentColor"),
            comp);
    cTC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_C_TYPE_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.TypeColor"),
            comp);
    cSC =
        createColorFieldEditor(
            IDEPreferenceConstants.P_C_STRING_COLOR,
            Localization.getString("SyntaxColoringPreferencePage.StringColor"),
            comp);

    LogManager.logDebug("End createContents: returnVal-" + tabFolder, this);
    return tabFolder;
  }
 public void init(IWorkbench workbench) {
   LogManager.logInfo("Initializing", this);
 }
Ejemplo n.º 12
0
 public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
   LogManager.logDebug("Start/End getConfiguredContentTypes: sourceViewer-" + sourceViewer, this);
   return new String[] {IDocument.DEFAULT_CONTENT_TYPE, CPartitionScanner.C_COMMENT};
 }
Ejemplo n.º 13
0
 /**
  * The constructor for the <code>CConfiguration</code> class. Takes as its only parameter the
  * ColorManager to use for syntax highlighting.
  *
  * @param colorManager the <code>ColorManager</code> to use for text highlighting
  */
 public CConfiguration(ColorManager colorManager) {
   LogManager.logDebug("Start/End CConfiguration: colorManager-" + colorManager, this);
   this.colorManager = colorManager;
 }
Ejemplo n.º 14
0
 protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
   LogManager.logDebug("Start/End createAnnotationModel: element-" + element, this);
   return new AnnotationModel();
 }