|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.peace_tools.views.DetailView
abstract class DetailView
A common base class shared by JobDetailsView and ServerJobsView. This is a common base class that is shared between two very similar DetailView classes, namely JobDetailsView and ServerDetailsView. The base class houses several of the commonly used features of these two detail viewer classes, such as:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
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 | |
---|---|
(package private) javax.swing.JProgressBar |
progressBar
The progress bar that is placed in indeterminate mode to indicate to the user that the job data is being download. |
(package private) javax.swing.JButton |
refreshButton
The refresh button that the user can click to reload the job information. |
private static javax.swing.text.StyleContext |
sc
A shared style context that contains the various styles that are used to layout information in the DefaultStyledDocument objects created and used by this class. |
private static long |
serialVersionUID
A generated serialization UID just to keep the Java compiler happy. |
protected Server |
server
The server from where the details are bing displayed. |
(package private) javax.swing.JLabel |
timestamp
This label is used to display the time stamp when the job information was last updated. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, 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 |
---|
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 |
Constructor Summary | |
---|---|
DetailView(java.lang.String idTitle,
java.lang.String idValue,
Server server)
The constructor. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent arg0)
Method to intercept clicks on "Refresh" button. |
protected javax.swing.JTabbedPane |
createOutputDocs(javax.swing.text.DefaultStyledDocument[] outputs,
java.lang.String[] TabNames)
Helper method to create styled documents. |
private static void |
createStyles()
Helper method to check and create styles. |
private javax.swing.JPanel |
createTopPanel(java.lang.String idTitle,
java.lang.String idValue)
Helper method to create the controls displayed at the top. |
protected void |
runCommand(ServerSession session,
java.lang.String command,
java.lang.String option,
java.lang.String[] streams)
Helper method to run the job runner on the server and return outputs. |
protected void |
updateDocument(javax.swing.text.DefaultStyledDocument doc,
java.lang.String title,
java.lang.String text,
java.lang.String textStyle)
Helper method to update information in a document. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods 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, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.lang.Runnable |
---|
run |
Field Detail |
---|
javax.swing.JButton refreshButton
javax.swing.JProgressBar progressBar
javax.swing.JLabel timestamp
protected final Server server
private static javax.swing.text.StyleContext sc
private static final long serialVersionUID
Constructor Detail |
---|
public DetailView(java.lang.String idTitle, java.lang.String idValue, Server server)
idTitle
- The label or title to be displayed for the
ID value. This value is "Job ID" or "User ID".idValue
- The actual value to be displayed for the label.
This is typically a job ID or a user ID depending on the type
of the detail view.server
- The server from where the details are to be
displayed.Method Detail |
---|
public void actionPerformed(java.awt.event.ActionEvent arg0)
Note: The derived class must implement the Runnable.run() method.
actionPerformed
in interface java.awt.event.ActionListener
arg0
- The action event associated with a button
click. This event is not really used. So you can call this
method with null as parameter.protected void updateDocument(javax.swing.text.DefaultStyledDocument doc, java.lang.String title, java.lang.String text, java.lang.String textStyle) throws javax.swing.text.BadLocationException
doc
- The document whose information is to be cleared
and then updated.title
- The title for the document.text
- The actual content to be displayed in the document.textStyle
- A predefined style to be set for the text.
javax.swing.text.BadLocationException
- This method simply exposes the
exception generated by the document.protected void runCommand(ServerSession session, java.lang.String command, java.lang.String option, java.lang.String[] streams) throws java.lang.Exception
session
- The server session to be used to execute the
command. The command should include the complete path in it
without the suffix. This method adds a ".sh" or ".bat"
suffix to the command before executing it.command
- The command to be run to via the specified
session.option
- The command line option to be passed to the
job runner script as the command line parameter. If a command
does not have any options then set the option to an empty
string ("").streams
- The standard output and error streams that were
returned by running the job runnser script with the specified
option.
java.lang.Exception
private static void createStyles()
protected javax.swing.JTabbedPane createOutputDocs(javax.swing.text.DefaultStyledDocument[] outputs, java.lang.String[] TabNames)
outputs
- The array that must contain the various styled
documents to be created by this method.TabNames
- The titles for the various tabs to be created
by this method. The number of titles must match the list of
outputs -- that is, outputs.length == TabNames.length.
private javax.swing.JPanel createTopPanel(java.lang.String idTitle, java.lang.String idValue)
idTitle
- The label or title to be displayed for the
ID value. This value is "Job ID" or "User ID".idValue
- The actual value to be displayed for the label.
This is typically a job ID or a user ID depending on the type
of the detail view.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |