This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 220213
Collapse All | Expand All

(-)a/css.visual/src/org/netbeans/modules/css/visual/AutocompleteJComboBox.java (-35 / +164 lines)
Lines 44-112 Link Here
44
 *
44
 *
45
 * @author marekfukala
45
 * @author marekfukala
46
 */
46
 */
47
48
package org.netbeans.modules.css.visual;
47
package org.netbeans.modules.css.visual;
49
48
50
import java.util.logging.Level;
49
import java.awt.Rectangle;
51
import java.util.logging.Logger;
50
import java.util.logging.Logger;
51
import javax.accessibility.Accessible;
52
import javax.swing.ComboBoxEditor;
52
import javax.swing.ComboBoxModel;
53
import javax.swing.ComboBoxModel;
53
import javax.swing.JComboBox;
54
import javax.swing.JComboBox;
54
import javax.swing.event.PopupMenuEvent;
55
import javax.swing.JList;
55
import javax.swing.event.PopupMenuListener;
56
import javax.swing.event.DocumentEvent;
56
import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
57
import javax.swing.event.DocumentListener;
58
import javax.swing.plaf.basic.ComboPopup;
59
import javax.swing.text.BadLocationException;
60
import javax.swing.text.Document;
61
import javax.swing.text.JTextComponent;
57
import org.jdesktop.swingx.autocomplete.ObjectToStringConverter;
62
import org.jdesktop.swingx.autocomplete.ObjectToStringConverter;
63
import org.netbeans.modules.css.lib.api.properties.PropertyDefinition;
58
64
59
public class AutocompleteJComboBox extends JComboBox {
65
public class AutocompleteJComboBox extends JComboBox {
60
66
61
    private static final Logger LOGGER = Logger.getLogger(AutocompleteJComboBox.class.getSimpleName());
67
    private static final Logger LOGGER = Logger.getLogger(AutocompleteJComboBox.class.getSimpleName());
62
    
63
    private boolean popupCancelled;
68
    private boolean popupCancelled;
64
69
65
    public AutocompleteJComboBox(ComboBoxModel model, ObjectToStringConverter objectToStringConverter) {
70
    public AutocompleteJComboBox(ComboBoxModel model, ObjectToStringConverter objectToStringConverter) {
66
        super(model);
71
        super(model);
67
        initialize(objectToStringConverter);
72
//        setEditable(true);
73
        ComboBoxEditor comboEditor = getEditor();
74
        JTextComponent textEditor = ( JTextComponent ) comboEditor.getEditorComponent();
75
        Document doc = textEditor.getDocument();
76
            doc.addDocumentListener( new AutoComleteListener() );
77
        
78
//        initialize(objectToStringConverter);
68
    }
79
    }
69
80
81
//    @Override
82
//    public void setValue(Object o) {
83
//        ignoreSelectionEvents = true;
84
//        setSelectedItem(o);
85
//        ignoreSelectionEvents = false;
86
//    }
87
//    
70
    private void initialize(ObjectToStringConverter converter) {
88
    private void initialize(ObjectToStringConverter converter) {
71
        AutoCompleteDecorator.decorate(this, converter);
89
//        AutoCompleteDecorator.decorate(this, converter);
72
90
73
        //At least on Mac and Windows XP L&F, the decorated JComboBox doesn't not fire
91
        //At least on Mac and Windows XP L&F, the decorated JComboBox doesn't not fire
74
        //ActionEvent when the value is confirmed.
92
        //ActionEvent when the value is confirmed.
75
        addPopupMenuListener(new PopupMenuListener() {
93
//        addPopupMenuListener(new PopupMenuListener() {
76
            @Override
94
//            @Override
77
            public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
95
//            public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
78
                popupCancelled = false;
96
//                popupCancelled = false;
97
//            }
98
//
99
//            @Override
100
//            public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
101
//                if (!popupCancelled) {
102
//                    superFireActionEvent();
103
//                }
104
//            }
105
//
106
//            @Override
107
//            public void popupMenuCanceled(PopupMenuEvent e) {
108
//                popupCancelled = false;
109
//            }
110
//        });
111
112
    }
113
    
114
    
115
116
    public String getSelectedPropertyName() {
117
        Object selected = getModel().getSelectedItem();
118
        if (selected != null) {
119
            if (selected instanceof PropertyDefinition) {
120
                PropertyDefinition pd = (PropertyDefinition) selected;
121
                return pd.getName();
122
            } else if (selected instanceof String) {
123
                String val = (String) selected;
124
                if (!val.trim().isEmpty()) {
125
                    return val;
126
                }
127
            }
128
        }
129
        return null;
130
    }
131
132
//    @Override
133
//    protected void fireActionEvent() {
134
//        LOGGER.log(Level.FINE, "fireActionEvent()", new Exception());
135
//        LOGGER.log(Level.FINE, "popup opened: {0}", isPopupVisible());
136
//
137
//        //On the contrary to the ActionEvent not being fired upon entering the value,
138
//        //each keystroke causes an ActionEvent to be fired!!!
139
//        //So filter out such action events and fire the action event only when the popup is closed
140
//        //and it has not been cancelled.
141
//    }
142
//
143
//    private void superFireActionEvent() {
144
//        //really fire the action event once the edited value is confirmed
145
//        super.fireActionEvent();
146
//    }
147
    
148
    private boolean ignoreSelectionEvents = false;
149
//    final boolean isAutoComplete;
150
    
151
    private class AutoComleteListener implements DocumentListener {
152
153
        @Override
154
        public void insertUpdate( DocumentEvent e ) {
155
            matchSelection( e );
156
        }
157
158
        @Override
159
        public void removeUpdate( DocumentEvent e ) {
160
            matchSelection( e );
161
        }
162
163
        @Override
164
        public void changedUpdate( DocumentEvent e ) {
165
            matchSelection( e );
166
        }
167
    }
168
169
    private void matchSelection( DocumentEvent e ) {
170
        if( ignoreSelectionEvents )
171
            return;
172
        try {
173
            ignoreSelectionEvents = true;
174
            if( !isDisplayable() )
175
                return;
176
            String editorText;
177
            try {
178
                editorText = e.getDocument().getText( 0, e.getDocument().getLength() );
179
            } catch( BadLocationException ex ) {
180
                //ignore
181
                return;
79
            }
182
            }
80
183
81
            @Override
184
            if( null != getSelectedItem() && getSelectedItem().toString().equals(editorText) )
82
            public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
185
                return;
83
                if (!popupCancelled) {
186
84
                    superFireActionEvent();
187
            if( !isPopupVisible() ) {
85
                }
188
                showPopup();
86
            }
189
            }
87
190
88
            @Override
191
            JList list = getPopupList();
89
            public void popupMenuCanceled(PopupMenuEvent e) {
192
            if( null == list )
90
                popupCancelled = false;
193
                return;
194
195
            int matchIndex = findMatch( editorText );
196
197
            if( matchIndex >= 0 ) {
198
                list.setSelectedIndex( matchIndex );
199
                Rectangle rect = list.getCellBounds(matchIndex, matchIndex);
200
                if( null != rect )
201
                    list.scrollRectToVisible( rect );
202
            } else {
203
                list.clearSelection();
204
                list.scrollRectToVisible( new Rectangle( 1, 1 ) );
91
            }
205
            }
92
        });
206
        } finally {
93
207
            ignoreSelectionEvents = false;
208
        }
94
    }
209
    }
