Class TipOfTheDay
- java.lang.Object
-
- org.eclipse.nebula.widgets.opal.tipoftheday.TipOfTheDay
-
public class TipOfTheDay extends java.lang.Object
Instances of this class are a "Tip of Day" box, which is composed of- A tip
- 2 buttons to navigate between types
- A close button
- A checkbox "show tip on startup"
- (optional)
- A checkbox "remember the password"
- (optional)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TipOfTheDay.TipStyle
Types of opal dialog
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
BLUE_LIGHT_BULB
private org.eclipse.swt.widgets.Button
close
private static java.lang.String
DEFAULT_FONT
private boolean
displayShowOnStartup
private java.lang.String
fontName
private org.eclipse.swt.graphics.Image
image
private int
index
private org.eclipse.swt.widgets.Shell
shell
private boolean
showOnStartup
private TipOfTheDay.TipStyle
style
private org.eclipse.swt.browser.Browser
tipArea
private java.util.List<java.lang.String>
tips
private static java.lang.String
YELLOW_LIGHT_BULB
-
Constructor Summary
Constructors Constructor Description TipOfTheDay()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TipOfTheDay
addTip(java.lang.String tip)
Add a tipprivate void
buildButtons()
Build the button (checkbox, previous tip, next tip, close)private void
buildCloseButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)
Build the "close" buttonprivate void
buildHeader()
Build the headerprivate void
buildLeftColumn()
Build the left columnprivate void
buildNextButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)
Build the "next tip" buttonprivate void
buildPreviousButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)
Build the "previous tip" buttonprivate void
buildShell(org.eclipse.swt.widgets.Shell parent)
Build the shellprivate void
buildShowOnStartup(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)
Build the "show on startup" checkboxprivate void
buildTip()
Build the tip areaprivate void
fillTipArea()
Fill the tip area with the selected tiporg.eclipse.swt.graphics.Image
getImage()
int
getIndex()
org.eclipse.swt.widgets.Shell
getShell()
TipOfTheDay.TipStyle
getStyle()
java.util.List<java.lang.String>
getTips()
boolean
isDisplayShowOnStartup()
boolean
isShowOnStartup()
void
open(org.eclipse.swt.widgets.Shell parent)
Open the "tip of the day" boxprivate void
openShell()
Open the shellvoid
setDisplayShowOnStartup(boolean displayShowOnStartup)
void
setImage(org.eclipse.swt.graphics.Image image)
void
setIndex(int index)
void
setShowOnStartup(boolean showOnStartup)
void
setStyle(TipOfTheDay.TipStyle style)
-
-
-
Field Detail
-
BLUE_LIGHT_BULB
private static final java.lang.String BLUE_LIGHT_BULB
- See Also:
- Constant Field Values
-
YELLOW_LIGHT_BULB
private static final java.lang.String YELLOW_LIGHT_BULB
- See Also:
- Constant Field Values
-
DEFAULT_FONT
private static final java.lang.String DEFAULT_FONT
- See Also:
- Constant Field Values
-
tips
private final java.util.List<java.lang.String> tips
-
displayShowOnStartup
private boolean displayShowOnStartup
-
showOnStartup
private boolean showOnStartup
-
shell
private org.eclipse.swt.widgets.Shell shell
-
close
private org.eclipse.swt.widgets.Button close
-
index
private int index
-
tipArea
private org.eclipse.swt.browser.Browser tipArea
-
fontName
private java.lang.String fontName
-
style
private TipOfTheDay.TipStyle style
-
image
private org.eclipse.swt.graphics.Image image
-
-
Method Detail
-
open
public void open(org.eclipse.swt.widgets.Shell parent)
Open the "tip of the day" box- Parameters:
parent
- the parent shell
-
buildShell
private void buildShell(org.eclipse.swt.widgets.Shell parent)
Build the shell- Parameters:
parent
- parent shell
-
buildHeader
private void buildHeader()
Build the header
-
buildLeftColumn
private void buildLeftColumn()
Build the left column
-
buildTip
private void buildTip()
Build the tip area
-
fillTipArea
private void fillTipArea()
Fill the tip area with the selected tip
-
buildButtons
private void buildButtons()
Build the button (checkbox, previous tip, next tip, close)
-
buildShowOnStartup
private void buildShowOnStartup(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)
Build the "show on startup" checkbox- Parameters:
composite
- parent compositegridData
- associated grid data
-
buildPreviousButton
private void buildPreviousButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)
Build the "previous tip" button- Parameters:
composite
- parent compositegridData
- associated grid data
-
buildNextButton
private void buildNextButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)
Build the "next tip" button- Parameters:
composite
- parent compositegridData
- associated grid data
-
buildCloseButton
private void buildCloseButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)
Build the "close" button- Parameters:
composite
- parent compositegridData
- associated grid data
-
openShell
private void openShell()
Open the shell
-
addTip
public TipOfTheDay addTip(java.lang.String tip)
Add a tip- Parameters:
tip
- tip to add- Returns:
- the current object
-
getImage
public org.eclipse.swt.graphics.Image getImage()
- Returns:
- the image
-
getIndex
public int getIndex()
- Returns:
- the index of the current tip
-
getStyle
public TipOfTheDay.TipStyle getStyle()
- Returns:
- the style of the window
-
getTips
public java.util.List<java.lang.String> getTips()
- Returns:
- all the the tips
-
isDisplayShowOnStartup
public boolean isDisplayShowOnStartup()
- Returns:
- if
true
, the "Show On Startup" checkbox is displayed
-
isShowOnStartup
public boolean isShowOnStartup()
- Returns:
- the value of the checkbox "Show On Startup"
-
setDisplayShowOnStartup
public void setDisplayShowOnStartup(boolean displayShowOnStartup)
- Parameters:
if
-true
, the checkbox "Show on startup" is displayed
-
setIndex
public void setIndex(int index)
- Parameters:
index
- the index of the selected tip. By default, the tip is chosen randomly
-
setImage
public void setImage(org.eclipse.swt.graphics.Image image)
- Parameters:
image
- the image to set
-
setShowOnStartup
public void setShowOnStartup(boolean showOnStartup)
- Parameters:
the
- value of the checkbox "Show on startup"
-
setStyle
public void setStyle(TipOfTheDay.TipStyle style)
- Parameters:
style
- the style of the window
-
getShell
public org.eclipse.swt.widgets.Shell getShell()
- Returns:
- the shell that contains the "tip of the day" box
-
-