|
||||||||||
| 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
com.izforge.izpack.installer.gui.IzPanel
public abstract class IzPanel
Defines the base class for the IzPack panels. Any panel should be a subclass of it and should
belong to the com.izforge.izpack.panels package. Since IzPack version 3.9 the
layout handling will be delegated to the class LayoutHelper which can be accessed by
getLayoutHelper. There are some layout helper methods in this class which will be
exist some time longer, but they are deprecated. At a redesign or new panel use the layout
helper. There is a special layout manager for IzPanels. This layout manager will be supported by
the layout helper. There are some points which should be observed at layouting. One point e.g. is
the anchor. All IzPanels have to be able to use different anchors, as minimum CENTER and
NORTHWEST. To use a consistent appearance use this special layout manger and not others.
| Nested Class Summary | |
|---|---|
static class |
IzPanel.Filler
|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
DELIMITER
DELIMITER = "." ( dot ) |
static String |
HEADLINE
HEADLINE = "headline" |
protected JLabel |
headLineLabel
internal headline Label |
protected Component |
initialFocus
The component which should get the focus at activation |
protected GUIInstallData |
installData
The installer internal data (actually a melting-pot class with all-public fields. |
protected LayoutHelper |
layoutHelper
The helper object which handles layout |
protected InstallerFrame |
parent
The parent IzPack installer frame. |
| 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 com.izforge.izpack.api.handler.AbstractUIHandler |
|---|
ANSWER_CANCEL, ANSWER_NO, ANSWER_YES, CHOICES_YES_NO |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
IzPanel(Panel panel,
InstallerFrame parent,
GUIInstallData installData,
LayoutManager2 layoutManager,
Resources resources)
Constructs an IzPanel with the given layout manager. |
|
IzPanel(Panel panel,
InstallerFrame parent,
GUIInstallData installData,
Resources resources)
Constructs an IzPanel. |
|
IzPanel(Panel panel,
InstallerFrame parent,
GUIInstallData installData,
String iconName,
Resources resources)
Deprecated. |
|
| Method Summary | |
|---|---|
int |
askQuestion(String title,
String question,
int choices)
Ask the user a question. |
int |
askQuestion(String title,
String question,
int choices,
int defaultChoice)
Ask the user a question. |
int |
askWarningQuestion(String title,
String question,
int choices,
int defaultChoice)
|
boolean |
canShowHelp()
Indicates wether the panel can display help. |
void |
createInstallationRecord(IXMLElement rootElement)
|
JLabel |
createLabel(String subkey,
String alternateClass,
String iconId,
int pos,
boolean isFullLine)
Creates a label via LabelFactory using iconId, pos and method getI18nStringForClass for resolving the text to be used. |
MultiLineLabel |
createMultiLineLabel(String text)
Creates a label via LabelFactory with the given text, the given icon id and the given horizontal alignment. |
MultiLineLabel |
createMultiLineLabelLang(String textId)
Creates a multi line label with the language dependent text given by the text id. |
void |
emitError(String title,
String message)
Notify the user of some error. |
void |
emitNotification(String message)
Notify the user about something. |
boolean |
emitNotificationFeedback(String message)
|
boolean |
emitWarning(String title,
String message)
Warn the user about something. |
Font |
getControlTextFont()
The Font of Labels in many cases |
String |
getI18nStringForClass(String subkey)
Calls the langpack of parent InstallerFrame for the String RuntimeClassName.subkey. |
String |
getI18nStringForClass(String subkey,
String alternateClass)
Calls the langpack of parent InstallerFrame for the String RuntimeClassName.subkey. |
ImageIcon |
getImageIcon(String iconName)
Gets a named image icon |
Component |
getInitialFocus()
Returns the component which should be get the focus at activation of this panel. |
InstallerFrame |
getInstallerFrame()
Returns the parent of this IzPanel (which is a InstallerFrame). |
protected static MetalLookAndFeel |
getLAF()
|
LayoutHelper |
getLayoutHelper()
Returns the used layout helper. |
Panel |
getMetadata()
Returns the panel metadata. |
protected Resources |
getResources()
Returns the resources. |
String |
getString(String key)
Helper to return a language resource string. |
String |
getSummaryBody()
This method will be called from the SummaryPanel to get the summary of this class which should be placed in the SummaryPanel. |
String |
getSummaryCaption()
This method will be called from the SummaryPanel to get the caption for this class which should be placed in the SummaryPanel. |
protected void |
initLayoutHelper()
Inits and sets the internal layout helper object. |
protected boolean |
isValidated()
Indicates wether the panel has been validated or not. |
void |
panelActivate()
This method is called when the panel becomes active. |
void |
panelDeactivate()
This method is called when the panel gets desactivated, when the user switches to the next panel. |
boolean |
panelValidated()
|
protected String |
parseText(String string_to_parse)
Parses the text for special variables. |
protected void |
saveData()
|
void |
setHelpUrl(String helpUrl)
|
void |
setInitialFocus(Component component)
Sets the component which should be get the focus at activation of this panel. |
void |
showHelp()
This method is called when Help button has been clicked. |
String |
toString()
|
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient LayoutHelper layoutHelper
protected Component initialFocus
protected final GUIInstallData installData
protected final InstallerFrame parent
protected JLabel headLineLabel
public static final String HEADLINE
public static final String DELIMITER
| Constructor Detail |
|---|
public IzPanel(Panel panel,
InstallerFrame parent,
GUIInstallData installData,
Resources resources)
panel - the panel meta-dataparent - the parent IzPack installer frameinstallData - the installation dataresources - the resources
public IzPanel(Panel panel,
InstallerFrame parent,
GUIInstallData installData,
LayoutManager2 layoutManager,
Resources resources)
IzPanelLayout and GridBagLayout.
New panels should be use IzPanelLayout. If layoutManager is
null, no layout manager will be created or initialized.
panel - the panel meta-dataparent - the parent IzPack installer frameinstallData - the installation datalayoutManager - layout manager to be used with this IzPanelresources - the resources
@Deprecated
public IzPanel(Panel panel,
InstallerFrame parent,
GUIInstallData installData,
String iconName,
Resources resources)
panel - the panel meta-dataparent - the parent IzPack installer frameinstallData - the installation dataiconName - the Headline icon nameresources - the resources| Method Detail |
|---|
public String getString(String key)
key - the search key
key if the string is not foundpublic ImageIcon getImageIcon(String iconName)
iconName - a valid image icon
protected void initLayoutHelper()
protected boolean isValidated()
true.
protected void saveData()
public boolean panelValidated()
public void panelActivate()
public void panelDeactivate()
public void createInstallationRecord(IXMLElement rootElement)
public int askQuestion(String title,
String question,
int choices)
askQuestion in interface AbstractUIHandlertitle - Message title.question - The question.choices - The set of choices to present.
AbstractUIHandler.askQuestion(String, String, int)
public int askQuestion(String title,
String question,
int choices,
int defaultChoice)
askQuestion in interface AbstractUIHandlertitle - Message title.question - The question.choices - The set of choices to present.defaultChoice - The default choice. (-1 = no default choice)
AbstractUIHandler.askQuestion(String, String, int, int)
public int askWarningQuestion(String title,
String question,
int choices,
int defaultChoice)
askWarningQuestion in interface AbstractUIHandlerpublic boolean emitNotificationFeedback(String message)
public void emitNotification(String message)
emitNotification in interface AbstractUIHandlermessage - The notification.
public boolean emitWarning(String title,
String message)
emitWarning in interface AbstractUIHandlermessage - The warning message.
public void emitError(String title,
String message)
emitError in interface AbstractUIHandlermessage - The error message.public Component getInitialFocus()
public void setInitialFocus(Component component)
component - which should be get the focus at activation of this panelpublic String getI18nStringForClass(String subkey)
subkey - the subkey for the string which should be returned
public String getI18nStringForClass(String subkey,
String alternateClass)
subkey - the subkey for the string which should be returnedalternateClass - the short name of the class which should be used if no string is
present with the runtime class name
public InstallerFrame getInstallerFrame()
public JLabel createLabel(String subkey,
String alternateClass,
String iconId,
int pos,
boolean isFullLine)
subkey - the subkey which should be used for resolving the textalternateClass - the short name of the class which should be used if no string is
present with the runtime class nameiconId - id string for the iconpos - horizontal alignmentisFullLine - determines whether a FullLineLabel or a JLabel should be created
public MultiLineLabel createMultiLineLabelLang(String textId)
textId - id string for the text
public MultiLineLabel createMultiLineLabel(String text)
text - text to be used in the label
public Font getControlTextFont()
protected static MetalLookAndFeel getLAF()
public String getSummaryBody()
null
returns, no summary for this panel will be generated. Default behaviour is to return
null.
getSummaryBody in interface ISummarisablepublic String getSummaryCaption()
null returns, no summary for this
panel will be generated. Default behaviour is to return the string given by langpack for the
key <current class name>.summaryCaption> if exist, else the string
"summaryCaption.<ClassName>".
getSummaryCaption in interface ISummarisablepublic LayoutHelper getLayoutHelper()
public Panel getMetadata()
protected String parseText(String string_to_parse)
public boolean canShowHelp()
false.
public void showHelp()
public void setHelpUrl(String helpUrl)
public String toString()
toString in class Componentprotected Resources getResources()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||