Class TipOfTheDay
- java.lang.Object
-
- org.eclipse.nebula.widgets.opal.tipoftheday.TipOfTheDay
-
public class TipOfTheDay extends java.lang.ObjectInstances 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 classTipOfTheDay.TipStyleTypes of opal dialog
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringBLUE_LIGHT_BULBprivate org.eclipse.swt.widgets.Buttoncloseprivate static java.lang.StringDEFAULT_FONTprivate booleandisplayShowOnStartupprivate java.lang.StringfontNameprivate org.eclipse.swt.graphics.Imageimageprivate intindexprivate org.eclipse.swt.widgets.Shellshellprivate booleanshowOnStartupprivate TipOfTheDay.TipStylestyleprivate org.eclipse.swt.browser.BrowsertipAreaprivate java.util.List<java.lang.String>tipsprivate static java.lang.StringYELLOW_LIGHT_BULB
-
Constructor Summary
Constructors Constructor Description TipOfTheDay()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TipOfTheDayaddTip(java.lang.String tip)Add a tipprivate voidbuildButtons()Build the button (checkbox, previous tip, next tip, close)private voidbuildCloseButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)Build the "close" buttonprivate voidbuildHeader()Build the headerprivate voidbuildLeftColumn()Build the left columnprivate voidbuildNextButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)Build the "next tip" buttonprivate voidbuildPreviousButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)Build the "previous tip" buttonprivate voidbuildShell(org.eclipse.swt.widgets.Shell parent)Build the shellprivate voidbuildShowOnStartup(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridData gridData)Build the "show on startup" checkboxprivate voidbuildTip()Build the tip areaprivate voidfillTipArea()Fill the tip area with the selected tiporg.eclipse.swt.graphics.ImagegetImage()intgetIndex()org.eclipse.swt.widgets.ShellgetShell()TipOfTheDay.TipStylegetStyle()java.util.List<java.lang.String>getTips()booleanisDisplayShowOnStartup()booleanisShowOnStartup()voidopen(org.eclipse.swt.widgets.Shell parent)Open the "tip of the day" boxprivate voidopenShell()Open the shellvoidsetDisplayShowOnStartup(boolean displayShowOnStartup)voidsetImage(org.eclipse.swt.graphics.Image image)voidsetIndex(int index)voidsetShowOnStartup(boolean showOnStartup)voidsetStyle(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
-
-