com.cbse.jeasy
Class JETips

java.lang.Object
  extended by com.cbse.jeasy.JEObject
      extended by com.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:

<tips>
                <tip>your tip</tip>
 </tips>
 

Properties
namevaluescomment
id*Id of the object. Let it begin with MC_
filename The name of the XML file to read the tips.
tips An xml string with your tips in format <tip>your tip</tip>.
randomtrue

false
Set to true will set a random order of tips.
* = property you have to set; bold = default value

Version:
%I%, %G%
Author:
H.Pfohl

Field Summary
 
Fields inherited from class com.cbse.jeasy.JEObject
DEVELOPPING, INPUT_ERROR_DATE, INPUT_ERROR_LENGTH, INPUT_ERROR_MANDATORY, INPUT_ERROR_PARSE, INPUT_ERROR_RANGE, INPUT_ERROR_TIME, INPUT_ERRORS, NO_INPUT_ERROR, RUNNING
 
Constructor Summary
JETips()
          Constructor
JETips(java.lang.String s)
          Reads the properties from a string.
 
Method Summary
 java.lang.String getFilename()
          Method getFilename
 int getSize()
          Returns the number of tips
 java.lang.String gettips()
          Method gettips
 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
 void start()
          Method start
 
Methods inherited from class com.cbse.jeasy.JEObject
backupEntry, clear, deserializeValue, getApplet, getApplLocale, getCenter, getComponent, getEast, getElementAt, getElementSize, getId, getJCallBack, getJClass, getLabel, getMode, getName, getNorth, getObjLocale, getParentId, getPreview, getProjectDirectory, getProperty, getRegisterText, getSouth, getStarted, getTitle, getType, getWest, getXMLtag, isEditable, isEnabled, isEnterprise, isProfessional, isStandard, isVisible, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEaddTab, removeProperties, removeProperty, restoreEntry, serializeValue, setApplet, setApplLocale, setEditable, setEditable, setEnabled, setEnabled, setFocus, setJCallBack, setMarkable, setMarkable, setMode, setObjLocale, setParentId, setPreview, setProjectDirectory, setProperty, setStarted, setVisible, setVisible, wasEntryChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JETips

public JETips()
Constructor


JETips

public JETips(java.lang.String s)
Reads the properties from a string.

Parameters:
s - contains properties and values
See Also:
JE#PropertyString
Method Detail

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


start

public void start()
Method start

Overrides:
start in class JEObject