95
210
96
    @Override
211
    private int findMatch( String editorText ) {
97
    protected void fireActionEvent() {
212
        if( null == editorText || editorText.isEmpty() )
98
        LOGGER.log(Level.FINE, "fireActionEvent()", new Exception());
213
            return -1;
99
        LOGGER.log(Level.FINE, "popup opened: {0}", isPopupVisible());
214
        
100
            
215
        for( int i=0; i<getItemCount(); i++ ) {
101
        //On the contrary to the ActionEvent not being fired upon entering the value,
216
            String item = getItemAt( i ).toString();
102
        //each keystroke causes an ActionEvent to be fired!!!
217
            if( item.toLowerCase().compareTo( editorText ) == 0 ) {
103
        //So filter out such action events and fire the action event only when the popup is closed
218
                return i;
104
        //and it has not been cancelled.
219
            }
220
        }
221
222
        for( int i=0; i<getItemCount(); i++ ) {
223
            String item = getItemAt( i ).toString();
224
            if( item.toLowerCase().startsWith( editorText ) ) {
225
                return i;
226
            }
227
        }
228
        return -1;
105
    }
229
    }
106
230
107
    private void superFireActionEvent() {
231
    private JList getPopupList() {
108
        //really fire the action event once the edited value is confirmed
232
        Accessible a = getUI().getAccessibleChild(this, 0);
109
        super.fireActionEvent();
233
234
        if( a instanceof ComboPopup ) {
235
            return ((ComboPopup) a).getList();
236
        }
237
        return null;
110
    }
238
    }
239
}
240
    
111
241
112
}
(-)a/css.visual/src/org/netbeans/modules/css/visual/RuleEditorNode.java (-8 / +222 lines)
Lines 41-53 Link Here
41
 */
41
 */
42
package org.netbeans.modules.css.visual;
42
package org.netbeans.modules.css.visual;
43
43
44
import java.awt.Component;
45
import java.awt.event.ActionEvent;
46
import java.awt.event.ActionListener;
44
import java.beans.PropertyEditor;
47
import java.beans.PropertyEditor;
48
import java.beans.PropertyEditorSupport;
45
import java.io.IOException;
49
import java.io.IOException;
46
import java.lang.reflect.InvocationTargetException;
50
import java.lang.reflect.InvocationTargetException;
47
import java.util.ArrayList;
51
import java.util.ArrayList;
48
import java.util.Collection;
52
import java.util.Collection;
49
import java.util.Collections;
53
import java.util.Collections;
50
import java.util.EnumMap;
54
import java.util.EnumMap;
55
import java.util.EventObject;
51
import java.util.HashMap;
56
import java.util.HashMap;
52
import java.util.HashSet;
57
import java.util.HashSet;
53
import java.util.LinkedList;
58
import java.util.LinkedList;
Lines 55-61 Link Here
55
import java.util.Map;
60
import java.util.Map;
56
import java.util.Map.Entry;
61
import java.util.Map.Entry;
57
import java.util.logging.Level;
62
import java.util.logging.Level;
63
import javax.swing.DefaultCellEditor;
64
import javax.swing.JComboBox;
65
import javax.swing.JLabel;
66
import javax.swing.JTable;
58
import javax.swing.SwingUtilities;
67
import javax.swing.SwingUtilities;
68
import javax.swing.event.CellEditorListener;
69
import javax.swing.event.ChangeEvent;
70
import javax.swing.table.TableCellRenderer;
59
import javax.swing.text.BadLocationException;
71
import javax.swing.text.BadLocationException;
60
import javax.swing.text.Document;
72
import javax.swing.text.Document;
61
import org.netbeans.editor.BaseDocument;
73
import org.netbeans.editor.BaseDocument;
Lines 75-80 Link Here
75
import org.netbeans.modules.css.visual.editors.PropertyValuesEditor;
87
import org.netbeans.modules.css.visual.editors.PropertyValuesEditor;
76
import org.netbeans.modules.parsing.api.Snapshot;
88
import org.netbeans.modules.parsing.api.Snapshot;
77
import org.netbeans.modules.web.common.api.LexerUtils;
89
import org.netbeans.modules.web.common.api.LexerUtils;
90
import org.openide.explorer.propertysheet.ExPropertyEditor;
91
import org.openide.explorer.propertysheet.PropertyEnv;
78
import org.openide.filesystems.FileObject;
92
import org.openide.filesystems.FileObject;
79
import org.openide.nodes.AbstractNode;
93
import org.openide.nodes.AbstractNode;
80
import org.openide.nodes.Children;
94
import org.openide.nodes.Children;
Lines 122-128 Link Here
122
    public FileObject getFileObject() {
136
    public FileObject getFileObject() {
123
        return getModel().getLookup().lookup(FileObject.class);
137
        return getModel().getLookup().lookup(FileObject.class);
124
    }
138
    }
125
    
139
126
    public Rule getRule() {
140
    public Rule getRule() {
127
        return panel.getRule();
141
        return panel.getRule();
128
    }
142
    }
Lines 442-447 Link Here
442
                    }
456
                    }
443
                }
457
                }
444
458
459
            } else {
460
                //do NOT show all properties
461
                //Add the fake "Add Property" FeatureDescriptor at the end of the set
462
                set.add_Add_Property_FeatureDescriptor();
445
            }
463
            }
446
        }
464
        }
447
465
Lines 450-469 Link Here
450
        return sets.toArray(new PropertyCategoryPropertySet[0]);
468
        return sets.toArray(new PropertyCategoryPropertySet[0]);
451
    }
469
    }
452
470
453
     /**
471
    /**
454
     * Returns a list of *visible* properties with this category.
472
     * Returns a list of *visible* properties with this category.
455
     */
473
     */
456
    public List<PropertyDefinition> getCategoryProperties(PropertyCategory cat) {
474
    public List<PropertyDefinition> getCategoryProperties(PropertyCategory cat) {
457
        Collection<PropertyDefinition> defs = Properties.getPropertyDefinitions(getModel().getLookup().lookup(FileObject.class), true);
475
        Collection<PropertyDefinition> defs = Properties.getPropertyDefinitions(getModel().getLookup().lookup(FileObject.class), true);
458
        List<PropertyDefinition> defsInCat = new ArrayList<PropertyDefinition>();
476
        List<PropertyDefinition> defsInCat = new ArrayList<PropertyDefinition>();
459
        for(PropertyDefinition d : defs) {
477
        for (PropertyDefinition d : defs) {
460
            if(d.getPropertyCategory() == cat) {
478
            if (d.getPropertyCategory() == cat) {
461
                defsInCat.add(d);
479
                defsInCat.add(d);
462
            }
480
            }
463
        }
481
        }
464
        return defsInCat;
482
        return defsInCat;
465
    }
483
    }
466
    
484
467
    /**
485
    /**
468
     * Returns an unique id of the property within current rule.
486
     * Returns an unique id of the property within current rule.
469
     *
487
     *
Lines 543-548 Link Here
543
                    propertyCategory.getShortDescription());
561
                    propertyCategory.getShortDescription());
544
        }
562
        }
545
563
564
        public void add_Add_Property_FeatureDescriptor() {
565
            properties.add(create_Add_Property_Feature_Descriptor());
566
        }
567
546
        public void add(Declaration declaration, boolean markAsModified) {
568
        public void add(Declaration declaration, boolean markAsModified) {
547
            DeclarationProperty property = createDeclarationProperty(declaration, markAsModified);
569
            DeclarationProperty property = createDeclarationProperty(declaration, markAsModified);
548
            declaration2PropertyMap.put(declaration, property);
570
            declaration2PropertyMap.put(declaration, property);
Lines 581-588 Link Here
581
    private PropertyValuesEditor createPropertyValueEditor(FileObject context, PropertyDefinition pmodel, boolean addNoneProperty) {
603
    private PropertyValuesEditor createPropertyValueEditor(FileObject context, PropertyDefinition pmodel, boolean addNoneProperty) {
582
        final Collection<UnitGrammarElement> unitElements = new ArrayList<UnitGrammarElement>();
604
        final Collection<UnitGrammarElement> unitElements = new ArrayList<UnitGrammarElement>();
583
        final Collection<FixedTextGrammarElement> fixedElements = new ArrayList<FixedTextGrammarElement>();
605
        final Collection<FixedTextGrammarElement> fixedElements = new ArrayList<FixedTextGrammarElement>();
584
        
606
585
        if(pmodel != null) {
607
        if (pmodel != null) {
586
            GroupGrammarElement rootElement = pmodel.getGrammarElement(context);
608
            GroupGrammarElement rootElement = pmodel.getGrammarElement(context);
587
609
588
            rootElement.accept(new GrammarElementVisitor() {
610
            rootElement.accept(new GrammarElementVisitor() {
Lines 843-849 Link Here
843
            String oldValue = getValue();
865
            String oldValue = getValue();
844
            this.declaration = declaration;
866
            this.declaration = declaration;
845
            String newValue = getValue();
867
            String newValue = getValue();
846
            
868
847
            locationPrefix = null; //reset the prefix as it was computed for the original declaration
869
            locationPrefix = null; //reset the prefix as it was computed for the original declaration
848
870
849
            /* Reset DeclarationInfo to default state (null) as the contract 
871
            /* Reset DeclarationInfo to default state (null) as the contract 
Lines 1047-1052 Link Here
1047
        });
1069
        });
1048
    }
1070
    }
1049
1071
1072
    private Property create_Add_Property_Feature_Descriptor() {
1073
        return ADD_PROPERTY_FD;
1074
    }
1075
    
1076
    private Property ADD_PROPERTY_FD = new AddPropertyFD();
1077
1078
    private class AddPropertyFD extends Property<String> {
1079
1080
        public AddPropertyFD() {
1081
            super(String.class);
1082
            setName(AddPropertyFD.class.getSimpleName());
1083
//            setDisplayName("Add Property");
1084
        }
1085
1086
        @Override
1087
        public PropertyEditor getPropertyEditor() {
1088
            return new AddPropertyPropertyEditor(this);
1089
        }
1090
1091
        @Override
1092
        public boolean canRead() {
1093
            return true;
1094
        }
1095
1096
        @Override
1097
        public String getValue() throws IllegalAccessException, InvocationTargetException {
1098
            return "";
1099
        }
1100
1101
        @Override
1102
        public boolean canWrite() {
1103
            return true;
1104
        }
1105
1106
        //called from AddPropertyPropertyEditor when a value is entered
1107
        @Override
1108
        public void setValue(final String propertyName) {
1109
            System.out.println("AddProperty - setValue(" + propertyName + ")");
1110
            if (propertyName == null) {
1111
                return;
1112
            }
1113
1114
            //1.create the property
1115
            //2.select the corresponding row in the PS
1116
            
1117
            final Model model = getModel();
1118
            final Rule rule = getRule();
1119
            model.runWriteTask(new Model.ModelTask() {
1120
                @Override
1121
                public void run(StyleSheet styleSheet) {
1122
                    //add the new declaration to the model.
1123
                    //the declaration is not complete - the value is missing and it is necessary to 
1124
                    //enter in the PS otherwise the model become invalid.
1125
                    ModelUtils utils = new ModelUtils(model);
1126
                    Declarations decls = rule.getDeclarations();
1127
                    if (decls == null) {
1128
                        decls = model.getElementFactory().createDeclarations();
1129
                        rule.setDeclarations(decls);
1130
                    }
1131
1132
                    Declaration declaration = utils.createDeclaration(propertyName + ":");
1133
                    decls.addDeclaration(declaration);
1134
1135
                    //do not save the model (apply changes) - once the write task finishes
1136
                    //the embedded property sheet will be refreshed from the modified model.
1137
1138
                    //remember the created declaration so once the model change is fired
1139
                    //and the property sheet is refreshed, we can find and select the corresponding
1140
                    //FeatureDescriptor
1141
                    panel.createdDeclaration = declaration;
1142
                }
1143
            });
1144
        }
1145
    }
1146
1147
    private class AddPropertyPropertyEditor extends PropertyEditorSupport implements ExPropertyEditor {
1148
1149
        private AddPropertyFD property;
1150
1151
        public AddPropertyPropertyEditor(AddPropertyFD property) {
1152
            this.property = property;
1153
        }
1154
1155
        @Override
1156
        public void attachEnv(PropertyEnv env) {
1157
            env.getFeatureDescriptor().setValue("custom.cell.renderer", 
1158
                    new AddPropertyCellRendererComponent()); //NOI18N
1159
            
1160
            env.getFeatureDescriptor().setValue("custom.cell.editor", 
1161
                    new AddPropertyCellEditorComponent(panel.createAddPropertyCB(), property)); //NOI18N
1162
        }
1163
    }
1164
1165
    private class AddPropertyCellRendererComponent implements TableCellRenderer {
1166
1167
        @Override
1168
        public Component getTableCellRendererComponent(JTable jtable, Object o, boolean bln, boolean bln1, int i, int i1) {
1169
            return new JLabel("<html><body><b>Add Property</b></body></html>");
1170
        }
1171
    }
1172
1173
    private class AddPropertyCellEditorComponent extends DefaultCellEditor {
1174
1175
        private AutocompleteJComboBox editor;
1176
        private AddPropertyFD property;
1177
        private List<CellEditorListener> listeners = new ArrayList<CellEditorListener>();
1178
1179
        public AddPropertyCellEditorComponent(AutocompleteJComboBox jcb, AddPropertyFD addFDProperty) {
1180
            super(jcb);
1181
            this.property = addFDProperty;
1182
            this.editor = jcb;
1183
            this.editor.addActionListener(new ActionListener() {
1184
                @Override
1185
                public void actionPerformed(ActionEvent ae) {
1186
                    property.setValue(editor.getSelectedPropertyName());
1187
//                    stopCellEditing();
1188
                }
1189
            });
1190
            
1191
        }
1192
1193
        
1194
        
1195
//        public AddPropertyCellEditorComponent(AddPropertyFD addFDProperty) {
1196
//            
1197
//            this.property = addFDProperty;
1198
//            this.editor = panel.createAddPropertyCB();
1199
//            this.editor.addActionListener(new ActionListener() {
1200
//                @Override
1201
//                public void actionPerformed(ActionEvent ae) {
1202
//                    property.setValue(editor.getSelectedPropertyName());
1203
//                    stopCellEditing();
1204
//                }
1205
//            });
1206
//        }
1207
//
1208
        @Override
1209
        public Component getTableCellEditorComponent(JTable jtable, Object o, boolean bln, int i, int i1) {
1210
            return editor;
1211
        }
1212
//
1213
//        @Override
1214
//        public Object getCellEditorValue() {
1215
//            return "";
1216
//        }
1217
//
1218
//        @Override
1219
//        public boolean isCellEditable(EventObject eo) {
1220
//            return true;
1221
//        }
1222
//
1223
//        @Override
1224
//        public boolean shouldSelectCell(EventObject eo) {
1225
//            return false;
1226
//        }
1227
//
1228
//        @Override
1229
//        public boolean stopCellEditing() {
1230
//            fireEditingStopped();
1231
//            return true;
1232
//        }
1233
//
1234
//        @Override
1235
//        public void cancelCellEditing() {
1236
//            fireEditingCancelled();
1237
//        }
1238
//
1239
//        @Override
1240
//        public void addCellEditorListener(CellEditorListener cl) {
1241
//            listeners.add(cl);
1242
//        }
1243
//
1244
//        @Override
1245
//        public void removeCellEditorListener(CellEditorListener cl) {
1246
//            listeners.remove(cl);
1247
//        }
1248
//
1249
//        private void fireEditingStopped() {
1250
//            List<CellEditorListener> ls = new ArrayList<CellEditorListener>(listeners);
1251
//            for (CellEditorListener l : ls) {
1252
//                l.editingStopped(new ChangeEvent(this));
1253
//            }
1254
//        }
1255
//
1256
//        private void fireEditingCancelled() {
1257
//            List<CellEditorListener> ls = new ArrayList<CellEditorListener>(listeners);
1258
//            for (CellEditorListener l : ls) {
1259
//                l.editingCanceled(new ChangeEvent(this));
1260
//            }
1261
//        }
1262
    }
1263
1050
    /**
1264
    /**
1051
     * Empty children keys
1265
     * Empty children keys
1052
     */
1266
     */
(-)a/css.visual/src/org/netbeans/modules/css/visual/RuleEditorPanel.form (-17 lines)
Lines 152-174 Link Here
152
            </Constraint>
152
            </Constraint>
153
          </Constraints>
153
          </Constraints>
154
        </Component>
154
        </Component>
155
        <Component class="javax.swing.JComboBox" name="addPropertyCB">
156
          <Properties>
157
            <Property name="editable" type="boolean" value="true"/>
158
            <Property name="enabled" type="boolean" value="false"/>
159
            <Property name="renderer" type="javax.swing.ListCellRenderer" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
160
              <Connection code="new AddPropertyCBRendeder()" type="code"/>
161
            </Property>
162
          </Properties>
163
          <AuxValues>
164
            <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new AutocompleteJComboBox(ADD_PROPERTY_CB_MODEL, new AddPropertyCBObjectToStringConverter())"/>
165
          </AuxValues>
166
          <Constraints>
167
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
168
              <BorderConstraints direction="Center"/>
169
            </Constraint>
170
          </Constraints>
171
        </Component>
172
      </SubComponents>
155
      </SubComponents>
173
    </Container>
156
    </Container>
174
  </SubComponents>
157
  </SubComponents>
