Suppress custom editor buttons in TODOs list. BLD200312171900
authorpkuzel@netbeans.org
Wed, 17 Dec 2003 17:53:49 +0000
changeset 38410a24bfb30d21
parent 3840 609463c5e91f
child 3842 08727f33af9c
Suppress custom editor buttons in TODOs list.
suggestions_framework/src/org/netbeans/modules/tasklist/suggestions/SuggestionNode.java
tasklist.core/src/org/netbeans/modules/tasklist/core/ColumnProperty.java
tasklist.core/src/org/netbeans/modules/tasklist/core/MyTreeTableView.java
tasklist.docscan/src/org/netbeans/modules/tasklist/docscan/Bundle.properties
tasklist.docscan/src/org/netbeans/modules/tasklist/docscan/SourceTasksView.java
     1.1 --- a/suggestions_framework/src/org/netbeans/modules/tasklist/suggestions/SuggestionNode.java	Wed Dec 17 17:00:11 2003 +0000
     1.2 +++ b/suggestions_framework/src/org/netbeans/modules/tasklist/suggestions/SuggestionNode.java	Wed Dec 17 17:53:49 2003 +0000
     1.3 @@ -189,6 +189,9 @@
     1.4              p.setName(SuggestionsView.PROP_SUGG_FILE);
     1.5              p.setDisplayName(NbBundle.getMessage(SuggestionNode.class, "File")); // NOI18N
     1.6              p.setShortDescription(NbBundle.getMessage(SuggestionNode.class, "FileHint")); // NOI18N
     1.7 +            // HACK #38190
     1.8 +            p.setValue("suppressCustomEditor", Boolean.TRUE); // NOI18N
     1.9 +            p.setValue("canEditAsText", Boolean.FALSE); // NOI18N
    1.10              ss.put(p);
    1.11  
    1.12              p = new Reflection(item, Integer.TYPE, "getLineNumber", null /* Don't allow users to edit this! "setLineNumber" */); // NOI18N
     2.1 --- a/tasklist.core/src/org/netbeans/modules/tasklist/core/ColumnProperty.java	Wed Dec 17 17:00:11 2003 +0000
     2.2 +++ b/tasklist.core/src/org/netbeans/modules/tasklist/core/ColumnProperty.java	Wed Dec 17 17:53:49 2003 +0000
     2.3 @@ -1,7 +1,22 @@
     2.4 +/*
     2.5 + *                 Sun Public License Notice
     2.6 + *
     2.7 + * The contents of this file are subject to the Sun Public License
     2.8 + * Version 1.0 (the "License"). You may not use this file except in
     2.9 + * compliance with the License. A copy of the License is available at
    2.10 + * http://www.sun.com/
    2.11 + *
    2.12 + * The Original Code is NetBeans. The Initial Developer of the Original
    2.13 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
    2.14 + * Microsystems, Inc. All Rights Reserved.
    2.15 + */
    2.16 +
    2.17  package org.netbeans.modules.tasklist.core;
    2.18  
    2.19  import org.openide.nodes.PropertySupport;
    2.20  
    2.21 +import java.beans.PropertyEditor;
    2.22 +
    2.23  /** 
    2.24   * Class holding column properties.
    2.25   * See debuggercore's TreeTableExplorerViewSupport.java 
    2.26 @@ -17,7 +32,9 @@
    2.27       * more work and more data). */        
    2.28      public int uid; // Used to check equivalence in serialized data,
    2.29                      // so I don't have to store whole string names
    2.30 -    public int width;  
    2.31 +    public int width;
    2.32 +
    2.33 +    private Class propertyEditorClass;
    2.34  
    2.35      // Used for non-treetable columns
    2.36      /** Construct a new property for a "table column" (e.g. not
    2.37 @@ -77,7 +94,7 @@
    2.38          this.uid = uid;
    2.39          this.width = width;
    2.40          setValue( "TreeColumnTTV", Boolean.TRUE );// NOI18N
    2.41 -//        setValue("suppressCustomEditor", Boolean.TRUE); // NOI18N
    2.42 +        setValue("suppressCustomEditor", Boolean.TRUE); // NOI18N
    2.43          setValue("canEditAsText", Boolean.FALSE); // NOI18N
    2.44          if (sortable) {
    2.45              setValue ("ComparableColumnTTV", Boolean.TRUE);// NOI18N
    2.46 @@ -91,4 +108,18 @@
    2.47      public int getWidth() {
    2.48          return width;
    2.49      }
    2.50 +
    2.51 +    public final void setPropertyEditorClass(Class peClass) {
    2.52 +        propertyEditorClass = peClass;
    2.53 +    }
    2.54 +
    2.55 +    public final PropertyEditor getPropertyEditor() {
    2.56 +        if (propertyEditorClass != null)
    2.57 +            try {
    2.58 +                return (PropertyEditor) propertyEditorClass.newInstance ();
    2.59 +            } catch (InstantiationException ex) {
    2.60 +            } catch (IllegalAccessException iex) {
    2.61 +            }
    2.62 +        return super.getPropertyEditor ();
    2.63 +    }
    2.64  }
     3.1 --- a/tasklist.core/src/org/netbeans/modules/tasklist/core/MyTreeTableView.java	Wed Dec 17 17:00:11 2003 +0000
     3.2 +++ b/tasklist.core/src/org/netbeans/modules/tasklist/core/MyTreeTableView.java	Wed Dec 17 17:53:49 2003 +0000
     3.3 @@ -1,7 +1,14 @@
     3.4  /*
     3.5 - * MyTreeTableView.java
     3.6 + *                 Sun Public License Notice
     3.7   *
     3.8 - * Created on 16. Dezember 2003, 12:08
     3.9 + * The contents of this file are subject to the Sun Public License
    3.10 + * Version 1.0 (the "License"). You may not use this file except in
    3.11 + * compliance with the License. A copy of the License is available at
    3.12 + * http://www.sun.com/
    3.13 + *
    3.14 + * The Original Code is NetBeans. The Initial Developer of the Original
    3.15 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
    3.16 + * Microsystems, Inc. All Rights Reserved.
    3.17   */
    3.18  
    3.19  package org.netbeans.modules.tasklist.core;
     4.1 --- a/tasklist.docscan/src/org/netbeans/modules/tasklist/docscan/Bundle.properties	Wed Dec 17 17:00:11 2003 +0000
     4.2 +++ b/tasklist.docscan/src/org/netbeans/modules/tasklist/docscan/Bundle.properties	Wed Dec 17 17:53:49 2003 +0000
     4.3 @@ -46,8 +46,8 @@
     4.4  
     4.5  ## SourceTaskNode properties
     4.6  # used as table headers so should be reasonably short
     4.7 -SuggestionsRoot=Suggestion
     4.8 -SuggestionsRootHint=A summary of the suggestion
     4.9 +TODO=TODO Text
    4.10 +TODOHint=TODO text extracted from source code
    4.11  Priority=Prio
    4.12  PriorityHint=The priority of the suggestion: the lower the number, the higher the priority
    4.13  File=Filename
     5.1 --- a/tasklist.docscan/src/org/netbeans/modules/tasklist/docscan/SourceTasksView.java	Wed Dec 17 17:00:11 2003 +0000
     5.2 +++ b/tasklist.docscan/src/org/netbeans/modules/tasklist/docscan/SourceTasksView.java	Wed Dec 17 17:53:49 2003 +0000
     5.3 @@ -38,6 +38,7 @@
     5.4  
     5.5  
     5.6  import org.netbeans.modules.tasklist.core.*;
     5.7 +import org.netbeans.modules.tasklist.core.editors.StringPropertyEditor;
     5.8  import org.netbeans.modules.tasklist.suggestions.*;
     5.9  import org.netbeans.modules.tasklist.client.SuggestionPriority;
    5.10  
    5.11 @@ -172,8 +173,8 @@
    5.12          return new ColumnProperty(
    5.13                  MAIN_COLUMN_UID, // UID -- never change (part of serialization
    5.14                  PROP_TASK_SUMMARY,
    5.15 -                NbBundle.getMessage(SourceTaskNode.class, "SuggestionsRoot"), // NOI18N
    5.16 -                NbBundle.getMessage(SourceTaskNode.class, "SuggestionsRoot"), // NOI18N
    5.17 +                NbBundle.getMessage(SourceTaskNode.class, "TODO"), // NOI18N
    5.18 +                NbBundle.getMessage(SourceTaskNode.class, "TODOHint"), // NOI18N
    5.19                  true,
    5.20                  width
    5.21          );
    5.22 @@ -194,7 +195,7 @@
    5.23      }
    5.24  
    5.25      private ColumnProperty createFileColumn(boolean visible, int width) {
    5.26 -        return new ColumnProperty(
    5.27 +        ColumnProperty file = new ColumnProperty(
    5.28                  FILE_COLUMN_UID, // UID -- never change (part of serialization
    5.29                  PROP_SUGG_FILE,
    5.30                  String.class,
    5.31 @@ -204,6 +205,9 @@
    5.32                  visible,
    5.33                  width
    5.34          );
    5.35 +        // #38190 FIXME instead of renderer we do not have access to
    5.36 +        file.setPropertyEditorClass(StringPropertyEditor.class);
    5.37 +        return file;
    5.38      }
    5.39  
    5.40      protected void componentClosed() {