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 24366
Collapse All | Expand All

(-)text-edit/src/org/netbeans/modules/xml/text/completion/XMLCompletionQuery.java (+1 lines)
Lines 145-150 Link Here
145
                }
145
                }
146
            } else {
146
            } else {
147
                switch (id) {
147
                switch (id) {
148
                    case XMLDefaultTokenContext.TEXT_ID:
148
                    case XMLDefaultTokenContext.TAG_ID:
149
                    case XMLDefaultTokenContext.TAG_ID:
149
                    case XMLDefaultTokenContext.ARGUMENT_ID:
150
                    case XMLDefaultTokenContext.ARGUMENT_ID:
150
                    case XMLDefaultTokenContext.CHARACTER_ID:
151
                    case XMLDefaultTokenContext.CHARACTER_ID:
(-)text-edit/src/org/netbeans/modules/xml/text/resources/XMLEditor-abbreviations.xml (-1 / +1 lines)
Lines 15-21 Link Here
15
<!DOCTYPE abbrevs PUBLIC "-//NetBeans//DTD Editor Abbreviations settings 1.0//EN"
15
<!DOCTYPE abbrevs PUBLIC "-//NetBeans//DTD Editor Abbreviations settings 1.0//EN"
16
 "http://www.netbeans.org/dtds/EditorAbbreviations-1_0.dtd">
16
 "http://www.netbeans.org/dtds/EditorAbbreviations-1_0.dtd">
17
<abbrevs>
17
<abbrevs>
18
    <abbrev key="?xm">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;</abbrev>
18
    <abbrev key="?xm">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</abbrev>
19
    <abbrev key="!do">&lt;!DOCTYPE </abbrev>
19
    <abbrev key="!do">&lt;!DOCTYPE </abbrev>
20
    <abbrev key="!cd">&lt;![CDATA[|]]&gt;</abbrev>
20
    <abbrev key="!cd">&lt;![CDATA[|]]&gt;</abbrev>
21
21
(-)text-edit/src/org/netbeans/modules/xml/text/syntax/XMLSettingsInitializer.java (-77 / +30 lines)
Lines 94-104 Link Here
94
                    new TokenContext[] { XMLDefaultTokenContext.context }
94
                    new TokenContext[] { XMLDefaultTokenContext.context }
95
            );
95
            );
96
            
96
            
97
            settingsMap.put(SettingsNames.MACRO_MAP, getXMLMacroMap());
98
            
99
            SettingsUtil.updateListSetting(settingsMap, SettingsNames.KEY_BINDING_LIST,
100
                getXMLKeyBindings());
101
102
            settingsMap.put(SettingsNames.IDENTIFIER_ACCEPTOR, getXMLIdentifierAcceptor());            
97
            settingsMap.put(SettingsNames.IDENTIFIER_ACCEPTOR, getXMLIdentifierAcceptor());            
103
        }
98
        }
104
99
Lines 117-205 Link Here
117
    }
112
    }
