de.cbse.jeasy
Class JETips
java.lang.Object
de.cbse.jeasy.JEObject
de.cbse.jeasy.JETips
public class JETips
- extends JEObject
A JETips reads tips of a day out of an XML file and/or a String .
If you show the tips in an editorpane (see RunExample.java) html syntax can be used.
The format of the XML file or string is:
<tipsofday>
<tips>
<tip>your tip</tip>
</tips>
</tipsofday>
Properties :
- id
The unique id of the root object.
- referenceId
A reference for this jeasy object used to identify this type of jeasy object even if it was cloned. It is used for locale properties of the object and may be used for identification in messages. If no reference is set, the jeasy id will be set as default.
- fileName
Name of a file or resource.
- randomTip
Arrange the tips in a random order.
- tipEditor
Edit tips of the day in XML format. Roottag is tipsofday, the tag for tip is tip.
- Author:
- Harry Pfohl
|
Field Summary |
(package private) boolean |
brandom
|
(package private) java.lang.String |
filename
|
(package private) java.lang.String |
id
|
(package private) int |
number
|
(package private) int |
size
|
(package private) java.lang.String |
tips
|
(package private) java.util.Vector |
v
|
| Fields inherited from class de.cbse.jeasy.JEObject |
aaa, ACTIVITYBAR, ANIMATION, BORDER, BUSINESSOBJECT_NAME, BUTTON, BUTTONGROUP, CHECKBOX, CHECKBOXMENUITEM, COLOR, COMBOBOX, ComboBoxButtonWidth, COMBOLIST, CONSTRAINTS, CONTEXT_HELP_FOCUS_GAINED, CONTEXT_HELP_FOCUS_LOST, CONTEXT_HELP_MOUSE_ENTERED, CONTEXT_HELP_MOUSE_EXITED, DATAFIELD, DATATYPE, DESKTOPPANE, DIALOG, EDITORPANE, FONT, FORMAT, FRAME, GANTTGRID, GLOBAL, GRADIENTPAINT, HELP, ICON, ID_JESTART, INPUT_ERROR_DATE, INPUT_ERROR_LENGTH, INPUT_ERROR_MANDATORY, INPUT_ERROR_PARSE, INPUT_ERROR_RANGE, INPUT_ERROR_REGULAREXPRESSION, INPUT_ERROR_TIME, INPUT_ERRORS, INSETS, INTERNALFRAME, intType, LABEL, LIST, LOCALE, MENU, MENUBAR, MENUITEM, MESSAGE, METHODINVOCATION, NO_CONSTANT, NO_INPUT_ERROR, OPTIONPANE, PANEL, parentId, POPUP, PROGRESSBAR, PROPERTIE_NAME, propertyHashMap, RADIOBUTTON, RADIOBUTTONMENUITEM, refresh, SPINNER, SPLITPANE, START, STORE, STRING, TABBEDPANE, TABLE, TASKPANE, TEXTUREPAINT, THEME, TIPS, TOOLBAR, TREE, TREENODE, type, WINDOW |
|
Method Summary |
java.lang.String |
getFilename()
Method getFilename |
int |
getSize()
Returns the number of tips |
java.lang.String |
gettips()
Method gettips |
void |
init()
Creates Java or SWING objects with the given properties. |
java.lang.String |
nextTip()
Gets the next tip |
java.lang.String |
previousTip()
Gets the previous tip |
void |
randomize()
Randomizes the order of the tips |
void |
setFilename(java.lang.String filename)
Method setFilename |
void |
setNumber(int number)
Sets the number of the tip that you can get by nextTip
The first tip has the number 0. |
void |
settips(java.lang.String tips)
Method settips |
| Methods inherited from class de.cbse.jeasy.JEObject |
clearPreview, clone, getApplLocale, getBorderConstantProperty, getBorderProperty, getCharGProperty, getCharProperty, getColorProperty, getConstraintsProperty, getFontProperty, getGProperty, getGradientPaintProperty, getId, getImageConstantProperty, getImageIconProperty, getInsetsProperty, getJEGlobal, getJETexturePaintProperty, getLayoutProperty, getLocaleProperties, getObjectsHashMap, getObjectsNonPreviewHashMap, getParentId, getPreviewHashMap, getPreviewObject, getProjectDirectory, getPropertieHashMap, getProperty, getProperty, getPropertyAsArray, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsInteger, getPropertyAsObject, getPropertyAsObject, getPropertyAsVector, getPropertyAsVector, getReferenceButtonBehind, getReferenceId, getRegisterText, getResourceUrl, getRootPane, getRootPaneId, getSwingConstantProperty, getTabbedPaneConstantProperty, getTexturePaintProperty, getType, getUniqueNumber, hasSuperclass, invoke, invoke, invoke, invoke, isApplet, isEnterprise, isGlobalAnimation, isGlobalListening, isInited, isPreview, isPreviewMember, isProfessional, isRefresh, isSetuped, isStandard, registerJEObject, removeProperties, removeProperty, removeProperty, setApplet, setApplLocale, setGlobalAnimation, setGlobalListening, setInited, setJeGlobal, setLocaleProperties, setParentId, setPreview, setPreviewHashMap, setPreviewMember, setPreviewObject, setProjectDirectory, setPropertieHashMap, setProperties, setProperties, setProperty, setProperty, setRefresh, setRootPane, setRootPaneId, setSetuped, setType, setupComponent, show, timerTask |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
id
java.lang.String id
filename
java.lang.String filename
tips
java.lang.String tips
v
java.util.Vector v
size
int size
number
int number
brandom
boolean brandom
JETips
public JETips()
- Constructor
JETips
public JETips(JELocaleProperties hm)
- Reads the properties from a HashMap
- Parameters:
hm - HashMap
JETips
public JETips(JENode jen)
- Constructor based on a XML file parsed to a TreeNode.
- Parameters:
jen - - See Also:
JESaxParser
setFilename
public void setFilename(java.lang.String filename)
- Method setFilename
- Parameters:
filename - a String
getFilename
public java.lang.String getFilename()
- Method getFilename
- Returns:
- a String
settips
public void settips(java.lang.String tips)
- Method settips
- Parameters:
tips - a String
gettips
public java.lang.String gettips()
- Method gettips
- Returns:
- a String
setNumber
public void setNumber(int number)
- Sets the number of the tip that you can get by nextTip
The first tip has the number 0.
- Parameters:
size - an int
getSize
public int getSize()
- Returns the number of tips
- Returns:
- an int
randomize
public void randomize()
- Randomizes the order of the tips
nextTip
public java.lang.String nextTip()
- Gets the next tip
previousTip
public java.lang.String previousTip()
- Gets the previous tip
init
public void init()
- Description copied from class:
JEObject
- Creates Java or SWING objects with the given properties.
- Overrides:
init in class JEObject