Author: pkluegl
Date: Mon Jan  9 14:11:11 2012
New Revision: 1229161

URL: http://svn.apache.org/viewvc?rev=1229161&view=rev
Log:
UIMA-2322
was not able to find a solution and therefore replaced the complete page by a 
simpler version. Also deactivated TaskTag preferences.

Removed:
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderConfigurationBlock.java
Modified:
    uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/plugin.xml
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/TextMarkerPreferenceInitializer.java
    
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderPreferencePage.java

Modified: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/plugin.xml
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/plugin.xml?rev=1229161&r1=1229160&r2=1229161&view=diff
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/plugin.xml (original)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/plugin.xml Mon Jan  9 
14:11:11 2012
@@ -195,6 +195,15 @@ under the License.
       <initializer
             
class="org.apache.uima.textmarker.ide.core.TextMarkerPreferenceInitializer">
       </initializer>
+      <initializer
+            
class="org.apache.uima.textmarker.ide.debug.TextMarkerDebugPreferenceInitializer">
+      </initializer>
+      <initializer
+            
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerConsolePreferenceInitializer">
+      </initializer>
+      <initializer
+            
class="org.apache.uima.textmarker.ide.ui.TextMarkerUIPreferenceInitializer">
+      </initializer>
    </extension>
  <extension
        point="org.eclipse.dltk.core.interpreterContainerExtension">
@@ -237,12 +246,6 @@ under the License.
       </requires>
     </buildParticipant>
   </extension>
-     <extension
-         point="org.eclipse.core.runtime.preferences">
-      <initializer
-            
class="org.apache.uima.textmarker.ide.debug.TextMarkerDebugPreferenceInitializer">
-      </initializer>
-   </extension>
    <extension
          point="org.eclipse.dltk.debug.scriptDebugModel">
       <debugModel
@@ -251,10 +254,6 @@ under the License.
             
typeFactory="org.apache.uima.textmarker.ide.debug.TextMarkerTypeFactory">
       </debugModel>
    </extension>
-   <extension point="org.eclipse.core.runtime.preferences">
-    <initializer
-      
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerConsolePreferenceInitializer"
 />
-  </extension>
   
   <extension point="org.eclipse.ui.viewActions">
     <viewContribution
@@ -501,6 +500,82 @@ under the License.
       
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerConsolePreferences"
       
id="org.apache.uima.textmarker.ide.ui.console.preferences.TextMarkerConsolePreferences"
       name="%Console.PreferencePage" />
