/** Creates new editor component associated with * support object. * @param support support that holds the document and operations above it */ public CloneableEditor(CloneableEditorSupport support) { super(); this.support = support; updateName(); setCloseOperation(CLOSE_EACH); }
/** Creates new editor component associated with * support object. * @param support support that holds the document and operations above it */ public CloneableEditor(CloneableEditorSupport support) { super(); this.support = support; updateName(); setCloseOperation(CLOSE_EACH); }
/** Creates new editor component associated with * support object (possibly also with its * {@link CloneableEditorSupport#CloneableEditorSupport(org.openide.text.CloneableEditorSupport.Env, org.openide.util.Lookup) lookup}. * * @param support support that holds the document and operations above it * @param associateLookup true, if {@link #getLookup()} should return the lookup * associated with {@link CloneableEditorSupport}. */ public CloneableEditor(CloneableEditorSupport support, boolean associateLookup) { super(); this.support = support; updateName(); _setCloseOperation(); setMinimumSize(new Dimension(10, 10)); if (associateLookup) { associateLookup(support.getLookup()); } } @SuppressWarnings("deprecation")
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); int offset; Object firstObject = in.readObject(); // New deserialization that uses Env environment, // and which could be null(!) see writeExternal. if (firstObject instanceof CloneableOpenSupport.Env) { CloneableOpenSupport.Env env = (CloneableOpenSupport.Env) firstObject; CloneableOpenSupport os = env.findCloneableOpenSupport(); support = (CloneableEditorSupport) os; } // load cursor position offset = ((Integer) in.readObject()).intValue(); if (!discard()) { cursorPosition = offset; } updateName(); isComponentOpened = true; if (in.available() > 0) { boolean associate = in.readBoolean(); if (associate && support != null) { associateLookup(support.getLookup()); } } }