Class BrowserComponent
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel
com.inductiveautomation.webbrowser.BrowserComponent
- All Implemented Interfaces:
DynamicPropertyProvider,LocaleListener,MutableDynamicPropertyProvider,StyleProvider,ComponentLifecycle,ExtensibleComponent,QualityMonitor,VisionComponent,ImageObserver,MenuContainer,Serializable,Accessible
public class BrowserComponent
extends AbstractVisionPanel
implements LocaleListener, ExtensibleComponent
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BrowserInstanceManagerstatic final intstatic final intFields inherited from class com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel
antialias, context, cursorCode, dynamicPropsFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface com.inductiveautomation.vision.api.client.components.model.ComponentLifecycle
COMPONENT_RUNNINGFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface com.inductiveautomation.ignition.client.model.LocaleListener
LOCAL_CHANGE_EVENTFields inherited from interface com.inductiveautomation.vision.api.client.binding.MutableDynamicPropertyProvider
RESERVED_SET_KEYFields inherited from interface com.inductiveautomation.vision.api.client.components.model.VisionComponent
COMPONENT_LOCKED, COMPONENT_PERMISSIONS, COMPONENT_SECURITY, COMPONENT_TRANSLATIONS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidback()If the browser is able to go back, it will, otherwise does nothing.protected voidvoidvoidexecuteJavaScript(String javaScript) Tries to execute a script.voidforward()If the browser is able to go forward, it will, otherwise does nothing.com.teamdev.jxbrowser.browser.BrowserGets the browser object so advanced users can have at the browser's api.com.teamdev.jxbrowser.view.swing.BrowserViewReturns the JComponent that thatBrowseris held within.booleanintprotected Stringintprotected Stringintprotected Stringbyte[]getImage()Returns a byte array with a jpg of a screen shot of the current browser window.booleanintgetMode()booleanintprotected StringgetTitle()intbooleandoubleprotected voidDoes the initialization for the JxBrowser browser.voidbooleanbooleanprotected voidloadHtml()protected voidprotected voidloadUrl()protected voidvoidlocaleChanged(Locale newLocale) protected JButtonprotected voidSubclasses should override this to provide shutdown logic.protected voidSubclasses should override this to provide startup logic.voidrefresh()Reloads the existing browser object, or creates a new one.protected voidprotected voidprotected voidvoidsetComponentEnabled(boolean componentEnabled) voidvoidsetCurrentHtml(String notUsed) voidvoidsetCurrentUrl(String currentUrl) voidvoidsetFtpProxyPort(int ftpProxyPort) voidsetFtpProxyServer(String ftpProxyServer) voidsetHttpProxyPort(int httpProxyPort) voidsetHttpProxyServer(String httpProxyServer) voidsetHttpsProxyPort(int httpsProxyPort) voidsetHttpsProxyServer(String httpsProxyServer) voidsetIsLoaded(boolean isLoaded) voidsetMode(int mode) voidsetPopupsAllowed(boolean popupsAllowed) voidsetProxyExceptions(String proxyExceptions) voidsetProxyPassword(String proxyPassword) voidsetProxyUsername(String proxyUsername) voidsetShowNavigation(boolean showNavigation) voidsetSocksProxyPort(int socksProxyPort) voidsetSocksProxyServer(String socksProxyServer) voidsetStartingHtml(String html) voidsetStartingUrl(String url) voidvoidsetTouchscreenMode(int touchscreenMode) voidsetUseProxies(boolean useProxies) voidsetUseProxyAuthentication(boolean useAuthentication) voidsetZoomLevel(double zoomLevel) protected voidMethods inherited from class com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel
getAppContext, getCursorCode, getDataQuality, getDynamicProps, getProperties, getPropertyValue, getQuality, getStyles, getToolTipText, initStyleListener, isAntialias, isComponentRunning, isPropertyDefined, paintChildren, paintComponent, paintOverlayOverChildren, setAntialias, setCursorCode, setDataQuality, setDynamicProps, setName, setPropertyValue, setQuality, setStyles, setToolTipText, setVisible, shutdownComponent, startupComponent, translate, updateQualityMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, 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, 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, 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, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.inductiveautomation.vision.api.client.components.model.ComponentLifecycle
getAppContext, shutdownComponent, startupComponent
-
Field Details
-
MODE_URL
public static final int MODE_URL- See Also:
-
MODE_HTML
public static final int MODE_HTML- See Also:
-
INSTANCE_MANAGER
-
-
Constructor Details
-
BrowserComponent
public BrowserComponent()
-
-
Method Details
-
initBrowser
protected void initBrowser()Does the initialization for the JxBrowser browser. May be called multiple times during the lifecycle of the web browser component, because some changes in settings may require closing of the old browser and creating a new one.Engine should only be null if no supported OS was detected. In that case, we'll have added a UNSUPPORTED_OS_LABEL which will get displayed. The nullness of browserContext won't change while the client is open.
-
getHttpServerPair
-
getHttpsServerPair
-
getFtpServerPair
-
getSocksServerPair
-
onStartup
protected void onStartup()Description copied from class:AbstractVisionPanelSubclasses should override this to provide startup logic.- Overrides:
onStartupin classAbstractVisionPanel
-
onShutdown
protected void onShutdown()Description copied from class:AbstractVisionPanelSubclasses should override this to provide shutdown logic.- Overrides:
onShutdownin classAbstractVisionPanel
-
getBrowser
public com.teamdev.jxbrowser.browser.Browser getBrowser()Gets the browser object so advanced users can have at the browser's api. In previous versions of this module, the Browser object was a JComponent that provided component interaction features. Since module version 4.0.0, this object is now only a reference to the internal browser object, which is wrapped in aBrowserViewcomponent for display purposes. If trying access to theBrowserViewJComponent, callgetBrowserView().Note that the Browser may be in a 'closed' state, and must be checked for this state before using.
- Returns:
- the instance of the
Browser - Since:
- 4.0.0
-
getBrowserView
@Nullable public com.teamdev.jxbrowser.view.swing.BrowserView getBrowserView()Returns the JComponent that thatBrowseris held within.- Returns:
- the
BrowserViewcomponent. - Since:
- WebBrowser Module version 4.0.0
-
setStartingUrl
-
getStartingUrl
-
setStartingHtml
-
getStartingHtml
-
setTitle
-
getTitle
-
setCurrentUrl
public void setCurrentUrl() -
setCurrentUrl
-
getComponentEnabled
public boolean getComponentEnabled() -
setComponentEnabled
public void setComponentEnabled(boolean componentEnabled) -
enableComponent
public void enableComponent() -
getCurrentUrl
-
setCurrentHtml
public void setCurrentHtml() -
setCurrentHtml
-
getCurrentHtml
-
setIsLoaded
public void setIsLoaded(boolean isLoaded) -
getIsLoaded
public boolean getIsLoaded() -
getMode
public int getMode() -
setMode
public void setMode(int mode) -
setPopupsAllowed
public void setPopupsAllowed(boolean popupsAllowed) -
getPopupsAllowed
public boolean getPopupsAllowed() -
setZoomLevel
public void setZoomLevel(double zoomLevel) -
getZoomLevel
public double getZoomLevel() -
setUseProxies
public void setUseProxies(boolean useProxies) -
getUseProxies
public boolean getUseProxies() -
setHttpProxyServer
-
getHttpProxyServer
-
setHttpsProxyServer
-
getHttpsProxyServer
-
setFtpProxyServer
-
getFtpProxyServer
-
setProxyExceptions
-
getProxyExceptions
-
setHttpProxyPort
public void setHttpProxyPort(int httpProxyPort) -
getHttpProxyPort
public int getHttpProxyPort() -
setHttpsProxyPort
public void setHttpsProxyPort(int httpsProxyPort) -
getHttpsProxyPort
public int getHttpsProxyPort() -
setFtpProxyPort
public void setFtpProxyPort(int ftpProxyPort) -
getSocksProxyServer
-
setSocksProxyServer
-
getSocksProxyPort
public int getSocksProxyPort() -
setSocksProxyPort
public void setSocksProxyPort(int socksProxyPort) -
getFtpProxyPort
public int getFtpProxyPort() -
setUseProxyAuthentication
public void setUseProxyAuthentication(boolean useAuthentication) -
isUseProxyAuthentication
public boolean isUseProxyAuthentication() -
setProxyUsername
-
getProxyUsername
-
setProxyPassword
-
getProxyPassword
-
getTouchscreenMode
public int getTouchscreenMode() -
setTouchscreenMode
public void setTouchscreenMode(int touchscreenMode) -
reloadStarting
protected void reloadStarting() -
reloadCurrent
protected void reloadCurrent() -
reload
-
loadUrl
protected void loadUrl() -
loadUrl
-
loadHtml
protected void loadHtml() -
loadHtml
-
stopLoading
protected void stopLoading() -
initPopupBehavior
public void initPopupBehavior() -
back
public void back()If the browser is able to go back, it will, otherwise does nothing. -
forward
public void forward()If the browser is able to go forward, it will, otherwise does nothing. -
refresh
public void refresh()Reloads the existing browser object, or creates a new one. This allows reload to work even if the browser has crashed. -
disposeAndInit
protected void disposeAndInit() -
executeJavaScript
Tries to execute a script. Does not check to see if the script parses, is valid javascript, or will actually do anything useful- Parameters:
javaScript- String with JavaScript to execute.
-
getImage
public byte[] getImage()Returns a byte array with a jpg of a screen shot of the current browser window. -
newButton
-
localeChanged
- Specified by:
localeChangedin interfaceLocaleListener- Overrides:
localeChangedin classAbstractVisionPanel
-
getExtensionFunctions
- Specified by:
getExtensionFunctionsin interfaceExtensibleComponent
-
setExtensionFunctions
- Specified by:
setExtensionFunctionsin interfaceExtensibleComponent
-