if (ed instanceof CloneableEditor) { if (((CloneableEditor) ed).isEditorPaneReady()) { p = ed.getEditorPane(); p = ed.getEditorPane(); p = ed.getEditorPane();
/** Updates titles of all editors. */ protected void updateTitles () { Enumeration en = allEditors.getComponents (); while (en.hasMoreElements()) { CloneableTopComponent o = (CloneableTopComponent)en.nextElement(); Pane e = (Pane)o.getClientProperty(PROP_PANE); if (e == null && o instanceof Pane) { e = (Pane)o; } if (e != null) { e.updateName(); } else { throw new IllegalStateException("No reference to Pane. Please file a bug against openide/text"); } } }
final Pane e = openPane(reuse); final Task t = prepareDocument(); e.ensureVisible(); class Selector implements TaskListener, Runnable { private boolean documentLocked = false;
final Pane e = openPane (); final Task t = prepareDocument (); e.ensureVisible();
JEditorPane p = ed.getEditorPane();
ce.getComponent().putClientProperty(PROP_PANE, ce); ce.getComponent().setReference(allEditors); CloneableTopComponent ctc = ce.getComponent(); if (reuse && displayMsgOpened) { CloneableTopComponent last = lastReusable.get();
final Pane e = openPane (); final Task t = prepareDocument (); e.ensureVisible();
JEditorPane p = ed.getEditorPane(); if(p == null) { continue;
ce.getComponent().putClientProperty(PROP_PANE, ce); ce.getComponent().setReference(allEditors); ce.getComponent ().open();
JEditorPane p = ed.getEditorPane(); if(p == null) { continue;
ce.getComponent().putClientProperty(PROP_PANE, ce); ce.getComponent().setReference(allEditors); ce.getComponent ().open();
/** Forcibly create one editor component. Then set the caret * to the given position. * @param pos where to place the caret * @return always non-<code>null</code> editor */ protected Editor openAt(PositionRef pos) { CloneableEditorSupport.Pane p = del.openAt (pos, -1); if (p instanceof Editor) { return (Editor)p; } java.awt.Component c = p.getEditorPane(); for (;;) { if (c instanceof Editor) { return (Editor)c; } c = c.getParent(); } }
/** Updates titles of all editors. */ protected void updateTitles () { Enumeration en = allEditors.getComponents (); while (en.hasMoreElements()) { CloneableTopComponent o = (CloneableTopComponent)en.nextElement(); Pane e = (Pane)o.getClientProperty(PROP_PANE); if (e == null && o instanceof Pane) { e = (Pane)o; } if (e != null) { e.updateName(); } else { throw new IllegalStateException("No reference to Pane. Please file a bug against openide/text"); } } }
public JEditorPane getEditorPane () { if (pane == null) { JComponent view = getView (); pane = view instanceof CloneableEditorSupport.Pane ? ((CloneableEditorSupport.Pane) view).getEditorPane () : null; //TODO This is temporary work around for NPE Debug.warning("Pane is " + pane); Debug.warning("Actin Map is "+ getActionMap()); if (pane == null) { return null; } // End getActionMap ().setParent (pane.getActionMap ()); pane.getActionMap ().remove ("cloneWindow"); // NOI18N } return pane; }
/** Updates titles of all editors. */ protected void updateTitles() { Enumeration en = allEditors.getComponents(); while (en.hasMoreElements()) { CloneableTopComponent o = (CloneableTopComponent) en.nextElement(); Pane e = (Pane) o.getClientProperty(PROP_PANE); if ((e == null) && o instanceof Pane) { e = (Pane) o; } if (e != null) { e.updateName(); } else { throw new IllegalStateException("No reference to Pane. Please file a bug against openide/text"); } } }
@Override public void show(ShowOpenType openType, ShowVisibilityType visibilityType, int column) { CloneableEditorSupport support = pos.getCloneableEditorSupport(); if ((openType == ShowOpenType.NONE) && !support.isDocumentLoaded()) { return; } CloneableEditorSupport.Pane editor = null; if ((openType == ShowOpenType.REUSE) || (openType == ShowOpenType.REUSE_NEW)) { editor = support.openReuse(pos, column, openType); } else if ((openType == ShowOpenType.OPEN) || (openType == ShowOpenType.NONE)) { //For ShowOpenType.NONE if editor is not yet opened method returns above editor = support.openAt(pos, column); } if (editor != null) { if (visibilityType == ShowVisibilityType.FRONT) { editor.getComponent().requestVisible(); editor.getComponent().toFront(); } else if (visibilityType == ShowVisibilityType.FOCUS) { editor.getComponent().requestActive(); } } }
/** Prepares document, creates and initializes * new <code>CloneableEditor</code> component. * Typically do not override this method. * For creating your own <code>CloneableEditor</code> type component * override {@link #createCloneableEditor} method. * * @return the {@link CloneableEditor} for this support */ protected CloneableTopComponent createCloneableTopComponent () { // initializes the document if not initialized prepareDocument (); Pane pane = createPane (); pane.getComponent().putClientProperty(PROP_PANE, pane); return pane.getComponent (); }
/** Prepares document, creates and initializes * new <code>CloneableEditor</code> component. * Typically do not override this method. * For creating your own <code>CloneableEditor</code> type component * override {@link #createCloneableEditor} method. * * @return the {@link CloneableEditor} for this support */ protected CloneableTopComponent createCloneableTopComponent () { // initializes the document if not initialized prepareDocument (); Pane pane = createPane (); pane.getComponent().putClientProperty(PROP_PANE, pane); return pane.getComponent (); }
/** Prepares document, creates and initializes * new <code>CloneableEditor</code> component. * Typically do not override this method. * For creating your own <code>CloneableEditor</code> type component * override {@link #createCloneableEditor} method. * * @return the {@link CloneableEditor} for this support */ protected CloneableTopComponent createCloneableTopComponent() { // initializes the document if not initialized prepareDocument(); Pane pane = createPane(); pane.getComponent().putClientProperty(PROP_PANE, pane); return pane.getComponent(); }
@Deprecated public void show(int kind, int column) { CloneableEditorSupport support = pos.getCloneableEditorSupport(); if ((kind == SHOW_TRY_SHOW) && !support.isDocumentLoaded()) { return; } CloneableEditorSupport.Pane editor; if (kind == SHOW_REUSE || kind == SHOW_REUSE_NEW) { editor = support.openReuse(pos, column, kind); } else { editor = support.openAt(pos, column); if (kind == SHOW_TOFRONT) editor.getComponent().toFront(); } if (kind != SHOW_TRY_SHOW && kind != SHOW_SHOW) { editor.getComponent().requestActive(); } }