(-)a/css.visual/src/org/netbeans/modules/css/visual/RuleEditorPanel.java (-139 / +137 lines)
Lines 66-71 Link Here
66
import javax.swing.DefaultListCellRenderer;
66
import javax.swing.DefaultListCellRenderer;
67
import javax.swing.Icon;
67
import javax.swing.Icon;
68
import javax.swing.ImageIcon;
68
import javax.swing.ImageIcon;
69
import javax.swing.JComboBox;
69
import javax.swing.JLabel;
70
import javax.swing.JLabel;
70
import javax.swing.JList;
71
import javax.swing.JList;
71
import javax.swing.JPanel;
72
import javax.swing.JPanel;
Lines 183-189 Link Here
183
   
184
   
184
    Declaration createdDeclaration;
185
    Declaration createdDeclaration;
185
    
186
    
186
    private AddPropertyComboBoxModel ADD_PROPERTY_CB_MODEL = new AddPropertyComboBoxModel();
187
//    private AddPropertyComboBoxModel ADD_PROPERTY_CB_MODEL = new AddPropertyComboBoxModel();
187
    private PropertyChangeListener MODEL_LISTENER = new PropertyChangeListener() {
188
    private PropertyChangeListener MODEL_LISTENER = new PropertyChangeListener() {
188
        @Override
189
        @Override
189
        public void propertyChange(final PropertyChangeEvent evt) {
190
        public void propertyChange(final PropertyChangeEvent evt) {
Lines 237-250 Link Here
237
        }
238
        }
238
    };
239
    };
239
240
240
    private final ActionListener addPropertyCBActionListener = new ActionListener() {
241
//    private final ActionListener addPropertyCBActionListener = new ActionListener() {
241
242
//
242
        @Override
243
//        @Override
243
        public void actionPerformed(ActionEvent e) {
244
//        public void actionPerformed(ActionEvent e) {
244
            addPropertyCBValueEntered();
245
//            addPropertyCBValueEntered();
245
        }
246
//        }
246
    };
247
//    };
247
    
248
//    
248
    public RuleEditorPanel() {
249
    public RuleEditorPanel() {
249
        this(false);
250
        this(false);
250
    }
251
    }
Lines 325-349 Link Here
325
326
326
        //init the add property combo box
327
        //init the add property combo box
327
 
328
 
328
        addPropertyCB.getEditor().getEditorComponent().addFocusListener(new FocusListener() {
329
//        addPropertyCB.getEditor().getEditorComponent().addFocusListener(new FocusListener() {
329
            @Override
330
//            @Override
330
            public void focusGained(FocusEvent e) {
331
//            public void focusGained(FocusEvent e) {
331
                ADD_PROPERTY_CB_MODEL.removeInitialText();
332
//                ADD_PROPERTY_CB_MODEL.removeInitialText();
332
                
333
//                
333
                //add the ActionListener after the model change (removed initial text) 
334
//                //add the ActionListener after the model change (removed initial text) 
334
                //as it fires an action event
335
//                //as it fires an action event
335
                addPropertyCB.addActionListener(addPropertyCBActionListener);
336
//                addPropertyCB.addActionListener(addPropertyCBActionListener);
336
            }
337
//            }
337
338
//
338
            @Override
339
//            @Override
339
            public void focusLost(FocusEvent e) {
340
//            public void focusLost(FocusEvent e) {
340
                ADD_PROPERTY_CB_MODEL.addInitialText();
341
//                ADD_PROPERTY_CB_MODEL.addInitialText();
341
                
342
//                
342
                //add the ActionListener after the model change (added initial text) 
343
//                //add the ActionListener after the model change (added initial text) 
343
                //as it fires an action event
344
//                //as it fires an action event
344
                addPropertyCB.removeActionListener(addPropertyCBActionListener);
345
//                addPropertyCB.removeActionListener(addPropertyCBActionListener);
345
            }
346
//            }
346
        });
347
//        });
347
348
348
349
349
        if (!addPropertyMode) {
350
        if (!addPropertyMode) {
Lines 352-358 Link Here
352
        }
353
        }
353
354
354
        addPropertyButton.setVisible(!addPropertyMode);
355
        addPropertyButton.setVisible(!addPropertyMode);
355
        addPropertyCB.setVisible(!addPropertyMode);
356
//        addPropertyCB.setVisible(!addPropertyMode);
356
357
357
        titleLabel.setText(null);
358
        titleLabel.setText(null);
358
359
Lines 403-465 Link Here
403
        });
404
        });
404
        
405
        
405
    }
406
    }
407
    
408
    AutocompleteJComboBox createAddPropertyCB() {
409
        AutocompleteJComboBox ajcb = new AutocompleteJComboBox(new AddPropertyComboBoxModel(), new AddPropertyCBObjectToStringConverter());
410
        ajcb.setRenderer(new AddPropertyCBRendeder());
411
        return ajcb;
412
    }