+    <page
+          category="org.apache.uima.textmarker.ide.preferences.debug.engines"
+          
class="org.apache.uima.textmarker.ide.debugger.preferences.TextMarkerDebuggerPreferencePage"
+          
id="org.apache.uima.textmarker.ide.preferences.debug.engines.debugger"
+          name="%PreferencePage.name">
+    </page>
+  </extension>
+  <extension
+        point="org.eclipse.ui.preferencePages">
+     <page
+           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerGlobalPreferencePage"
+           id="org.apache.uima.textmarker.ide.preferences"
+           name="%TextMarkerPreferencePage.name">
+     </page>
+     <page
+           category="org.apache.uima.textmarker.ide.preferences"
+           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerEditorPreferencesPage"
+           id="org.apache.uima.textmarker.ide.preferences.editor"
+           name="%TextMarkerEditorPreferencePage.name">
+     </page>
+     <page
+           category="org.apache.uima.textmarker.ide.preferences.editor"
+           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerEditorHoverPreferencePage"
+           id="org.apache.uima.textmarker.ide.preferences.editor.hovers"
+           name="%TextMarkerEditorHoversPreferencePage.name">
+     </page>
+     <page
+           category="org.apache.uima.textmarker.ide.preferences.editor"
+           
class="org.apache.uima.textmarker.ide.ui.templates.TextMarkerCodeTemplatesPreferencePage"
+           id="org.apache.uima.textmarker.ide.preferences.templates"
+           name="%TextMarkerCodeTemplatesPreferencePage.name">
+     </page>
+     <page
+           category="org.apache.uima.textmarker.ide.preferences.editor"
+           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerEditorSyntaxColoringPreferencePage"
+           id="org.apache.uima.textmarker.ide.ui.editor.SyntaxColoring"
+           name="%TextMarkerEditorSyntaxColoringPreferencePage.name">
+     </page>
+     <page
+           category="org.apache.uima.textmarker.ide.preferences.editor"
+           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerSmartTypingPreferencePage"
+           id="org.apache.uima.textmarker.ide.ui.editor.SmartTyping"
+           name="%TextMarkerEditorSmartTypingPreferencePage.name">
+     </page>
+     <page
+           category="org.apache.uima.textmarker.ide.preferences.editor"
+           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerFoldingPreferencePage"
+           id="org.apache.uima.textmarker.ide.ui.editor.TextMarkerFolding"
+           name="%TextMarkerEditorFoldingPreferencePage.name">
+     </page>
+     <!--
+     <page
+           category="org.apache.uima.textmarker.ide.preferences"
+           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerTodoTaskPreferencePage"
+           id="org.apache.uima.textmarker.ide.ui.editor.TodoTasks"
+           name="%TextMarkerTaskTags.name">
+     </page>
+     -->
+     <page
+           category="org.apache.uima.textmarker.ide.preferences.editor"
+           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerEditorAssistancePreferencePage"
+           id="org.apache.uima.textmarker.ide.ui.editor.Assistence"
+           name="%TextMarkerEditorAssistancePreferencePage.name">
+     </page>
+     <page
+           category="org.apache.uima.textmarker.ide.preferences"
+           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerBuilderPreferencePage"
+           id="org.apache.uima.textmarker.ide.preferences.builder"
+           name="Builder">
+     </page>
+     <page
+           category="org.apache.uima.textmarker.ide.preferences.editor"
+           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerFormatterPreferencePage"
+           id="org.apache.uima.textmarker.ide.preferences.formatter"
+           name="Formatter">
+     </page>
   </extension>
 
   <extension point="org.eclipse.ui.propertyPages">
@@ -658,14 +733,6 @@ under the License.
     </engineContribution>
   </extension>
 
-  <extension point="org.eclipse.ui.preferencePages">
-    <page
-      category="org.apache.uima.textmarker.ide.preferences.debug.engines"
-      
class="org.apache.uima.textmarker.ide.debugger.preferences.TextMarkerDebuggerPreferencePage"
-      id="org.apache.uima.textmarker.ide.preferences.debug.engines.debugger"
-      name="%PreferencePage.name">
-    </page>
-  </extension>
 
   <extension point="org.eclipse.ui.propertyPages">
     <page
@@ -849,12 +916,6 @@ under the License.
      </factory>
   </extension>
   <extension
-        point="org.eclipse.core.runtime.preferences">
-     <initializer
-           
class="org.apache.uima.textmarker.ide.ui.TextMarkerUIPreferenceInitializer">
-     </initializer>
-  </extension>
-  <extension
         point="org.eclipse.search.searchPages">
      <page
            canSearchEnclosingProjects="true"
@@ -1002,74 +1063,6 @@ under the License.
      </include>
   </extension>
   <extension
