KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > editor > NbEditorUI


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.editor;
21
22 import java.awt.BorderLayout JavaDoc;
23 import java.awt.Component JavaDoc;
24 import java.awt.Dimension JavaDoc;
25 import java.awt.event.ActionEvent JavaDoc;
26 import java.awt.event.FocusAdapter JavaDoc;
27 import java.awt.event.FocusEvent JavaDoc;
28 import java.awt.event.FocusListener JavaDoc;
29 import java.beans.PropertyChangeEvent JavaDoc;
30 import java.beans.PropertyChangeListener JavaDoc;
31 import java.util.Collection JavaDoc;
32 import java.util.HashMap JavaDoc;
33 import java.util.Iterator JavaDoc;
34 import java.util.Map JavaDoc;
35 import javax.swing.Action JavaDoc;
36 import javax.swing.BorderFactory JavaDoc;
37 import javax.swing.event.ChangeListener JavaDoc;
38 import javax.swing.text.AttributeSet JavaDoc;
39 import javax.swing.text.Document JavaDoc;
40 import javax.swing.text.JTextComponent JavaDoc;
41 import org.netbeans.api.editor.mimelookup.MimeLookup;
42 import org.netbeans.api.editor.settings.FontColorSettings;
43 import org.netbeans.editor.BaseKit;
44 import org.netbeans.editor.Coloring;
45 import org.netbeans.editor.EditorUI;
46 import org.netbeans.editor.Settings;
47 import org.netbeans.editor.Utilities;
48 import org.netbeans.editor.ext.ExtEditorUI;
49 import org.netbeans.editor.ext.ExtKit;
50 import org.netbeans.modules.editor.options.AllOptionsFolder;
51 import org.openide.filesystems.FileObject;
52 import org.openide.loaders.DataObject;
53 import org.openide.util.LookupEvent;
54 import org.openide.util.LookupListener;
55 import org.openide.util.RequestProcessor;
56 import org.openide.util.WeakListeners;
57 import org.openide.util.actions.ActionPerformer;
58 import org.openide.util.actions.SystemAction;
59 import org.openide.util.actions.CallbackSystemAction;
60 import org.openide.windows.TopComponent;
61 import javax.swing.JComponent JavaDoc;
62 import javax.swing.JPanel JavaDoc;
63 import javax.swing.JScrollPane JavaDoc;
64 import javax.swing.JToolBar JavaDoc;
65 import javax.swing.border.Border JavaDoc;
66 import org.netbeans.api.editor.mimelookup.MimePath;
67 import org.netbeans.modules.editor.impl.CustomizableSideBar;
68 import org.netbeans.modules.editor.impl.CustomizableSideBar.SideBarPosition;
69 import org.openide.text.CloneableEditorSupport;
70 import org.openide.util.ContextAwareAction;
71 import org.openide.util.Lookup;
72
73 /**
74 * Editor UI
75 *
76 * @author Miloslav Metelka
77 * @version 1.00
78 */