406
413
407
    private void addPropertyCBValueEntered() {
414
//    private void addPropertyCBValueEntered() {
408
        Object selected = ADD_PROPERTY_CB_MODEL.getSelectedItem();
415
//        Object selected = ADD_PROPERTY_CB_MODEL.getSelectedItem();
409
        if (selected == null) {
416
//        if (selected == null) {
410
            return;
417
//            return;
411
        }
418
//        }
412
419
//
413
        final String propertyName;
420
//        final String propertyName;
414
        if (selected instanceof PropertyDefinition) {
421
//        if (selected instanceof PropertyDefinition) {
415
            PropertyDefinition pd = (PropertyDefinition) selected;
422
//            PropertyDefinition pd = (PropertyDefinition) selected;
416
            propertyName = pd.getName();
423
//            propertyName = pd.getName();
417
        } else if (selected instanceof String) {
424
//        } else if (selected instanceof String) {
418
            String val = (String) selected;
425
//            String val = (String) selected;
419
            if (!val.trim().isEmpty()) {
426
//            if (!val.trim().isEmpty()) {
420
                propertyName = val;
427
//                propertyName = val;
421
            } else {
428
//            } else {
422
                propertyName = null;
429
//                propertyName = null;
423
            }
430
//            }
424
        } else {
431
//        } else {
425
            propertyName = null;
432
//            propertyName = null;
426
        }
433
//        }
427
434
//
428
        if (propertyName != null) {
435
//        if (propertyName != null) {
429
            //1.verify whether there's such property
436
//            //1.verify whether there's such property
430
            if(Properties.getPropertyDefinition(model.getLookup().lookup(FileObject.class), propertyName) != null) {
437
//            if(Properties.getPropertyDefinition(model.getLookup().lookup(FileObject.class), propertyName) != null) {
431
                //2.create the property
438
//                //2.create the property
432
                //3.select the corresponding row in the PS
439
//                //3.select the corresponding row in the PS
433
440
//
434
                model.runWriteTask(new Model.ModelTask() {
441
//                model.runWriteTask(new Model.ModelTask() {
435
                    @Override
442
//                    @Override
436
                    public void run(StyleSheet styleSheet) {
443
//                    public void run(StyleSheet styleSheet) {
437
                        //add the new declaration to the model.
444
//                        //add the new declaration to the model.
438
                        //the declaration is not complete - the value is missing and it is necessary to 
445
//                        //the declaration is not complete - the value is missing and it is necessary to 
439
                        //enter in the PS otherwise the model become invalid.
446
//                        //enter in the PS otherwise the model become invalid.
440
                        ModelUtils utils = new ModelUtils(model);
447
//                        ModelUtils utils = new ModelUtils(model);
441
                        Declarations decls = rule.getDeclarations();
448
//                        Declarations decls = rule.getDeclarations();
442
                        if (decls == null) {
449
//                        if (decls == null) {
443
                            decls = model.getElementFactory().createDeclarations();
450
//                            decls = model.getElementFactory().createDeclarations();
444
                            rule.setDeclarations(decls);
451
//                            rule.setDeclarations(decls);
445
                        }
452
//                        }
446
453
//
447
                        Declaration declaration = utils.createDeclaration(propertyName + ":");
454
//                        Declaration declaration = utils.createDeclaration(propertyName + ":");
448
                        decls.addDeclaration(declaration);
455
//                        decls.addDeclaration(declaration);
449
456
//
450
                        //do not save the model (apply changes) - once the write task finishes
457
//                        //do not save the model (apply changes) - once the write task finishes
451
                        //the embedded property sheet will be refreshed from the modified model.
458
//                        //the embedded property sheet will be refreshed from the modified model.
452
459
//
453
                        //remember the created declaration so once the model change is fired
460
//                        //remember the created declaration so once the model change is fired
454
                        //and the property sheet is refreshed, we can find and select the corresponding
461
//                        //and the property sheet is refreshed, we can find and select the corresponding
455
                        //FeatureDescriptor
462
//                        //FeatureDescriptor
456
                        createdDeclaration = declaration;
463
//                        createdDeclaration = declaration;
457
                    }
464
//                    }
458
                });
465
//                });
459
            }
466
//            }
460
467
//
461
        }
468
//        }
462
    }
469
//    }
463
    
470
    
464
    public FeatureDescriptor getSelected() {
471
    public FeatureDescriptor getSelected() {
465
        return sheet.getSelectedFeatureDescriptor();
472
        return sheet.getSelectedFeatureDescriptor();
Lines 662-668 Link Here
662
                ? Collections.<Declaration>emptyList() 
669
                ? Collections.<Declaration>emptyList() 
663
                : decls.getDeclarations();
670
                : decls.getDeclarations();
664
                        
671
                        
665
        ADD_PROPERTY_CB_MODEL.setExistingProperties(declarations);
672
//        ADD_PROPERTY_CB_MODEL.setExistingProperties(declarations);
666
673
667
        CHANGE_SUPPORT.firePropertyChange(RuleEditorController.PropertyNames.RULE_SET.name(), old, this.rule);
674
        CHANGE_SUPPORT.firePropertyChange(RuleEditorController.PropertyNames.RULE_SET.name(), old, this.rule);
668
675
Lines 670-680 Link Here
670
        if (!rule.isValid()) {
677
        if (!rule.isValid()) {
671
            northWestPanel.add(ERROR_LABEL);
678
            northWestPanel.add(ERROR_LABEL);
672
            addPropertyButton.setEnabled(false);
679
            addPropertyButton.setEnabled(false);
673
            addPropertyCB.setEnabled(false);
680
//            addPropertyCB.setEnabled(false);
674
        } else {
681
        } else {
675
            northWestPanel.remove(ERROR_LABEL);
682
            northWestPanel.remove(ERROR_LABEL);
676
            addPropertyButton.setEnabled(true);
683
            addPropertyButton.setEnabled(true);
677
            addPropertyCB.setEnabled(true);
684
//            addPropertyCB.setEnabled(true);
678
        }
685
        }
679
        northWestPanel.revalidate();
686
        northWestPanel.revalidate();
680
687
Lines 708-714 Link Here
708
        titleLabel.setEnabled(false);
715
        titleLabel.setEnabled(false);
709
        
716
        
710
        addPropertyButton.setEnabled(false);
717
        addPropertyButton.setEnabled(false);
711
        addPropertyCB.setEnabled(false);
718
//        addPropertyCB.setEnabled(false);
712
        node.fireContextChanged(false);
719
        node.fireContextChanged(false);
713
    }
720
    }
714
721
Lines 757-763 Link Here
757
        titleLabel = new javax.swing.JLabel();
764
        titleLabel = new javax.swing.JLabel();
758
        southPanel = new javax.swing.JPanel();
765
        southPanel = new javax.swing.JPanel();
759
        addPropertyButton = new javax.swing.JButton();
766
        addPropertyButton = new javax.swing.JButton();
760
        addPropertyCB = new AutocompleteJComboBox(ADD_PROPERTY_CB_MODEL, new AddPropertyCBObjectToStringConverter());
761
767
762
        menuLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/netbeans/modules/css/visual/resources/menu.png"))); // NOI18N
768
        menuLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/netbeans/modules/css/visual/resources/menu.png"))); // NOI18N
763
        menuLabel.setText(org.openide.util.NbBundle.getMessage(RuleEditorPanel.class, "RuleEditorPanel.menuLabel.text")); // NOI18N
769
        menuLabel.setText(org.openide.util.NbBundle.getMessage(RuleEditorPanel.class, "RuleEditorPanel.menuLabel.text")); // NOI18N
Lines 810-820 Link Here
810
        addPropertyButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
816
        addPropertyButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
811
        southPanel.add(addPropertyButton, java.awt.BorderLayout.LINE_END);
817
        southPanel.add(addPropertyButton, java.awt.BorderLayout.LINE_END);
812
818
813
        addPropertyCB.setEditable(true);
814
        addPropertyCB.setEnabled(false);