-        point="org.eclipse.ui.preferencePages">
-     <page
-           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerGlobalPreferencePage"
-           id="org.apache.uima.textmarker.ide.preferences"
-           name="%TextMarkerPreferencePage.name">
-     </page>
-     <page
-           category="org.apache.uima.textmarker.ide.preferences"
-           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerEditorPreferencesPage"
-           id="org.apache.uima.textmarker.ide.preferences.editor"
-           name="%TextMarkerEditorPreferencePage.name">
-     </page>
-     <page
-           category="org.apache.uima.textmarker.ide.preferences.editor"
-           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerEditorHoverPreferencePage"
-           id="org.apache.uima.textmarker.ide.preferences.editor.hovers"
-           name="%TextMarkerEditorHoversPreferencePage.name">
-     </page>
-     <page
-           category="org.apache.uima.textmarker.ide.preferences.editor"
-           
class="org.apache.uima.textmarker.ide.ui.templates.TextMarkerCodeTemplatesPreferencePage"
-           id="org.apache.uima.textmarker.ide.preferences.templates"
-           name="%TextMarkerCodeTemplatesPreferencePage.name">
-     </page>
-     <page
-           category="org.apache.uima.textmarker.ide.preferences.editor"
-           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerEditorSyntaxColoringPreferencePage"
-           id="org.apache.uima.textmarker.ide.ui.editor.SyntaxColoring"
-           name="%TextMarkerEditorSyntaxColoringPreferencePage.name">
-     </page>
-     <page
-           category="org.apache.uima.textmarker.ide.preferences.editor"
-           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerSmartTypingPreferencePage"
-           id="org.apache.uima.textmarker.ide.ui.editor.SmartTyping"
-           name="%TextMarkerEditorSmartTypingPreferencePage.name">
-     </page>
-     <page
-           category="org.apache.uima.textmarker.ide.preferences.editor"
-           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerFoldingPreferencePage"
-           id="org.apache.uima.textmarker.ide.ui.editor.TextMarkerFolding"
-           name="%TextMarkerEditorFoldingPreferencePage.name">
-     </page>
-     <page
-           category="org.apache.uima.textmarker.ide.preferences"
-           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerTodoTaskPreferencePage"
-           id="org.apache.uima.textmarker.ide.ui.editor.TodoTasks"
-           name="%TextMarkerTaskTags.name">
-     </page>
-     <page
-           category="org.apache.uima.textmarker.ide.preferences.editor"
-           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerEditorAssistancePreferencePage"
-           id="org.apache.uima.textmarker.ide.ui.editor.Assistence"
-           name="%TextMarkerEditorAssistancePreferencePage.name">
-     </page>
-     <page
-           category="org.apache.uima.textmarker.ide.preferences"
-           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerBuilderPreferencePage"
-           id="org.apache.uima.textmarker.ide.preferences.builder"
-           name="Builder">
-     </page>
-     <page
-           category="org.apache.uima.textmarker.ide.preferences.editor"
-           
class="org.apache.uima.textmarker.ide.ui.preferences.TextMarkerFormatterPreferencePage"
-           id="org.apache.uima.textmarker.ide.preferences.formatter"
-           name="Formatter">
-     </page>
-  </extension>
-  <extension
         point="org.eclipse.ui.propertyPages">
      <page
            category="org.apache.uima.textmarker.ide.propertyPage"
@@ -1453,5 +1446,5 @@ under the License.
             name="TextMarker Validator"
             nature="org.apache.uima.textmarker.ide.nature">
       </buildParticipant>
-   </extension>
+   </extension>
 </plugin>

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/TextMarkerPreferenceInitializer.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/TextMarkerPreferenceInitializer.java?rev=1229161&r1=1229160&r2=1229161&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/TextMarkerPreferenceInitializer.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/core/TextMarkerPreferenceInitializer.java
 Mon Jan  9 14:11:11 2012
@@ -20,9 +20,8 @@
 package org.apache.uima.textmarker.ide.core;
 
 import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
-import org.eclipse.core.runtime.Preferences;
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.dltk.compiler.task.TaskTagUtils;
+import org.eclipse.jface.preference.IPreferenceStore;
 
 public class TextMarkerPreferenceInitializer extends 