118
113
119
    Map getXMLAbbrevMap() {
114
    Map getXMLAbbrevMap() {
120
        Map xmlAbbrevMap = getDTDAbbrevMap();
115
        Map xmlAbbrevMap = new TreeMap();
121
        xmlAbbrevMap.put ("?xm", "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); // NOI18N
116
117
        xmlAbbrevMap.put ("?xm", "<?xml version=\"1.0\" encoding=\"UTF-8\">"); // NOI18N
122
        xmlAbbrevMap.put ("!do", "<!DOCTYPE "); // NOI18N
118
        xmlAbbrevMap.put ("!do", "<!DOCTYPE "); // NOI18N
123
        xmlAbbrevMap.put ("!cd", "<![CDATA["); // NOI18N
119
        xmlAbbrevMap.put ("!cd", "<![CDATA[|]]>"); // NOI18N
120
        xmlAbbrevMap.put ("!at", "<!ATTLIST |>"); // NOI18N
121
        xmlAbbrevMap.put ("!el", "<!ELEMENT |>"); // NOI18N
122
        xmlAbbrevMap.put ("!en", "<!ENTITY |>"); // NOI18N
123
        xmlAbbrevMap.put ("pu",  "PUBLIC \"|\""); // NOI18N
124
        xmlAbbrevMap.put ("sy",  "SYSTEM \"|\""); // NOI18N
125
124
        return xmlAbbrevMap;
126
        return xmlAbbrevMap;
125
    }
127
    }
126
128
127
    Map getDTDAbbrevMap() {
129
    Map getDTDAbbrevMap() {
128
        Map dtdAbbrevMap = new TreeMap ();
130
        Map dtdAbbrevMap = new TreeMap();
129
        dtdAbbrevMap.put ("!el", "<!ELEMENT "); // NOI18N
131
130
        dtdAbbrevMap.put ("!en", "<!ENTITY "); // NOI18N
132
        dtdAbbrevMap.put ("!at", "<!ATTLIST |>"); // NOI18N
131
        dtdAbbrevMap.put ("!at", "<!ATTLIST "); // NOI18N
133
        dtdAbbrevMap.put ("!el", "<!ELEMENT |>"); // NOI18N
132
        dtdAbbrevMap.put ("!no", "<!NOTATION "); // NOI18N
134
        dtdAbbrevMap.put ("!en", "<!ENTITY |>"); // NOI18N
133
        dtdAbbrevMap.put ("pu", "PUBLIC "); // NOI18N
135
        dtdAbbrevMap.put ("!no", "<!NOTATION |>"); // NOI18N
134
        dtdAbbrevMap.put ("sy", "SYSTEM "); // NOI18N
136
        dtdAbbrevMap.put ("cd",  "CDATA"); // NOI18N
135
        dtdAbbrevMap.put ("cd", "CDATA"); // NOI18N
137
        dtdAbbrevMap.put ("em",  "EMPTY"); // NOI18N
136
        dtdAbbrevMap.put ("pc", "#PCDATA"); // NOI18N
138
        dtdAbbrevMap.put ("en",  "ENTITY"); // NOI18N
137
//        dtdAbbrevMap.put ("an", "ANY"); // NOI18N
139
        dtdAbbrevMap.put ("ens", "ENTITIES"); // NOI18N
138
        dtdAbbrevMap.put ("em", "EMPTY"); // NOI18N
140
        dtdAbbrevMap.put ("fi",  "#FIXED"); // NOI18N
139
        dtdAbbrevMap.put ("fi", "#FIXED"); // NOI18N
141
        dtdAbbrevMap.put ("im",  "#IMPLIED"); // NOI18N
140
        dtdAbbrevMap.put ("im", "#IMPLIED"); // NOI18N
142
        dtdAbbrevMap.put ("nm",  "NMTOKEN"); // NOI18N
141
        dtdAbbrevMap.put ("re", "#REQUIRED"); // NOI18N
142
        dtdAbbrevMap.put ("nm", "NMTOKEN"); // NOI18N
143
        dtdAbbrevMap.put ("nms", "NMTOKENS"); // NOI18N
143
        dtdAbbrevMap.put ("nms", "NMTOKENS"); // NOI18N
144
        dtdAbbrevMap.put ("rf", "IDREF"); // NOI18N
144
        dtdAbbrevMap.put ("nn",  "NOTATION"); // NOI18N
145
        dtdAbbrevMap.put ("pc",  "#PCDATA"); // NOI18N
146
        dtdAbbrevMap.put ("pu",  "PUBLIC \"|\""); // NOI18N
147
        dtdAbbrevMap.put ("re",  "#REQUIRED"); // NOI18N
148
        dtdAbbrevMap.put ("rf",  "IDREF"); // NOI18N
145
        dtdAbbrevMap.put ("rfs", "IDREFS"); // NOI18N
149
        dtdAbbrevMap.put ("rfs", "IDREFS"); // NOI18N
146
        dtdAbbrevMap.put ("en", "ENTITY"); // NOI18N
150
        dtdAbbrevMap.put ("sy",  "SYSTEM \"|\""); // NOI18N
147
        dtdAbbrevMap.put ("ens", "ENTITIES"); // NOI18N
148
        dtdAbbrevMap.put ("nn", "NOTATION"); // NOI18N
149
151
150
        return dtdAbbrevMap;
152
        return dtdAbbrevMap;
151
    }
153
    }
152
153
    
154
    
154
    
155
    
155
156
    /*
157
     * Editor is bundled with one usefull macro, bind it
158
     */
159
    MultiKeyBinding[] getXMLKeyBindings() {
160
        return new MultiKeyBinding[] {
161
                    
162
                    new MultiKeyBinding(
163
                        new KeyStroke[] {
164
                            KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_MASK),
165
                        },
166
                        "macro-put-end-tag" // NOI18N
167
                    ),
168
                    
169
                    new MultiKeyBinding(
170
                        KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
171
                        XMLKit.xmlCommentAction
172
                    ),
173
174
                    new MultiKeyBinding(
175
                         KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
176
                         XMLKit.xmlUncommentAction
177
                    ),                   
178
179
               };
180
    }
181
182
183
    // just a temporary macro emulating put-end-tag
184
    Map getXMLMacroMap() {
185
        Map xmlMacroMap = new HashMap();
186
        
187
        // the macro uses trick with marking current position with "<"
188
        // then select it and instruct all subsequent finds to use it
189
        // it is very sensitive for exact find action sematics
190
        
191
        // it destroys users clipboard content and search selections
192
        
193
        xmlMacroMap.put( "put-end-tag", "\"<\" selection-backward find-selection find-previous find-previous caret-forward caret-forward\n" + // NOI18N
194
                         "select-identifier copy-to-clipboard caret-backward caret-forward\n" + // NOI18N
195
                         "find-next caret-backward caret-forward\n" + // NOI18N
196
                         "\"/\" paste-from-clipboard \">\"\n" + // NOI18N
197
                         "find-previous caret-forward caret-backward"); // NOI18N
198
        
199
        return xmlMacroMap;
200
    }
201
    
202
203
    /*
156
    /*
204
     * Identifiers accept all NameChar [4].
157
     * Identifiers accept all NameChar [4].
205
     */
158
     */
Lines 386-392 Link Here
386
339
387
                    case DTDTokenContext.COMMENT_ID:
340
                    case DTDTokenContext.COMMENT_ID:
388
                        return new Coloring(italicFont, Coloring.FONT_MODE_APPLY_STYLE,
341
                        return new Coloring(italicFont, Coloring.FONT_MODE_APPLY_STYLE,
389
                                                  Color.lightGray, null);
342
                                                  Color.gray, null);
390
343
391
                    case DTDTokenContext.KW_ID:
344
                    case DTDTokenContext.KW_ID:
392
                        return new Coloring(boldFont, Color.blue.darker().darker(), null);
345
                        return new Coloring(boldFont, Color.blue.darker().darker(), null);

Return to bug 24366