815
        addPropertyCB.setRenderer(new AddPropertyCBRendeder());
816
        southPanel.add(addPropertyCB, java.awt.BorderLayout.CENTER);
817
818
        add(southPanel, java.awt.BorderLayout.SOUTH);
819
        add(southPanel, java.awt.BorderLayout.SOUTH);
819
    }// </editor-fold>//GEN-END:initComponents
820
    }// </editor-fold>//GEN-END:initComponents
820
821
Lines 829-835 Link Here
829
830
830
    // Variables declaration - do not modify//GEN-BEGIN:variables
831
    // Variables declaration - do not modify//GEN-BEGIN:variables
831
    private javax.swing.JButton addPropertyButton;
832
    private javax.swing.JButton addPropertyButton;
832
    private javax.swing.JComboBox addPropertyCB;
833
    private javax.swing.JLabel cancelFilterLabel;
833
    private javax.swing.JLabel cancelFilterLabel;
834
    private javax.swing.JTextField filterTextField;
834
    private javax.swing.JTextField filterTextField;
835
    private javax.swing.JLabel menuLabel;
835
    private javax.swing.JLabel menuLabel;
Lines 844-897 Link Here
844
844
845
    private class AddPropertyComboBoxModel extends DefaultComboBoxModel {
845
    private class AddPropertyComboBoxModel extends DefaultComboBoxModel {
846
846
847
        private boolean containsInitialText;
847
//        private boolean containsInitialText;
848
848
849
        public AddPropertyComboBoxModel() {
849
        public AddPropertyComboBoxModel() {
850
            addInitialText();
850
//            addInitialText();
851
        }
851
            for(PropertyDefinition prop : Properties.getPropertyDefinitions(getModel().getLookup().lookup(FileObject.class), true)) {
852
852
                addElement(prop.getName());
853
        private Collection<PropertyDefinition> getProperties() {
854
            Collection<PropertyDefinition> properties = new TreeSet<PropertyDefinition>(PropertyUtils.PROPERTY_DEFINITIONS_COMPARATOR);
855
            properties.addAll(Properties.getPropertyDefinitions(getModel().getLookup().lookup(FileObject.class)));
856
            return properties;
857
        }
858
859
        private void addInitialText() {
860
            if (!containsInitialText) {
861
                insertElementAt(INITIAL_TEXT_OBJECT, 0);
862
                setSelectedItem(INITIAL_TEXT_OBJECT);
863
                containsInitialText = true;
864
            }
853
            }
865
        }
854
        }
866
855
867
        private void removeInitialText() {
856
//        private void addInitialText() {
868
            if (containsInitialText) {
857
//            if (!containsInitialText) {
869
                removeElement(INITIAL_TEXT_OBJECT);
858
//                insertElementAt(INITIAL_TEXT_OBJECT, 0);
870
                setSelectedItem(null);
859
//                setSelectedItem(INITIAL_TEXT_OBJECT);
871
                containsInitialText = false;
860
//                containsInitialText = true;
872
            }
861
//            }
873
        }
862
//        }
863
//
864
//        private void removeInitialText() {
865
//            if (containsInitialText) {
866
//                removeElement(INITIAL_TEXT_OBJECT);
867
//                setSelectedItem(null);
868
//                containsInitialText = false;
869
//            }
870
//        }
874
        
871
        
875
        private void setExistingProperties(Collection<Declaration> existing) {
872
        private void setExistingProperties(Collection<Declaration> existing) {
876
            removeInitialText();
873
//            removeInitialText();
877
            removeAllElements();
874
//            removeAllElements();
878
            
875
//            
879
            addInitialText();
876
//            addInitialText();
880
            
877
//            
881
            FileObject file = model.getLookup().lookup(FileObject.class);
878
//            FileObject file = model.getLookup().lookup(FileObject.class);
882
            Collection<PropertyDefinition> existingDefs = new ArrayList<PropertyDefinition>();
879
//            Collection<PropertyDefinition> existingDefs = new ArrayList<PropertyDefinition>();
883
            for(Declaration d : existing) {
880
//            for(Declaration d : existing) {
884
                PropertyDefinition definition = Properties.getPropertyDefinition(file, d.getProperty().getContent().toString());
881
//                PropertyDefinition definition = Properties.getPropertyDefinition(file, d.getProperty().getContent().toString());
885
                if(definition != null) {
882
//                if(definition != null) {
886
                    existingDefs.add(definition);
883
//                    existingDefs.add(definition);
887
                }
884
//                }
888
            }
885
//            }
889
            
886
//            
890
            for(PropertyDefinition prop : getProperties()) {
887
//            for(PropertyDefinition prop : getProperties()) {
891
                if(!existingDefs.contains(prop)) {
888
//                if(!existingDefs.contains(prop)) {
892
                    addElement(prop);
889
//                    addElement(prop);
893
                }
890
//                }
894
            }
891
//            }
895
        }
892
        }
896
        
893
        
897
        
894
        
Lines 906-913 Link Here
906
                if (value == INITIAL_TEXT_OBJECT) {
903
                if (value == INITIAL_TEXT_OBJECT) {
907
                    setText(ADD_PROPERTY_CB_TEXT);
904
                    setText(ADD_PROPERTY_CB_TEXT);
908
                } else {
905
                } else {
909
                    PropertyDefinition pd = (PropertyDefinition) value;
906
                    setText(value.toString());
910
                    setText(pd.getName());
907
//                    PropertyDefinition pd = (PropertyDefinition) value;
908
//                    setText(pd.getName());
911
                }
909
                }
912
            }
910
            }
913
            return c;
911
            return c;
(-)a/openide.explorer/src/org/openide/explorer/propertysheet/CleanComboUI.java (-3 / +5 lines)
Lines 371-379 Link Here
371
371
372
        @Override
372
        @Override
373
        protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
373
        protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
374
            if( comboBox instanceof ComboInplaceEditor ) {
374
//            if( comboBox instanceof ComboInplaceEditor ) {
375
                ComboInplaceEditor inPlaceCombo = ( ComboInplaceEditor ) comboBox;
375
            if( true ) {
376
                if( inPlaceCombo.isAutoComplete )
376
//                ComboInplaceEditor inPlaceCombo = ( ComboInplaceEditor ) comboBox;
377
//                if( inPlaceCombo.isAutoComplete )
378
                if( true )
377
                    return super.computePopupBounds( px, py, pw, ph );
379
                    return super.computePopupBounds( px, py, pw, ph );
378
            }
380
            }
