Class OxygenUIComponentsFactory
java.lang.Object
ro.sync.exml.workspace.api.standalone.ui.OxygenUIComponentsFactory
Create UI components that look and feel like the ones in oXygen.
- Since:
- 21.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidchangeContentType(JTextArea textArea, String contentType) Changes the content type of a text area created with Oxygen API createTextArea(String)static JButtoncreateButton(Action action) Create a button.static JCheckBoxMenuItemcreateCheckBoxMenuItem(Action action) Create a checkbox menu item over given action.static ColorButtoncreateColorChooserButton(Color currentColor) Create a button that presents a color chooser.static JComboBoxcreateComboBox(ComboBoxModel model) Create a new Oxygen style combo box.static JEditorPanecreateHTMLEditorPane(String text, boolean useStandardTextFont) Creates aJEditorPaneto edit HTML content.static InputUrlComponentProvidercreateInputURLPanelProvider(String[] extensions, String filesDescription, String[] initialContent, boolean showEditorVariables, String persistenceKey, LocalFileBrowseType browseType) Create the input url component provider, used to create an URL chooser similar to the ones in the application which can be embedded inside a third party panel.static JLabelcreateLinkLabel(String text, ActionListener listener) Create a clickable label which looks like a link.static MenucreateMenu(String menuName) Create ajavax.swing.JMenuextension that has the look and feel consistent with the menus from oXygen.static JMenuItemcreateMenuItem(Action action) Create a menu item over given action.static JComponentcreateMultilineLabel(String text, boolean boldText) Create a new multiline label.static OKCancelDialogcreateOkCancelDialog(Frame parentFrame, String title, boolean modal) Create a dialog with OK and Cancel buttons.static PopupMenuCreate ajavax.swing.JPopupMenuextension that has the look and feel consistent with the pop-up menus from oXygen.static JRadioButtonMenuItemcreateRadioMenuItem(Action action) Create a radio button menu item over given action.static JScrollPanecreateScrollPane(Component view, int vsbPolicy, int hsbPolicy) Creates aScrollPanethat displays a view component in a viewport whose view position can be controlled with a pair of scrollbars.static SplitMenuButtoncreateSplitMenuButton(String defaultText, Icon defaultIcon, boolean updateText, boolean updateIcon, boolean alwaysShowMenu, boolean setSelectedActionAsDefault) Create a split menu button.static TablecreateTable(TableModel tableModel) Create ajavax.swing.JTableextension that has the look and feel consistent with the tables from oXygen.static JTextAreacreateTextArea(String contentType) Create ajavax.swing.JTextAreaextension with undo/redo support.static JTextAreacreateTextArea(String contentType, boolean highlightCurrentLine) Create ajavax.swing.JTextAreaextension extension with undo/redo support.static JTextAreacreateTextArea(String contentType, boolean highlightCurrentLine, boolean indentOnEnter) Create ajavax.swing.JTextAreaextension extension with undo/redo support.static TextFieldCreate ajavax.swing.JTextFieldextension with undo/redo support.static JButtoncreateToolbarButton(Action action, boolean showText) Create a toolbar button.static JButtoncreateToolbarToggleButton(Action action, boolean showText) Create a toolbar toggle button.static TreecreateTree(TreeModel model) Create ajavax.swing.JTreeextension that has a look and feel consistent with the trees used in oXygen.static JToolTipinstallMultilineTooltip(JComponent component) Installs a new multiline tooltip on a component.
-
Method Details
-
createButton
Create a button.- Parameters:
action- The action associated with the button.- Returns:
- the button.
-
createColorChooserButton
Create a button that presents a color chooser.- Parameters:
currentColor- The color to set as current/selected.- Returns:
- The button.
-
createMenu
Create ajavax.swing.JMenuextension that has the look and feel consistent with the menus from oXygen.- Parameters:
menuName- The menu's name.- Returns:
- the menu.
-
createOkCancelDialog
Create a dialog with OK and Cancel buttons.- Parameters:
parentFrame- The parent frame. Can benull, in which case it will be auto-detected.title- The dialog title.modal-trueif modal.- Returns:
- the dialog.
-
createPopupMenu
Create ajavax.swing.JPopupMenuextension that has the look and feel consistent with the pop-up menus from oXygen.- Returns:
- the pop-up menu.
-
createSplitMenuButton
public static SplitMenuButton createSplitMenuButton(String defaultText, Icon defaultIcon, boolean updateText, boolean updateIcon, boolean alwaysShowMenu, boolean setSelectedActionAsDefault) Create a split menu button. This a component representing a combination of a button and a menu. There is a line in the component that splits it into the two aforementioned sub-components. The part before the line is a button, and can be clicked in order to trigger an action. The part after the line is a menu.- Parameters:
defaultText- The default text, used when there is no action set explicitly. Can benull.defaultIcon- The default icon, used when there is no action set explicitly. Can benull.updateText-trueto update the text of the button when selecting an action.updateIcon-trueto update the icon of the button when selecting an action.alwaysShowMenu-trueif pressing the button should always display the associated menu.setSelectedActionAsDefault-trueto promote the selected action, setting it as the current/default action of the button.- Returns:
- the button.
-
createTable
Create ajavax.swing.JTableextension that has the look and feel consistent with the tables from oXygen.- Parameters:
tableModel- The table's model.- Returns:
- the table.
-
createTextField
Create ajavax.swing.JTextFieldextension with undo/redo support. It also has an "edit" contextual menu (Cut, Copy, Paste, etc.).- Returns:
- the text field.
-
createToolbarButton
Create a toolbar button.- Parameters:
action- The action to execute.showText-trueto show the text set for the action.- Returns:
- the button.
-
createToolbarToggleButton
Create a toolbar toggle button.- Parameters:
action- The action to execute.showText-trueto show the text set for the action.- Returns:
- the button.
-
createTree
Create ajavax.swing.JTreeextension that has a look and feel consistent with the trees used in oXygen. It uses aTreeCellRendererby default.- Parameters:
model- The model of the tree.- Returns:
- the tree.
-
createMenuItem
Create a menu item over given action.- Parameters:
action- The action to execute.- Returns:
- the menu item.
-
installMultilineTooltip
Installs a new multiline tooltip on a component. In order to install the multiline tooltip you have to override thejavax.swing.JComponent.createToolTip()method of the component and return the result of the current method.- Parameters:
component- The component to install the tooltip on.- Returns:
- The new tooltip component.
- Since:
- 22
-
createMultilineLabel
Create a new multiline label.- Parameters:
text- The content of the multiline component.boldText-trueif the content must be bold,falseotherwise.- Returns:
- A label which will present the given content on multiple lines.
- Since:
- 22.1
-
createComboBox
Create a new Oxygen style combo box.- Parameters:
model- The model of the combo box.- Returns:
- An Oxygen style combo box.
- Since:
- 23
-
createInputURLPanelProvider
public static InputUrlComponentProvider createInputURLPanelProvider(String[] extensions, String filesDescription, String[] initialContent, boolean showEditorVariables, String persistenceKey, LocalFileBrowseType browseType) Create the input url component provider, used to create an URL chooser similar to the ones in the application which can be embedded inside a third party panel.- Parameters:
extensions- Files having this extension will be shown in the file system browser.filesDescription- The file description associated with the extension.initialContent- The initial content of the combo box from the url chooser.showEditorVariables-truefor showing the Editor Variables chooser button.falseotherwise.persistenceKey- The key that will be used to save entries from this URL panel as persistent between sessions. Null to inhibit persistence.browseType- The browse mode for local file browsing: Open file, Save file or Open directory.- Returns:
- The input url component provider which can be used to interact with the component.
- Since:
- 23
-
createScrollPane
Creates aScrollPanethat displays a view component in a viewport whose view position can be controlled with a pair of scrollbars. The scrollbar policies specify when the scrollbars are displayed.- Parameters:
view- The component to display in the viewport.vsbPolicy- Determines when the vertical scrollbar appears in the scrollpane. The possible values are:ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDEDScrollPaneConstants.VERTICAL_SCROLLBAR_NEVERScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS
hsbPolicy- Determines when the horizontal scrollbar appears in the scrollpane. The possible values are:ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDEDScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVERScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS
- Returns:
- The scroll pane.
- Since:
- 24
-
createHTMLEditorPane
Creates aJEditorPaneto edit HTML content.- Parameters:
text- the text to initialize the EditoruseStandardTextFont-trueif the Editor should use the same font as a standard JTextArea.- Returns:
- The JEditorPane
- Since:
- 25.0
-
createTextArea
Create ajavax.swing.JTextAreaextension with undo/redo support. It also has an "edit" contextual menu (Cut, Copy, Paste, etc.). The current line in the text area is highlighted.- Parameters:
contentType- The content type used for color syntax highlight. The content types are available inro.sync.basic.contenttypes.ContentTypes. Ifnull, the plain text content type will be used.- Returns:
- the text area.
- Since:
- 25.0
-
createTextArea
Create ajavax.swing.JTextAreaextension extension with undo/redo support. It also has an "edit" contextual menu (Cut, Copy, Paste, etc.).- Parameters:
contentType- The content type used for color syntax highlight. The content types are available inro.sync.basic.contenttypes.ContentTypes. Ifnull, the plain text content type will be used.highlightCurrentLine-trueto highlight the current line- Returns:
- the text area.
- Since:
- 26.1
-
createTextArea
public static JTextArea createTextArea(String contentType, boolean highlightCurrentLine, boolean indentOnEnter) Create ajavax.swing.JTextAreaextension extension with undo/redo support. It also has an "edit" contextual menu (Cut, Copy, Paste, etc.).- Parameters:
contentType- The content type used for color syntax highlight. The content types are available inro.sync.basic.contenttypes.ContentTypes. Ifnull, the plain text content type will be used.highlightCurrentLine-trueto highlight the current lineindentOnEnter-trueto indent on enter.- Returns:
- the text area.
- Since:
- 28.0
*********************************
EXPERIMENTAL - Subject to change
********************************
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
-
changeContentType
Changes the content type of a text area created with Oxygen API createTextArea(String)- Parameters:
textArea- The text area to change the content type. The text area should be an Oxygen API text areacontentType- The content type used for color syntax highlight. The content types are available inro.sync.basic.contenttypes.ContentTypes. Ifnull, the plain text content type will be used.- Since:
- 25.0
-
createCheckBoxMenuItem
Create a checkbox menu item over given action.- Parameters:
action- The action to execute.- Returns:
- the checkbox menu item.
- Since:
- 27
-
createRadioMenuItem
Create a radio button menu item over given action.- Parameters:
action- The action to execute.- Returns:
- the radio button menu item.
- Since:
- 27
-
createLinkLabel
Create a clickable label which looks like a link. The label renders the specified text and calls the specified action listener when the label is clicked.- Parameters:
text- The specified text to render on the link label.listener- The action listener that is called when the label is clicked. Nevernull.- Returns:
- the link label.
- Since:
- 27.1
-