Class CodeEditor

    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JInternalFrame

        javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String KEY_NAV_SIZE  
      static java.lang.String KEY_SHOW_NAVIGATOR  
      • Fields inherited from class javax.swing.JInternalFrame

        closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
      • Fields inherited from class javax.swing.JComponent

        listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • Fields inherited from class java.awt.Component

        accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
    • Constructor Summary

      Constructors 
      Constructor Description
      CodeEditor​(java.io.File file, CodeType codeType)
      Creates a new code editor for the requested file and file type.
      CodeEditor​(java.io.File file, java.lang.String encoding, CodeType codeType)
      Creates a new code editor for the requested file, encoding, and file type.
      CodeEditor​(java.io.File file, java.nio.charset.Charset encoding, CodeType codeType)
      Creates a new code editor for the requested file, encoding, and file type.
      CodeEditor​(java.lang.String text, CodeType codeType)
      Creates a new code editor that displays text but does not allow it to be edited unless the user creates a copy using Save As.
      CodeEditor​(java.lang.String text, java.lang.String encoding, CodeType codeType)
      Creates a new code editor that displays text but does not allow it to be edited unless the user creates a copy using Save As.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canPerformCommand​(AbstractCommand command)
      Returns true if the commandable wishes to handle the given command.
      static java.nio.charset.Charset checkFileForBOM​(java.io.File f)
      Detects a UTF-8/UTF-16/UTF-32 BOM sequence at the start of a text file.
      void clear()
      Clears the contents of this component to a blank state, if the user gives permission.
      protected javax.swing.JPopupMenu createPopupMenu​(CodeEditorBase editor, javax.swing.JPopupMenu menu)
      Returns a popup menu of actions that are appropriate for the editor type.
      protected java.lang.String escape​(java.lang.String line)
      Called before each line is written to a file to allow the editor to convert the text content.
      protected void exportImpl​(int type, java.io.File f)
      Subclasses should override this to export the edited content if EXPORT is a supported command.
      void find()  
      void format()
      Format the code in the code editor, if a suitable formatter is available.
      javax.swing.border.Border getBorder()  
      CodeType getCodeType()  
      int getDocumentLength()
      Returns the length of the document, in characters.
      CodeEditorBase getEditor()  
      java.lang.String getEncoding()  
      java.lang.String[] getExportDescriptions()
      Returns a description of the file types supported for export from this editor.
      java.lang.String[] getExportExtensions()
      Returns the standard file extensions supported for export from this editor.
      FileDrop.Listener getFileDropListener()  
      java.lang.String getFileNameExtension()
      Returns the standard file extension for the type of content displayed in this editor.
      java.lang.String getFileTypeDescription()
      Returns a description of the content displayed in this editor.
      javax.swing.Icon getFrameIcon()
      Returns the editor window icon.
      Navigator getNavigator()
      Returns the current navigator for this editor, or null if none is set.
      NavigationPoint getSelectedNavigationPoint()
      Returns the navigation point selected in the navigation panel, or null if none is selected.
      java.lang.String getSelectedText()
      Returns the selected text.
      java.lang.String getText()
      Returns the document text.
      boolean isAttached()
      Returns true if this editor is currently attached to the document tab strip.
      boolean isCharacterEscapingEnabled()
      Returns true if character escaping is enabled on read and write of the document.
      boolean isCommandApplicable​(AbstractCommand command)
      Returns true if the command can be performed by this commandable in its current state.
      static boolean isNavigatorVisible()
      Returns true if code editors will display a source navigator when one has been set.
      boolean isReadOnly()  
      protected void onHeartbeat()
      This method is called to allow the editor to perform heartbeat processing.
      void performCommand​(AbstractCommand command)
      Performs the command.
      protected void printImpl​(java.awt.print.PrinterJob job)
      Subclasses should override this to print the edited document if PRINT is a supported command.
      void refresh()
      Reload the file, replacing the edited text.
      void refreshNavigator()
      Updates the navigation panel to reflect the current state of the text.
      void run​(boolean debugIfAvailable)
      Run the current script.
      protected void saveImpl​(java.io.File f)
      Saves the editor content to the specified file.
      void select​(int startOffset, int endOffset)
      Selects from the start offset to the end offset.
      void selectAll()
      Selects the entire document.
      void setAttached​(boolean attach)
      Sets whether this editor is attached to the document tab strip.
      void setCharacterEscapingEnabled​(boolean characterEscaping)
      Sets whether character escaping is enabled on read and write of the document.
      void setFile​(java.io.File f)
      Sets the preferred file to use when saving the edited component.
      void setFileDropListener​(FileDrop.Listener fdl)  
      void setFrameIcon​(javax.swing.Icon icon)
      Sets the preferred icon to use for this editor window.
      void setNavigator​(Navigator nav)
      Sets the navigator that will be used to populate the navigation panel for this editor.
      static void setNavigatorVisible​(boolean navIsVisible)
      Sets whether source navigators are hidden.
      void setReadOnly​(boolean readOnly)  
      void setSelectedText​(java.lang.String text)
      Replaces the selection with the specified text.
      void setText​(java.lang.String text)
      Sets the document text.
      void sortSelectedLines()
      Displays a dialog that allows the user to sort the selected lines.
      protected StrangeEonsEditor spinOffImpl()
      Subclasses should override this to clone the edited document if SPIN_OFF is a supported command.
      protected java.lang.String unescape​(java.lang.String line)
      Called as each line is read to allow the editor to convert the text content.
      • Methods inherited from class javax.swing.JInternalFrame

        addImpl, addInternalFrameListener, createRootPane, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getGlassPane, getInternalFrameListeners, getJMenuBar, getLastCursor, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setCursor, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setUI, show, toBack, toFront, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CodeEditor

        public CodeEditor​(java.io.File file,
                          CodeType codeType)
                   throws java.io.IOException
        Creates a new code editor for the requested file and file type. The default encoding for the file type will be used to read and write the file.
        Parameters:
        file -
        codeType -
        Throws:
        java.io.IOException
      • CodeEditor

        public CodeEditor​(java.io.File file,
                          java.nio.charset.Charset encoding,
                          CodeType codeType)
                   throws java.io.IOException
        Creates a new code editor for the requested file, encoding, and file type.
        Parameters:
        file -
        encoding -
        codeType -
        Throws:
        java.io.IOException
      • CodeEditor

        public CodeEditor​(java.io.File file,
                          java.lang.String encoding,
                          CodeType codeType)
                   throws java.io.IOException
        Creates a new code editor for the requested file, encoding, and file type.
        Parameters:
        file -
        encoding -
        codeType -
        Throws:
        java.io.IOException
      • CodeEditor

        public CodeEditor​(java.lang.String text,
                          CodeType codeType)
        Creates a new code editor that displays text but does not allow it to be edited unless the user creates a copy using Save As. The default encoding for the content type will be used to read and write the file.
        Parameters:
        text - the text to display in the editor
        codeType - the content type of the text
      • CodeEditor

        public CodeEditor​(java.lang.String text,
                          java.lang.String encoding,
                          CodeType codeType)
        Creates a new code editor that displays text but does not allow it to be edited unless the user creates a copy using Save As.
        Parameters:
        text - the text to display in the editor
        encoding - the name of the character set to use when reading or writing the file
        codeType - the content type of the text
    • Method Detail

      • setReadOnly

        public void setReadOnly​(boolean readOnly)
      • isReadOnly

        public boolean isReadOnly()
      • checkFileForBOM

        public static java.nio.charset.Charset checkFileForBOM​(java.io.File f)
                                                        throws java.io.IOException
        Detects a UTF-8/UTF-16/UTF-32 BOM sequence at the start of a text file. If one exists, returns the Charset indicated by the sequence. Otherwise, returns null.
        Parameters:
        f - the file to check
        Returns:
        the encoding represented by the byte order mark, or null
        Throws:
        java.io.IOException
      • refresh

        public void refresh()
                     throws java.io.IOException
        Reload the file, replacing the edited text.
        Throws:
        java.io.IOException
      • find

        public void find()
      • getEncoding

        public java.lang.String getEncoding()
      • saveImpl

        protected void saveImpl​(java.io.File f)
                         throws java.io.IOException
        Description copied from class: AbstractStrangeEonsEditor
        Saves the editor content to the specified file. This method is called by {link #save} in response to save requests. Subclasses must override it to write an appropriate file for the document if the editor supports saving.
        Overrides:
        saveImpl in class AbstractStrangeEonsEditor
        Parameters:
        f - the file to write content to
        Throws:
        java.io.IOException - if the save fails
      • getCodeType

        public CodeType getCodeType()
      • getFileTypeDescription

        public java.lang.String getFileTypeDescription()
        Description copied from interface: StrangeEonsEditor
        Returns a description of the content displayed in this editor. For English descriptions, this should be plural as it is used to describe the file type in save dialogs.
        Specified by:
        getFileTypeDescription in interface StrangeEonsEditor
        Returns:
        a human-friendly description of the content associated with the editor, such as "Text Files"
        See Also:
        StrangeEonsEditor.getFileNameExtension()
      • printImpl

        protected void printImpl​(java.awt.print.PrinterJob job)
                          throws javax.print.PrintException,
                                 java.awt.print.PrinterException
        Description copied from class: AbstractStrangeEonsEditor
        Subclasses should override this to print the edited document if PRINT is a supported command.
        Overrides:
        printImpl in class AbstractStrangeEonsEditor
        Parameters:
        job - the printer job to use for printing
        Throws:
        javax.print.PrintException - if a printing error occurs
        java.awt.print.PrinterException - if a printing error occurs
      • exportImpl

        protected void exportImpl​(int type,
                                  java.io.File f)
                           throws java.io.IOException
        Description copied from class: AbstractSupportEditor
        Subclasses should override this to export the edited content if EXPORT is a supported command. The value of type is the index of the element in AbstractSupportEditor.getExportExtensions() for the file type that was selected by the user. The value of file is the destination file to write content to.
        Overrides:
        exportImpl in class AbstractSupportEditor
        Parameters:
        type - the index of the file format to export
        f - the file to write content to
        Throws:
        java.io.IOException - if an error occurs while writing
      • getExportExtensions

        public java.lang.String[] getExportExtensions()
        Description copied from class: AbstractSupportEditor
        Returns the standard file extensions supported for export from this editor. This implementation returns an empty array. If your editor supports export, it should override this to return
        Overrides:
        getExportExtensions in class AbstractSupportEditor
        Returns:
        an array of file extensions, such as "txt"

        This base implementation returns an empty array.

      • getExportDescriptions

        public java.lang.String[] getExportDescriptions()
        Description copied from class: AbstractSupportEditor
        Returns a description of the file types supported for export from this editor. The length and indices of this array match those returned by AbstractSupportEditor.getExportExtensions(), that is, element 0 of this array is a description of the file type represented by the element 0 of the extensions array.
        Overrides:
        getExportDescriptions in class AbstractSupportEditor
        Returns:
        an array of human-readable type descriptions, such as "Text document"

        This base implementation returns an empty array.

      • escape

        protected java.lang.String escape​(java.lang.String line)
        Called before each line is written to a file to allow the editor to convert the text content. The default implementation checks if isCharacterEscapingEnabled() returns true, and if so, it applies Unicode escapes to the line.
        Parameters:
        line - the line to process
        Returns:
        the processed line
      • unescape

        protected java.lang.String unescape​(java.lang.String line)
        Called as each line is read to allow the editor to convert the text content. The default implementation checks if isCharacterEscapingEnabled() returns true, and if so, it removes Unicode escapes from the line.
        Parameters:
        line - the line to process
        Returns:
        the processed line
      • isCharacterEscapingEnabled

        public boolean isCharacterEscapingEnabled()
        Returns true if character escaping is enabled on read and write of the document. When enabled, the default behaviour of escape(java.lang.String) and unescape(java.lang.String) is to automatically convert Java-style Unicode escapeUnicode sequences in the file into their character equivalents when displayed in the editor.
        Returns:
        true if automatic character escaping is enabled
        See Also:
        EscapedTextCodec
      • createPopupMenu

        protected javax.swing.JPopupMenu createPopupMenu​(CodeEditorBase editor,
                                                         javax.swing.JPopupMenu menu)
        Returns a popup menu of actions that are appropriate for the editor type.
        Returns:
        a context menu populated with menu items for the current selection and code type
      • format

        public void format()
        Format the code in the code editor, if a suitable formatter is available. Otherwise, do nothing.
      • setNavigator

        public void setNavigator​(Navigator nav)
        Sets the navigator that will be used to populate the navigation panel for this editor. Setting the navigator to null will disable the navigator panel.
        Parameters:
        nav - the new navigator to set
      • getNavigator

        public final Navigator getNavigator()
        Returns the current navigator for this editor, or null if none is set.
        Specified by:
        getNavigator in interface NavigationHost
        Returns:
        the current navigator
      • getSelectedNavigationPoint

        public NavigationPoint getSelectedNavigationPoint()
        Returns the navigation point selected in the navigation panel, or null if none is selected.
        Returns:
        the selected navigation point, or null
      • refreshNavigator

        public void refreshNavigator()
        Updates the navigation panel to reflect the current state of the text.
        Specified by:
        refreshNavigator in interface NavigationHost
      • isNavigatorVisible

        public static boolean isNavigatorVisible()
        Returns true if code editors will display a source navigator when one has been set. This setting applies to all code editors.
        Returns:
        true if navigators are visible
      • setNavigatorVisible

        public static void setNavigatorVisible​(boolean navIsVisible)
        Sets whether source navigators are hidden. This affects all code editors. To remove the navigator of a specific editor, set is navigator to null.
        Parameters:
        navIsVisible - if true, the navigator panel will be displayed by code editors; otherwise it will be hidden
      • getText

        public java.lang.String getText()
        Returns the document text.
        Returns:
        the edited text
      • setText

        public void setText​(java.lang.String text)
        Sets the document text.
        Parameters:
        text - to text to be edited
      • getSelectedText

        public java.lang.String getSelectedText()
        Returns the selected text. Returns an empty string if the selection is empty.
        Returns:
        the text with the current selection
      • setSelectedText

        public void setSelectedText​(java.lang.String text)
        Replaces the selection with the specified text. If the selection is empty, then the specified text is inserted.
        Parameters:
        text - the text to replace the selection with
      • select

        public void select​(int startOffset,
                           int endOffset)
        Selects from the start offset to the end offset.
        Parameters:
        startOffset - the start offset
        endOffset - the end offset
      • selectAll

        public void selectAll()
        Selects the entire document.
      • getDocumentLength

        public int getDocumentLength()
        Returns the length of the document, in characters.
        Returns:
        the document length
      • run

        public void run​(boolean debugIfAvailable)
        Run the current script.
        Parameters:
        debugIfAvailable - if the debugger is enabled, debug the script by activating a breakpoint when the script starts running
      • sortSelectedLines

        public void sortSelectedLines()
        Displays a dialog that allows the user to sort the selected lines.
      • getBorder

        public final javax.swing.border.Border getBorder()
        Overrides:
        getBorder in class javax.swing.JComponent
      • setFrameIcon

        public void setFrameIcon​(javax.swing.Icon icon)
        Sets the preferred icon to use for this editor window. This icon may be used to represent the window in various parts of the application interface. Possible example uses include the following: the document tab, the editor's item in the Window menu, and the frame icon of the editor's detached window. Note, however, that there is no guarantee that the icon will be used, or how. Furthermore, the icon may be used in modified form.
        Overrides:
        setFrameIcon in class javax.swing.JInternalFrame
        Parameters:
        icon - the preferred icon for the editor window
        See Also:
        JInternalFrame.getFrameIcon()
      • getFrameIcon

        public javax.swing.Icon getFrameIcon()
        Returns the editor window icon.
        Overrides:
        getFrameIcon in class javax.swing.JInternalFrame
        Returns:
        the icon for the editor, or null if no icon is set
      • setAttached

        public void setAttached​(boolean attach)
        Sets whether this editor is attached to the document tab strip. If true, the editor is attached; this is the default state for new editors. If false, the editor is detached from the tab strip. When detached, the editor appears in its own floating window separate from the main application window. The editor reattaches when the window is closed.
        Parameters:
        attach - if true, attaches the window to the tab strip
      • isAttached

        public boolean isAttached()
        Returns true if this editor is currently attached to the document tab strip.
        Returns:
        true if the editor is attached
        See Also:
        setAttached(boolean)