Java Code Examples for org.openide.text.DataEditorSupport#create()
The following examples show how to use
org.openide.text.DataEditorSupport#create() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GlslGeometryShaderDataObject.java From MikuMikuStudio with BSD 2-Clause "Simplified" License | 6 votes |
public GlslGeometryShaderDataObject(FileObject pf, GlslGeometryShaderDataLoader loader) throws DataObjectExistsException, IOException { super(pf, loader); CookieSet cookies = getCookieSet(); observer = new GlslShaderFileObserver(this); final CloneableEditorSupport support = DataEditorSupport.create(this, getPrimaryEntry(), cookies); support.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if ("document".equals(event.getPropertyName())) { if (event.getNewValue() != null) { support.getDocument().addDocumentListener(observer); observer.runCompileTask(); } else if (event.getOldValue() != null) { // cylab: I think this is never called. // But I don't know if unregistering the observer makes any difference... ((Document) event.getOldValue()).removeDocumentListener(observer); } } } }); cookies.add((Node.Cookie) support); }
Example 2
Source File: MultiDOEditor.java From netbeans with Apache License 2.0 | 5 votes |
@Override public <T extends Cookie> T createCookie(Class<T> klass) { if (klass.isAssignableFrom(SimpleES.class)) { synchronized (this) { if (support == null) { support = DataEditorSupport.create( outer, outer.getPrimaryEntry(), outer.getCookieSet(), useMultiview ? this : null ); } } return klass.cast(support); } return null; }
Example 3
Source File: GlslVertexShaderDataObject.java From MikuMikuStudio with BSD 2-Clause "Simplified" License | 5 votes |
public GlslVertexShaderDataObject(FileObject pf, GlslVertexShaderDataLoader loader) throws DataObjectExistsException, IOException { super(pf, loader); CookieSet cookies = getCookieSet(); observer= new GlslShaderFileObserver(this); final CloneableEditorSupport support= DataEditorSupport.create(this, getPrimaryEntry(), cookies); support.addPropertyChangeListener( new PropertyChangeListener(){ public void propertyChange(PropertyChangeEvent event) { if("document".equals(event.getPropertyName())){ if(event.getNewValue()!=null) { support.getDocument().addDocumentListener(observer); observer.runCompileTask(); } else if(event.getOldValue()!=null) { // cylab: I think this is never called. // But I don't know if unregistering the observer makes any difference... ((Document)event.getOldValue()).removeDocumentListener(observer); } } } } ); cookies.add((Node.Cookie) support); }
Example 4
Source File: GlslFragmentShaderDataObject.java From MikuMikuStudio with BSD 2-Clause "Simplified" License | 5 votes |
public GlslFragmentShaderDataObject(FileObject pf, GlslFragmentShaderDataLoader loader) throws DataObjectExistsException, IOException { super(pf, loader); CookieSet cookies = getCookieSet(); observer= new GlslShaderFileObserver(this); final CloneableEditorSupport support= DataEditorSupport.create(this, getPrimaryEntry(), cookies); support.addPropertyChangeListener( new PropertyChangeListener(){ public void propertyChange(PropertyChangeEvent event) { if("document".equals(event.getPropertyName())){ if(event.getNewValue()!=null) { support.getDocument().addDocumentListener(observer); observer.runCompileTask(); } else if(event.getOldValue()!=null) { // cylab: I think this is never called. // But I don't know if unregistering the observer makes any difference... ((Document)event.getOldValue()).removeDocumentListener(observer); } } } } ); cookies.add((Node.Cookie) support); }