379
            Dimension d = list.getPreferredSize();
381
            Dimension d = list.getPreferredSize();
(-)a/openide.explorer/src/org/openide/explorer/propertysheet/ComboInplaceEditor.java (-6 / +6 lines)
Lines 518-529 Link Here
518
        return (c == getEditor().getEditorComponent());
518
        return (c == getEditor().getEditorComponent());
519
    }
519
    }
520
520
521
    @Override
521
        @Override
522
    public void setValue(Object o) {
522
        public void setValue(Object o) {
523
        ignoreSelectionEvents = true;
523
            ignoreSelectionEvents = true;
524
        setSelectedItem(o);
524
            setSelectedItem(o);
525
        ignoreSelectionEvents = false;
525
            ignoreSelectionEvents = false;
526
    }
526
        }
527
527
528
    /** Returns true if the combo box is editable */
528
    /** Returns true if the combo box is editable */
529
    @Override
529
    @Override
(-)a/openide.explorer/src/org/openide/explorer/propertysheet/SheetTable.java (-1 / +52 lines)
Lines 81-88 Link Here
81
import javax.swing.Action;
81
import javax.swing.Action;
82
import javax.swing.ActionMap;
82
import javax.swing.ActionMap;
83
import javax.swing.BorderFactory;
83
import javax.swing.BorderFactory;
84
import javax.swing.DefaultCellEditor;
84
import javax.swing.DefaultListSelectionModel;
85
import javax.swing.DefaultListSelectionModel;
85
import javax.swing.InputMap;
86
import javax.swing.InputMap;
87
import javax.swing.JComboBox;
86
import javax.swing.JComponent;
88
import javax.swing.JComponent;
87
import javax.swing.JDialog;
89
import javax.swing.JDialog;
88
import javax.swing.JFrame;
90
import javax.swing.JFrame;
Lines 280-285 Link Here
280
        return sheetCellEditor;
282
        return sheetCellEditor;
281
    }
283
    }
282
284
285
    private TableCellRenderer getCustomRenderer( int row ) {
286
        FeatureDescriptor fd = getPropertySetModel().getFeatureDescriptor(row);
287
288
        if (fd instanceof PropertySet)
289
            return null;
290
291
        Object res = fd.getValue( "custom.cell.renderer");
292
        if( res instanceof TableCellRenderer ) {
293
            if( res instanceof DefaultCellEditor ) {
294
                if( ((DefaultCellEditor)res).getComponent() instanceof JComboBox ) {
295
                    ((JComboBox)((DefaultCellEditor)res).getComponent()).setUI( new CleanComboUI( true ) );
296
                }
297
            }
298
            return ( TableCellRenderer ) res;
299
        }
300
        return null;
301
    }
302
303
    private TableCellEditor getCustomEditor( int row ) {
304
        FeatureDescriptor fd = getPropertySetModel().getFeatureDescriptor(row);
305
306
        if (fd instanceof PropertySet)
307
            return null;
308
309
        Object res = fd.getValue( "custom.cell.editor");
310
        if( res instanceof TableCellEditor ) {
311
            if( res instanceof DefaultCellEditor ) {
312
                if( ((DefaultCellEditor)res).getComponent() instanceof JComboBox ) {
313
                    ((JComboBox)((DefaultCellEditor)res).getComponent()).setUI( new CleanComboUI( true ) );
314
                }
315
            }
316
            return ( TableCellEditor ) res;
317
        }
318
        return null;
319
    }
320
283
    /****************Bean getters/setters*****************************************
321
    /****************Bean getters/setters*****************************************
284
322
285
        /** Implement's Rochelle's suggestion of including the display name
323
        /** Implement's Rochelle's suggestion of including the display name
Lines 300-305 Link Here
300
     * of SheetTable */
338
     * of SheetTable */
301
    @Override
339
    @Override
302
    public TableCellEditor getCellEditor(int row, int column) {
340
    public TableCellEditor getCellEditor(int row, int column) {
341
        if( 0 == column ) {
342
            TableCellEditor res = getCustomEditor( row );
343
            if( null != res )
344
                return res;
345
        }
346
303
        return getEditor();
347
        return getEditor();
304
    }
348
    }
305
349
Lines 307-312 Link Here
307
     * of SheetTable */
351
     * of SheetTable */
308
    @Override
352
    @Override
309
    public TableCellRenderer getCellRenderer(int row, int column) {
353
    public TableCellRenderer getCellRenderer(int row, int column) {
354
        if( 0 == column ) {
355
            TableCellRenderer res = getCustomRenderer( row );
356
            if( null != res )
357
                return res;
358
        }
310
        return getRenderer();
359
        return getRenderer();
311
    }
360
    }
312
361
Lines 1157-1163 Link Here
1157
    @Override
1206
    @Override
1158
    public boolean isCellEditable(int row, int column) {
1207
    public boolean isCellEditable(int row, int column) {
1159
        if (column == 0) {
1208
        if (column == 0) {
1160
            return false;
1209
            return null != getCustomEditor( row );
1161
        }
1210
        }
1162
1211
1163
        FeatureDescriptor fd = getPropertySetModel().getFeatureDescriptor(row);
1212
        FeatureDescriptor fd = getPropertySetModel().getFeatureDescriptor(row);
Lines 1300-1305 Link Here
1300
            return null;
1349
            return null;
1301
        }
1350
        }
1302
1351
1352
        if( 1 == col ) {
1303
        //Usually result == ine, but custom impls may not be
1353
        //Usually result == ine, but custom impls may not be
1304
        InplaceEditor ine = getEditor().getInplaceEditor();
1354
        InplaceEditor ine = getEditor().getInplaceEditor();
1305
1355
Lines 1307-1312 Link Here
1307
            result.setBackground(PropUtils.getTextFieldBackground());
1357
            result.setBackground(PropUtils.getTextFieldBackground());
1308
            result.setForeground(PropUtils.getTextFieldForeground());
1358
            result.setForeground(PropUtils.getTextFieldForeground());
1309
        }
1359
        }
1360
        }
1310
1361
1311
        if (result instanceof JComponent) {
1362
        if (result instanceof JComponent) {
1312
            //unlikely that it won't be
1363
            //unlikely that it won't be

Return to bug 220213