79
80 public class NbEditorUI extends ExtEditorUI {
81
82     private FocusListener JavaDoc focusL;
83
84     private boolean attached = false;
85     private ChangeListener JavaDoc listener;
86     private FontColorSettings fontColorSettings;
87     private LookupListener weakLookupListener;
88     private Lookup.Result result;
89     private LookupListener lookupListener;
90     
91     private static final Map JavaDoc /*<mimeType, map of colorings>*/mime2Coloring = new HashMap JavaDoc(5);
92     
93     /**
94      *
95      * @deprecated - use {@link attachSystemActionPerformer(String)} instead
96      */

97     protected SystemActionUpdater createSystemActionUpdater(
98         String JavaDoc editorActionName, boolean updatePerformer, boolean syncEnabling) {
99         return new SystemActionUpdater(editorActionName, updatePerformer, syncEnabling);
100     }
101
102     public NbEditorUI() {
103         focusL = new FocusAdapter JavaDoc() {
104                      public void focusGained(FocusEvent JavaDoc evt) {
105                          // Refresh file object when component made active
106
Document JavaDoc doc = getDocument();
107                          if (doc != null) {
108                              DataObject dob = NbEditorUtilities.getDataObject(doc);
109                              if (dob != null) {
110                                  final FileObject fo = dob.getPrimaryFile();
111                                  if (fo != null) {
112                                      // Fixed #48151 - posting the refresh outside of AWT thread
113
RequestProcessor.getDefault().post(new Runnable JavaDoc() {
114                                          public void run() {
115                                              fo.refresh();
116                                          }
117                                      });
118                                  }
119                              }
120                          }
121                      }
122                  };
123
124     }
125     
126     
127     private static Lookup getContextLookup(java.awt.Component JavaDoc component){
128         Lookup lookup = null;
129         for (java.awt.Component JavaDoc c = component; c != null; c = c.getParent()) {
130             if (c instanceof Lookup.Provider) {
131                 lookup = ((Lookup.Provider)c).getLookup ();
132                 if (lookup != null) {
133                     break;
134                 }
135             }
136         }
137         return lookup;
138     }
139     
140     protected void attachSystemActionPerformer(String JavaDoc editorActionName){
141         new NbEditorUI.SystemActionPerformer(editorActionName);
142     }
143
144     private String JavaDoc getDocumentContentType(){
145         JTextComponent JavaDoc c = getComponent();
146         if (c == null){
147             return null;
148         }
149         Document JavaDoc doc = c.getDocument();
150         String JavaDoc mimeType = (String JavaDoc) doc.getProperty("mimeType"); //NOI18N
151
if (mimeType == null){
152             return null;
153         }
154         return mimeType;
155     }
156     
157     private FontColorSettings getFontColorSettings(){
158         synchronized (Settings.class){
159             if (fontColorSettings == null){
160                 final String JavaDoc mimeType = getDocumentContentType();
161                 if (mimeType == null){
162                     return null;
163                 }
164                 Lookup lookup = MimeLookup.getLookup(MimePath.parse(mimeType));
165                 result = lookup.lookup(new Lookup.Template(FontColorSettings.class));
166                 Collection JavaDoc inst = result.allInstances();
167                 lookupListener = new MyLookupListener(mimeType);
168                 weakLookupListener = (LookupListener) WeakListeners.create(
169                         LookupListener.class, lookupListener, result);
170   
171                 result.addLookupListener(weakLookupListener);
172                 if (inst.size() > 0){
173                     fontColorSettings = (FontColorSettings)inst.iterator().next();
174                 }
175             }
176         }
177         return fontColorSettings;
178     }
179
180     
181     protected Map JavaDoc createColoringMap(){
182         FontColorSettings fcs = getFontColorSettings();
183         String JavaDoc mimeType = getDocumentContentType();
184         if (fcs == null || mimeType == null){
185             return super.createColoringMap();
186         }
187         synchronized (Settings.class){
188             Map JavaDoc cm = (Map JavaDoc)mime2Coloring.get(mimeType);
189             if (cm != null){
190                 return cm;
191             }
192             cm = new HashMap JavaDoc();
193             cm.putAll(super.createColoringMap());
194
195             for(Iterator JavaDoc it = cm.keySet().iterator(); it.hasNext(); ) {
196
197                 Object JavaDoc nameObj = it.next();
198                 if (!(nameObj instanceof String JavaDoc)) {
199                     continue;
200                 }
201                 
202                 String JavaDoc name = (String JavaDoc) nameObj;
203                 
204                 AttributeSet JavaDoc as = fcs.getTokenFontColors(name);
205                 if (as == null){
206                     as = fcs.getFontColors(name);
207                     if (as == null){
208                         continue;
209                     }
210                 }
211
212                 cm.put(name, Coloring.fromAttributeSet(as));
213             }
214             
215             mime2Coloring.put(mimeType, cm);
216             return cm;
217         }
218     }
219     
220     protected void installUI(JTextComponent JavaDoc c) {
221         super.installUI(c);
222
223         if (!attached){
224             attachSystemActionPerformer(ExtKit.findAction);
225             attachSystemActionPerformer(ExtKit.replaceAction);
226             attachSystemActionPerformer(ExtKit.gotoAction);
227             attachSystemActionPerformer(ExtKit.showPopupMenuAction);
228
229             // replacing DefaultEditorKit.deleteNextCharAction by BaseKit.removeSelectionAction
230
// #41223
231
// attachSystemActionPerformer(BaseKit.removeSelectionAction);
232

233             attached = true;
234         }
235         
236         c.addFocusListener(focusL);
237     }
238
239
240     protected void uninstallUI(JTextComponent JavaDoc c) {
241         super.uninstallUI(c);
242
243         c.removeFocusListener(focusL);
244     }
245     
246     protected JComponent JavaDoc createExtComponent() {
247
248         final JTextComponent JavaDoc component = getComponent();
249 // setLineNumberEnabled(true); // enable line numbering
250

251         // extComponent will be a panel
252
final JComponent JavaDoc ec = new JPanel JavaDoc(new BorderLayout JavaDoc());
253         ec.putClientProperty(JTextComponent JavaDoc.class, component);
254
255         // Add the scroll-pane with the component to the center
256
final JScrollPane JavaDoc scroller = new JScrollPane JavaDoc(component);
257         
258         scroller.getViewport().setMinimumSize(new Dimension JavaDoc(4,4));
259
260         // remove default scroll-pane border, winsys will handle borders itself
261
Border JavaDoc empty = BorderFactory.createEmptyBorder();
262         // Important: Do not delete or use null instead, will cause
263
//problems on GTK L&F. Must set both scroller border & viewport
264
//border! - Tim
265
scroller.setBorder(empty);
266         scroller.setViewportBorder(empty);
267
268         String JavaDoc mimeType = NbEditorUtilities.getMimeType(component);
269         
270         Map JavaDoc/*<SideBarPosition, JComponent>*/ sideBars = CustomizableSideBar.createSideBars(component);
271         if (listener == null){
272             listener = new ChangeListener JavaDoc(){
273                 public void stateChanged(javax.swing.event.ChangeEvent JavaDoc e) {
274                     if (Utilities.getEditorUI(component) == null) {
275                         return; //#63146
276
}
277                     Map JavaDoc newMap = CustomizableSideBar.createSideBars(component);
278                     processSideBars(newMap, scroller, ec);
279                     ec.revalidate();
280                     ec.repaint();
281                     
282                 }
283             };
284             CustomizableSideBar.addChangeListener(mimeType, listener);
285         }
286         
287         processSideBars(sideBars, scroller, ec);
288         
289         initGlyphCorner(scroller);
290
291         ec.add(scroller);
292         return ec;
293     }
294     
295
296     public boolean isLineNumberEnabled() {
297         return AllOptionsFolder.getDefault().getLineNumberVisible();
298     }
299
300     public void setLineNumberEnabled(boolean lineNumberEnabled) {
301         AllOptionsFolder.getDefault().setLineNumberVisible(lineNumberEnabled);
302     }
303     
304     private void processSideBars(Map JavaDoc sideBars, JScrollPane JavaDoc scroller, JComponent JavaDoc ec){
305         ec.removeAll();
306         scroller.setRowHeader(null);
307         scroller.setColumnHeaderView(null);
308         for (Iterator JavaDoc entries = sideBars.entrySet().iterator(); entries.hasNext(); ) {
309             Map.Entry JavaDoc entry = (Map.Entry JavaDoc) entries.next();
310             SideBarPosition position = (SideBarPosition) entry.getKey();
311             JComponent JavaDoc sideBar = (JComponent JavaDoc) entry.getValue();
312             
313             if (position.isScrollable()) {
314                 if (position.getPosition() == SideBarPosition.WEST) {
315                     scroller.setRowHeaderView(sideBar);
316                 } else {
317                     if (position.getPosition() == SideBarPosition.NORTH) {
318                         scroller.setColumnHeaderView(sideBar);
319                     } else {
320                         throw new IllegalArgumentException JavaDoc("Unsupported side bar position, scrollable = true, position=" + position.getBorderLayoutPosition()); // NOI18N
321
}
322                 }
323             } else {
324                 ec.add(sideBar, position.getBorderLayoutPosition());
325             }
326         }
327         ec.add(scroller);
328     }
329     
330     protected JToolBar JavaDoc createToolBarComponent() {
331         return new NbEditorToolBar(getComponent());
332     }
333
334     private class SystemActionPerformer implements PropertyChangeListener JavaDoc{
335
336         private String JavaDoc editorActionName;
337
338         private Action JavaDoc editorAction;
339
340         private Action JavaDoc systemAction;
341         
342         
343         SystemActionPerformer(String JavaDoc editorActionName) {
344             this.editorActionName = editorActionName;
345
346             synchronized (NbEditorUI.this.getComponentLock()) {
347                 // if component already installed in EditorUI simulate installation
348
JTextComponent JavaDoc component = getComponent();
349                 if (component != null) {
350                     propertyChange(new PropertyChangeEvent JavaDoc(NbEditorUI.this,
351                                                            EditorUI.COMPONENT_PROPERTY, null, component));
352                 }
353
354                 NbEditorUI.this.addPropertyChangeListener(this);
355             }
356         }
357         
358         private void attachSystemActionPerformer(JTextComponent JavaDoc c){
359             if (c == null) return;
360
361             Action JavaDoc editorAction = getEditorAction(c);
362             if (editorAction == null) return;
363
364             Action JavaDoc globalSystemAction = getSystemAction(c);
365             if (globalSystemAction == null) return;
366
367             if (globalSystemAction instanceof CallbackSystemAction){
368                 Object JavaDoc key = ((CallbackSystemAction)globalSystemAction).getActionMapKey();
369                 c.getActionMap ().put (key, editorAction);
370             }
371         }
372         
373         private void detachSystemActionPerformer(JTextComponent JavaDoc c){
374             if (c == null) return;
375
376             Action JavaDoc editorAction = getEditorAction(c);
377             if (editorAction == null) return;
378
379             Action JavaDoc globalSystemAction = getSystemAction(c);
380             if (globalSystemAction == null) return;
381
382             if (globalSystemAction instanceof CallbackSystemAction){
383                 Object JavaDoc key = ((CallbackSystemAction)globalSystemAction).getActionMapKey();
384                 Object JavaDoc ea = c.getActionMap ().get (key);
385                 if (editorAction.equals(ea)){
386                     c.getActionMap ().remove(key);
387                 }
388             }
389                                 
390         }
391         
392         
393         public synchronized void propertyChange(PropertyChangeEvent JavaDoc evt) {
394             String JavaDoc propName = evt.getPropertyName();
395
396             if (EditorUI.COMPONENT_PROPERTY.equals(propName)) {
397                 JTextComponent JavaDoc component = (JTextComponent JavaDoc)evt.getNewValue();
398
399                 if (component != null) { // just installed
400
component.addPropertyChangeListener(this);
401                     attachSystemActionPerformer(component);
402                 } else { // just deinstalled
403
component = (JTextComponent JavaDoc)evt.getOldValue();
404                     component.removePropertyChangeListener(this);
405                     detachSystemActionPerformer(component);
406                 }
407             }
408         }
409
410         private synchronized Action JavaDoc getEditorAction(JTextComponent JavaDoc component) {
411             if (editorAction == null) {
412                 BaseKit kit = Utilities.getKit(component);
413                 if (kit != null) {
414                     editorAction = kit.getActionByName(editorActionName);
415                 }
416             }
417             return editorAction;
418         }
419
420         private Action JavaDoc getSystemAction(JTextComponent JavaDoc c) {
421             if (systemAction == null) {
422                 Action JavaDoc ea = getEditorAction(c);
423                 if (ea != null) {
424                     String JavaDoc saClassName = (String JavaDoc)ea.getValue(NbEditorKit.SYSTEM_ACTION_CLASS_NAME_PROPERTY);
425                     if (saClassName != null) {
426                         Class JavaDoc saClass;
427                         try {
428                             saClass = Class.forName(saClassName);
429                         } catch (Throwable JavaDoc t) {
430                             saClass = null;
431                         }
432
433                         if (saClass != null) {
434                             systemAction = SystemAction.get(saClass);
435                             if (systemAction instanceof ContextAwareAction){
436                                 Lookup lookup = getContextLookup(c);
437                                 if (lookup!=null){
438                                     systemAction = ((ContextAwareAction)systemAction).createContextAwareInstance(lookup);
439                                 }
440                             }
441                             
442                         }
443                     }
444                 }
445             }
446             return systemAction;
447         }
448         
449     }
450     
451
452     /**
453      *
454      * @deprecated use SystemActionPerformer instead
455      */

456     public final class SystemActionUpdater
457         implements PropertyChangeListener JavaDoc, ActionPerformer {
458
459         private String JavaDoc editorActionName;
460
461         private boolean updatePerformer;
462
463         private boolean syncEnabling;
464
465         private Action JavaDoc editorAction;
466
467         private Action JavaDoc systemAction;
468
469         private PropertyChangeListener JavaDoc enabledPropertySyncL;
470         
471         private boolean listeningOnTCRegistry;
472
473
474         SystemActionUpdater(String JavaDoc editorActionName, boolean updatePerformer,
475                             boolean syncEnabling) {
476             this.editorActionName = editorActionName;
477             this.updatePerformer = updatePerformer;
478             this.syncEnabling = syncEnabling;
479
480             synchronized (NbEditorUI.this.getComponentLock()) {
481                 // if component already installed in EditorUI simulate installation
482
JTextComponent JavaDoc component = getComponent();
483                 if (component != null) {
484                     propertyChange(new PropertyChangeEvent JavaDoc(NbEditorUI.this,
485                                                            EditorUI.COMPONENT_PROPERTY, null, component));
486                 }
487
488                 NbEditorUI.this.addPropertyChangeListener(this);
489             }
490         }
491
492         public void editorActivated() {
493             Action JavaDoc ea = getEditorAction();
494             Action JavaDoc sa = getSystemAction();
495             if (ea != null && sa != null) {
496                 if (updatePerformer) {
497                     if (ea.isEnabled() && sa instanceof CallbackSystemAction) {
498                         ((CallbackSystemAction)sa).setActionPerformer(this);
499                     }
500                 }
501
502                 if (syncEnabling) {
503                     if (enabledPropertySyncL == null) {
504                         enabledPropertySyncL = new EnabledPropertySyncListener(sa);
505                     }
506                     ea.addPropertyChangeListener(enabledPropertySyncL);
507                 }
508             }
509         }
510
511         public void editorDeactivated() {
512             Action JavaDoc ea = getEditorAction();
513             Action JavaDoc sa = getSystemAction();
514             if (ea != null && sa != null) {
515                 /* if (sa instanceof CallbackSystemAction) {
516                           CallbackSystemAction csa = (CallbackSystemAction)sa;
517                           if (csa.getActionPerformer() == this) {
518                             csa.setActionPerformer(null);
519                           }
520                         }
521                 */

522
523                 if (syncEnabling && enabledPropertySyncL != null) {
524                     ea.removePropertyChangeListener(enabledPropertySyncL);
525                 }
526             }
527         }
528
529         private void reset() {
530             if (enabledPropertySyncL != null) {
531                 editorAction.removePropertyChangeListener(enabledPropertySyncL);
532             }
533
534             /* if (systemAction != null) {
535                     if (systemAction instanceof CallbackSystemAction) {
536                       CallbackSystemAction csa = (CallbackSystemAction)systemAction;
537                       if (!csa.getSurviveFocusChange() || csa.getActionPerformer() == this) {
538                         csa.setActionPerformer(null);
539                       }
540                     }
541                   }
542             */

543
544             editorAction = null;
545             systemAction = null;
546             enabledPropertySyncL = null;
547         }
548
549         /** Perform the callback action */
550         public void performAction(SystemAction action) {
551             JTextComponent JavaDoc component = getComponent();
552             Action JavaDoc ea = getEditorAction();
553             if (component != null && ea != null) {
554                 ea.actionPerformed(new ActionEvent JavaDoc(component, 0, "")); // NOI18N
555
}
556         }
557         
558         private void startTCRegistryListening() {
559             if (!listeningOnTCRegistry) {
560                 listeningOnTCRegistry = true;
561                 TopComponent.getRegistry().addPropertyChangeListener(this);
562             }
563         }
564         
565         private void stopTCRegistryListening() {
566             if (listeningOnTCRegistry) {
567                 listeningOnTCRegistry = false;
568                 TopComponent.getRegistry().removePropertyChangeListener(this);
569             }
570         }
571
572         public synchronized void propertyChange(PropertyChangeEvent JavaDoc evt) {
573             String JavaDoc propName = evt.getPropertyName();
574
575             if (TopComponent.Registry.PROP_ACTIVATED.equals (propName)) {
576                 TopComponent activated = (TopComponent)evt.getNewValue();
577
578                 if(activated instanceof CloneableEditorSupport.Pane)
579                     editorActivated();
580                 else
581                     editorDeactivated();
582             } else if (EditorUI.COMPONENT_PROPERTY.equals(propName)) {
583                 JTextComponent JavaDoc component = (JTextComponent JavaDoc)evt.getNewValue();
584
585                 if (component != null) { // just installed
586
component.addPropertyChangeListener(this);
587                     if (component.isDisplayable()) {
588                         startTCRegistryListening();
589                     }
590
591                 } else { // just deinstalled
592
component = (JTextComponent JavaDoc)evt.getOldValue();
593                     component.removePropertyChangeListener(this);
594                     stopTCRegistryListening();
595                 }
596
597                 reset();
598
599             } else if ("editorKit".equals(propName)) { // NOI18N
600
reset();
601
602             } else if ("ancestor".equals(propName)) { // NOI18N
603
if (((Component JavaDoc)evt.getSource()).isDisplayable()) { // now displayable
604
startTCRegistryListening();
605                 } else { // not displayable
606
stopTCRegistryListening();
607                 }
608             }
609         }
610
611         private synchronized Action JavaDoc getEditorAction() {
612             if (editorAction == null) {
613                 BaseKit kit = Utilities.getKit(getComponent());
614                 if (kit != null) {
615                     editorAction = kit.getActionByName(editorActionName);
616                 }
617             }
618             return editorAction;
619         }
620
621         private Action JavaDoc getSystemAction() {
622             if (systemAction == null) {
623                 Action JavaDoc ea = getEditorAction();
624                 if (ea != null) {
625                     String JavaDoc saClassName = (String JavaDoc)ea.getValue(NbEditorKit.SYSTEM_ACTION_CLASS_NAME_PROPERTY);
626                     if (saClassName != null) {
627                         Class JavaDoc saClass;
628                         try {
629                             saClass = Class.forName(saClassName);
630                         } catch (Throwable JavaDoc t) {
631                             saClass = null;
632                         }
633
634                         if (saClass != null) {
635                             systemAction = SystemAction.get(saClass);
636                         }
637                     }
638                 }
639             }
640             return systemAction;
641         }
642
643         protected void finalize() throws Throwable JavaDoc {
644             reset();
645         }
646
647     }
648
649     /** Listener that listen on changes of the "enabled" property
650     * and if changed it changes the same property of the action
651     * given in constructor.
652     */

653     static class EnabledPropertySyncListener implements PropertyChangeListener JavaDoc {
654
655         Action JavaDoc action;
656
657         EnabledPropertySyncListener(Action JavaDoc actionToBeSynced) {
658             this.action = actionToBeSynced;
659         }
660
661         public void propertyChange(PropertyChangeEvent JavaDoc evt) {
662             if ("enabled".equals(evt.getPropertyName())) { // NOI18N
663
action.setEnabled(((Boolean JavaDoc)evt.getNewValue()).booleanValue());
664             }
665         }
666
667     }
668
669     public Map JavaDoc getColoringMap() {
670         return createColoringMap();
671     }
672
673     private class MyLookupListener implements LookupListener {
674
675         private String JavaDoc mimeType;
676
677         public MyLookupListener(String JavaDoc mimeType) {
678             super();
679             this.mimeType = mimeType;
680         }
681
682         public void resultChanged(LookupEvent ev) {
683             synchronized (Settings.class){
684                 mime2Coloring.remove(mimeType);
685                 Lookup.Result result = ((Lookup.Result)ev.getSource());
686                 // refresh fontColorSettings
687
Collection JavaDoc newInstances = result.allInstances();
688                 if (newInstances.size() > 0){
689                     fontColorSettings = (FontColorSettings)newInstances.iterator().next();
690                 }
691             }
692             settingsChangeImpl(null);
693         }
694     }
695
696 }
697
Popular Tags