Class ViewWorkspace
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JTabbedPane
-
- com.jidesoft.swing.JideTabbedPane
-
- com.inductiveautomation.ignition.designer.tabbedworkspace.TabbedResourceWorkspace
-
- com.inductiveautomation.perspective.designer.workspace.ViewWorkspace
-
- All Implemented Interfaces:
ResourceWorkspace
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
,javax.swing.SwingConstants
public class ViewWorkspace extends TabbedResourceWorkspace
This is theResourceWorkspace
for perspective View resources. Each view resource is represented as a JSON encoded document (nb: not Ignition's typical XML serialized format). The views are edited in an embedded JXBrowser web browser instance which points to a special URL on the gateway which loads the view in design mode.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ViewWorkspace.Actions
This class acts as a way to organize the actions and associated logic so they don't litter the ViewWorkspace itselfstatic class
ViewWorkspace.NewViewAction
static class
ViewWorkspace.ReorderType
static class
ViewWorkspace.TabbedPaneUI
-
Nested classes/interfaces inherited from class com.jidesoft.swing.JideTabbedPane
com.jidesoft.swing.JideTabbedPane.ColorProvider, com.jidesoft.swing.JideTabbedPane.GradientColorProvider, com.jidesoft.swing.JideTabbedPane.IgnoreableSingleSelectionModel, com.jidesoft.swing.JideTabbedPane.NoFocusButton, com.jidesoft.swing.JideTabbedPane.PageLastFocusTracker, com.jidesoft.swing.JideTabbedPane.TabListCellRenderer
-
Nested classes/interfaces inherited from class javax.swing.JTabbedPane
javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description ViewWorkspace.Actions
actions
static com.inductiveautomation.ignition.common.gson.Gson
GSON
static java.lang.String
WORKSPACE_KEY
-
Fields inherited from class com.inductiveautomation.ignition.designer.tabbedworkspace.TabbedResourceWorkspace
context, descriptor, editors, listeners, rootNode
-
Fields inherited from class com.jidesoft.swing.JideTabbedPane
_focusChangeListener, _tabEditingAllowed, _tabEditValidator, BOLDACTIVETAB_PROPERTY, BOX_STYLE_PROPERTY, BUTTON_CLOSE, BUTTON_EAST, BUTTON_LIST, BUTTON_NORTH, BUTTON_SOUTH, BUTTON_WEST, COLOR_THEME_DEFAULT, COLOR_THEME_OFFICE2003, COLOR_THEME_VSNET, COLOR_THEME_WIN2K, COLOR_THEME_WINXP, GRIPPER_PROPERTY, HIDE_IF_ONE_TAB_PROPERTY, ONENOTE_COLOR_PROVIDER, PROPERTY_COLOR_THEME, PROPERTY_CONTENT_BORDER_INSETS, PROPERTY_DRAG_OVER_DISABLED, PROPERTY_SELECTED_INDEX, PROPERTY_SHOW_CLOSE_BUTTON_ON_MOUSE_OVER, PROPERTY_TAB_AREA_INSETS, PROPERTY_TAB_COLOR_PROVIDER, PROPERTY_TAB_INSETS, PROPERTY_TAB_LEADING_COMPONENT, PROPERTY_TAB_RESIZE_MODE, PROPERTY_TAB_SHAPE, PROPERTY_TAB_TRAILING_COMPONENT, RESIZE_MODE_COMPRESSED, RESIZE_MODE_DEFAULT, RESIZE_MODE_FIT, RESIZE_MODE_FIXED, RESIZE_MODE_NONE, SCROLL_TAB_ON_WHEEL_PROPERTY, SHAPE_BOX, SHAPE_DEFAULT, SHAPE_ECLIPSE, SHAPE_ECLIPSE3X, SHAPE_EXCEL, SHAPE_FLAT, SHAPE_OFFICE2003, SHAPE_ROUNDED_FLAT, SHAPE_ROUNDED_VSNET, SHAPE_VSNET, SHAPE_WINDOWS, SHAPE_WINDOWS_SELECTED, SHOW_CLOSE_BUTTON_ON_TAB_PROPERTY, SHOW_CLOSE_BUTTON_PROPERTY, SHOW_ICONS_PROPERTY, SHOW_TAB_AREA_PROPERTY, SHOW_TAB_BUTTONS_PROPERTY, SHOW_TAB_CONTENT_PROPERTY, SHRINK_TAB_PROPERTY, TAB_CLOSABLE_PROPERTY, USE_DEFAULT_SHOW_CLOSE_BUTTON_ON_TAB_PROPERTY, USE_DEFAULT_SHOW_ICONS_PROPERTY
-
Fields inherited from class javax.swing.JTabbedPane
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT
-
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
-
-
Constructor Summary
Constructors Constructor Description ViewWorkspace(DesignerContext context, boolean jxBrowserInitialized)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDesignAdapterChangeListener(java.util.function.Consumer<DesignAdapter> listener)
void
addNewResourceActions(ResourceFolderNode folder, javax.swing.JPopupMenu menu)
This is where you add the menu items to create new nodes.com.teamdev.jxbrowser.chromium.BrowserContext
browserContext()
Share custom browser context is used among all the browser windows to avoid possible errors in file access, as well as collisions due to other designers/clients running their own instances of JxBrowser.protected AbstractNavTreeNode
createRootNavTreeNode()
com.teamdev.jxbrowser.chromium.BrowserContext
debugContext()
static java.lang.String
getDesignUrl(DesignerContext context)
DelegatingEditActionHandler
getEditActionHandler()
The handler that responds to common edit actions, like cut, copy, paste, and deletejava.util.Collection<ResourceWorkspaceFrame>
getFrames()
Returns a collection ofResourceWorkspaceFrame
s that will be associated with this workspace.java.lang.String
getKey()
Returns a keyname for the workspace.MenuBarMerge
getMenu()
Returns a menu merge for the menu options that should be present when this workspace is active.protected MutableNavTreeNode
getNavTreeNodeParent()
Get the MutableNavTreeNode that this workspace's node should be installed in.DesignAdapter
getSelectedBridgeAdapter()
protected javax.swing.JPopupMenu
getTabPopupMenu(ResourceEditor resourceEditor)
Extend to add custom right click actions to individual tabsjava.util.List<com.jidesoft.action.CommandBar>
getToolbars()
Returns the toolbars that will be added when this workspace is active.ViewDropTargets
getViewDropTargets()
ViewResourceEditor
getViewEditor()
boolean
isJxBrowserLoaded()
boolean
isPreviewing()
boolean
isSaving()
protected ResourceEditor
newResourceEditor(ResourcePath resourcePath)
This is where you create a newResourceEditor
for displaying and editing your resource.void
notifyProjectSaveDone()
void
notifyProjectSaveStart()
void
onActivation()
Called when the resource workspace will become the active workspace and will be displayed.void
onDeactivation()
Called when the resource workspace will be swapped out for a different workspace.void
open(java.lang.String viewPath)
void
removeBridgeAdapterChangeListener(java.util.function.Consumer<DesignAdapter> listener)
void
setZoomIndicator(ZoomIndicator zoomIndicator)
void
shutdown()
void
stylesUpdated(java.lang.String styles)
-
Methods inherited from class com.inductiveautomation.ignition.designer.tabbedworkspace.TabbedResourceWorkspace
addTabbedWorkspaceListener, close, close, commit, commitAll, findEditor, getContext, getDescriptor, getEditors, getRootNode, getSelectedEditor, getWorkspace, isOpen, open, registerNavTreeNode, removeTabbedWorkspaceListener, resetFrames
-
Methods inherited from class com.jidesoft.swing.JideTabbedPane
add, addNotify, addTabEditingListener, calculateTabListPopupPosition, cancelTabEditing, clearVisComp, createFocusChangeListener, createNoFocusButton, createTabList, createTabListPopup, editTabAt, fireStateChanged, fireTabEditing, getCloseAction, getColorTheme, getContentBorderInsets, getDefaultColorTheme, getDefaultTabResizeMode, getDefaultTabStyle, getDisplayTitleAt, getEditingTabIndex, getIconForTab, getLastFocusedComponent, getPageLastFocusTrackers, getResourceString, getSelectedTabFont, getStringConverter, getTabAlignment, getTabAreaInsets, getTabAtLocation, getTabColorProvider, getTabEditingListeners, getTabEditingValidator, getTabHeight, getTabInsets, getTabLeadingComponent, getTabListCellRenderer, getTabResizeMode, getTabShape, getTabTrailingComponent, getUI, getUIClassID, hasFocusComponent, hideTabListPopup, insertTab, isAutoFocusOnTabHideClose, isAutoRequestFocus, isBoldActiveTab, isCloseTabOnMouseMiddleButton, isDragOverDisabled, isHideOneTab, isHideTrailingWhileNoButtons, isLayoutTrailingComponentBeforeButtons, isRightClickSelect, isScrollSelectedTabOnWheel, isShowCloseButton, isShowCloseButtonOnMouseOver, isShowCloseButtonOnSelectedTab, isShowCloseButtonOnTab, isShowGripper, isShowIconsOnTab, isShowTabArea, isShowTabButtons, isShowTabContent, isSuppressSetSelectedIndex, isSuppressStateChangedEvents, isTabClosableAt, isTabEditing, isTabEditingAllowed, isTabListPopupVisible, isTabShown, isUseDefaultShowCloseButtonOnTab, isUseDefaultShowIconsOnTab, moveSelectedTabTo, popupSelectedIndex, processMouseSelection, removeAll, removeNotify, removeTabAt, removeTabEditingListener, repaintContentBorder, repaintTabAreaAndContentBorder, requestFocusForVisibleComponent, resetDefaultCloseAction, scrollSelectedTabToVisible, setAutoFocusOnTabHideClose, setAutoRequestFocus, setBoldActiveTab, setCloseAction, setCloseTabOnMouseMiddleButton, setColorTheme, setComponentAt, setContentBorderInsets, setDragOverDisabled, setHideOneTab, setHideTrailingWhileNoButtons, setLayoutTrailingComponentBeforeButtons, setRightClickSelect, setScrollSelectedTabOnWheel, setSelectedIndex, setSelectedTabFont, setShowCloseButton, setShowCloseButtonOnMouseOver, setShowCloseButtonOnSelectedTab, setShowCloseButtonOnTab, setShowGripper, setShowIconsOnTab, setShowTabArea, setShowTabButtons, setShowTabContent, setStringConverter, setSuppressSetSelectedIndex, setSuppressStateChangedEvents, setTabAlignment, setTabAreaInsets, setTabClosableAt, setTabColorProvider, setTabEditingAllowed, setTabEditingValidator, setTabInsets, setTabLeadingComponent, setTabListCellRenderer, setTabResizeMode, setTabShape, setTabTrailingComponent, setUI, setUseDefaultShowCloseButtonOnTab, setUseDefaultShowIconsOnTab, showTabListPopup, stopTabEditing, updateUI
-
Methods inherited from class javax.swing.JTabbedPane
add, add, add, add, addChangeListener, addTab, addTab, addTab, createChangeListener, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabComponentAt, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, indexOfTabComponent, isEnabledAt, paramString, remove, remove, removeChangeListener, setBackgroundAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setTabComponentAt, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, 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, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, getFocusCycleRootAncestor, 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, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
WORKSPACE_KEY
public static final java.lang.String WORKSPACE_KEY
- See Also:
- Constant Field Values
-
actions
public final ViewWorkspace.Actions actions
-
GSON
public static final com.inductiveautomation.ignition.common.gson.Gson GSON
-
-
Constructor Detail
-
ViewWorkspace
public ViewWorkspace(DesignerContext context, boolean jxBrowserInitialized)
-
-
Method Detail
-
open
public void open(java.lang.String viewPath)
-
addDesignAdapterChangeListener
public void addDesignAdapterChangeListener(java.util.function.Consumer<DesignAdapter> listener)
-
removeBridgeAdapterChangeListener
public void removeBridgeAdapterChangeListener(java.util.function.Consumer<DesignAdapter> listener)
-
getViewDropTargets
public ViewDropTargets getViewDropTargets()
-
getNavTreeNodeParent
protected MutableNavTreeNode getNavTreeNodeParent()
Description copied from class:TabbedResourceWorkspace
Get the MutableNavTreeNode that this workspace's node should be installed in.- Overrides:
getNavTreeNodeParent
in classTabbedResourceWorkspace
-
getMenu
public MenuBarMerge getMenu()
Description copied from interface:ResourceWorkspace
Returns a menu merge for the menu options that should be present when this workspace is active. May be null.- Specified by:
getMenu
in interfaceResourceWorkspace
- Overrides:
getMenu
in classTabbedResourceWorkspace
-
isJxBrowserLoaded
public boolean isJxBrowserLoaded()
-
notifyProjectSaveStart
public void notifyProjectSaveStart()
-
notifyProjectSaveDone
public void notifyProjectSaveDone()
-
isSaving
public boolean isSaving()
-
getKey
public java.lang.String getKey()
Description copied from interface:ResourceWorkspace
Returns a keyname for the workspace. Used by nav tree nodes to specify which workspace to switch to when they are selected.
-
getViewEditor
public ViewResourceEditor getViewEditor()
-
newResourceEditor
protected ResourceEditor newResourceEditor(ResourcePath resourcePath)
Description copied from class:TabbedResourceWorkspace
This is where you create a newResourceEditor
for displaying and editing your resource.- Specified by:
newResourceEditor
in classTabbedResourceWorkspace
- Parameters:
resourcePath
- the id of the resource an editor is being created for
-
getSelectedBridgeAdapter
public DesignAdapter getSelectedBridgeAdapter()
-
getFrames
public java.util.Collection<ResourceWorkspaceFrame> getFrames()
Description copied from interface:ResourceWorkspace
Returns a collection ofResourceWorkspaceFrame
s that will be associated with this workspace. May be null or empty.- Specified by:
getFrames
in interfaceResourceWorkspace
- Overrides:
getFrames
in classTabbedResourceWorkspace
-
createRootNavTreeNode
protected AbstractNavTreeNode createRootNavTreeNode()
- Overrides:
createRootNavTreeNode
in classTabbedResourceWorkspace
-
addNewResourceActions
public void addNewResourceActions(ResourceFolderNode folder, javax.swing.JPopupMenu menu)
Description copied from class:TabbedResourceWorkspace
This is where you add the menu items to create new nodes.- Specified by:
addNewResourceActions
in classTabbedResourceWorkspace
- See Also:
NewResourceAction
-
getTabPopupMenu
protected javax.swing.JPopupMenu getTabPopupMenu(@Nullable ResourceEditor resourceEditor)
Description copied from class:TabbedResourceWorkspace
Extend to add custom right click actions to individual tabs- Overrides:
getTabPopupMenu
in classTabbedResourceWorkspace
- Parameters:
resourceEditor
- the resource editor in the tab under the cursor
-
browserContext
public com.teamdev.jxbrowser.chromium.BrowserContext browserContext()
Share custom browser context is used among all the browser windows to avoid possible errors in file access, as well as collisions due to other designers/clients running their own instances of JxBrowser.
-
debugContext
public com.teamdev.jxbrowser.chromium.BrowserContext debugContext()
-
getToolbars
public java.util.List<com.jidesoft.action.CommandBar> getToolbars()
Description copied from interface:ResourceWorkspace
Returns the toolbars that will be added when this workspace is active. May be null or empty.- Specified by:
getToolbars
in interfaceResourceWorkspace
- Overrides:
getToolbars
in classTabbedResourceWorkspace
-
onActivation
public void onActivation()
Description copied from interface:ResourceWorkspace
Called when the resource workspace will become the active workspace and will be displayed.- Specified by:
onActivation
in interfaceResourceWorkspace
- Overrides:
onActivation
in classTabbedResourceWorkspace
-
onDeactivation
public void onDeactivation()
Description copied from interface:ResourceWorkspace
Called when the resource workspace will be swapped out for a different workspace.- Specified by:
onDeactivation
in interfaceResourceWorkspace
- Overrides:
onDeactivation
in classTabbedResourceWorkspace
-
getEditActionHandler
public DelegatingEditActionHandler getEditActionHandler()
Description copied from interface:ResourceWorkspace
The handler that responds to common edit actions, like cut, copy, paste, and delete- Specified by:
getEditActionHandler
in interfaceResourceWorkspace
- Overrides:
getEditActionHandler
in classTabbedResourceWorkspace
-
isPreviewing
public boolean isPreviewing()
-
shutdown
public void shutdown()
-
stylesUpdated
public void stylesUpdated(java.lang.String styles)
-
setZoomIndicator
public void setZoomIndicator(ZoomIndicator zoomIndicator)
-
getDesignUrl
public static java.lang.String getDesignUrl(DesignerContext context)
-
-