AbstractPreferenceInitializer {
 
@@ -31,8 +30,8 @@ public class TextMarkerPreferenceInitial
 
   @Override
   public void initializeDefaultPreferences() {
-    Preferences store = 
TextMarkerIdePlugin.getDefault().getPluginPreferences();
-    TaskTagUtils.initializeDefaultValues(store);
+    IPreferenceStore store = 
TextMarkerIdePlugin.getDefault().getPreferenceStore();
+//    TaskTagUtils.initializeDefaultValues(store);
     store.setDefault(TextMarkerCorePreferences.BUILDER_IMPORT_BY_NAME, false);
     store.setDefault(TextMarkerCorePreferences.BUILDER_RESOLVE_IMPORTS, false);
     
store.setDefault(TextMarkerCorePreferences.BUILDER_IGNORE_DUPLICATE_SHORTNAMES, 
false);

Modified: 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderPreferencePage.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderPreferencePage.java?rev=1229161&r1=1229160&r2=1229161&view=diff
==============================================================================
--- 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderPreferencePage.java
 (original)
+++ 
uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderPreferencePage.java
 Mon Jan  9 14:11:11 2012
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -20,52 +20,45 @@
 package org.apache.uima.textmarker.ide.ui.preferences;
 
 import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
-import org.apache.uima.textmarker.ide.core.TextMarkerNature;
-import 
org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPreferencePage;
-import org.eclipse.dltk.ui.preferences.IPreferenceConfigurationBlock;
-import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
+import org.apache.uima.textmarker.ide.core.TextMarkerCorePreferences;
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
 
-public class TextMarkerBuilderPreferencePage extends 
AbstractConfigurationBlockPreferencePage {
-  @Override
-  protected String getHelpId() {
-
-    return null;
-  }
-
-  @Override
-  protected void setDescription() {
-    setDescription("Builder");
-  }
+/**
+ * Preference page to manage preferences for the ide plugin.
+ */
+public class TextMarkerBuilderPreferencePage extends FieldEditorPreferencePage
+        implements IWorkbenchPreferencePage {
 
-  @Override
-  protected void setPreferenceStore() {
+  private BooleanFieldEditor builderImport;
+  private FieldEditor builderResolve;
+  private BooleanFieldEditor builderShortNames;
+  
+  public TextMarkerBuilderPreferencePage() {
     setPreferenceStore(TextMarkerIdePlugin.getDefault().getPreferenceStore());
+    setDescription("Builder");
   }
 
   @Override
-  protected Label createDescriptionLabel(Composite parent) {
-    return null;
+  protected void createFieldEditors() {
+    builderResolve = new 
BooleanFieldEditor(TextMarkerCorePreferences.BUILDER_RESOLVE_IMPORTS,
+            TextMarkerPreferencesMessages.BuilderResolveImports, 
getFieldEditorParent());
+    addField(builderResolve);
+    
+    builderImport = new 
BooleanFieldEditor(TextMarkerCorePreferences.BUILDER_IMPORT_BY_NAME,
+            TextMarkerPreferencesMessages.BuilderImportByName, 
getFieldEditorParent());
+    addField(builderImport);
+    
+    builderShortNames = new 
BooleanFieldEditor(TextMarkerCorePreferences.BUILDER_IGNORE_DUPLICATE_SHORTNAMES,
+            TextMarkerPreferencesMessages.BuilderIgnoreDuplicateShortnames, 
getFieldEditorParent());
+    addField(builderShortNames);
   }
 
-  @Override
-  protected IPreferenceConfigurationBlock createConfigurationBlock(
-          OverlayPreferenceStore overlayPreferenceStore) {
-    overlayPreferenceStore.addPropertyChangeListener(new 
IPropertyChangeListener() {
-
-      public void propertyChange(PropertyChangeEvent event) {
-        String property = event.getProperty();
-        Object newValue = event.getNewValue();
-        if (newValue instanceof Boolean) {
-          TextMarkerIdePlugin.getDefault().getPluginPreferences()
-                  .setValue(property, (Boolean) newValue);
-        }
-      }
-    });
-    return new TextMarkerBuilderConfigurationBlock(this, 
overlayPreferenceStore,
-            TextMarkerNature.NATURE_ID);
+  public void init(IWorkbench workbench) {
   }
-}
+  
+ 
+}
\ No newline at end of file


Reply via email to