Class PreferenceWindow
java.lang.Object
org.eclipse.nebula.widgets.opal.preferencewindow.PreferenceWindow
public class PreferenceWindow
extends java.lang.Object
This class is a preference window
-
Method Summary
Modifier and Type Method Description voidaddRowGroupLinkedTo(java.lang.String propertyKey, PWRowGroup rowGroup)Add a row group that is linked to a given propertyPWTabaddTab(org.eclipse.swt.graphics.Image image, java.lang.String text)Add a tab to the preference windowvoidaddWidgetLinkedTo(java.lang.String propertyKey, PWWidget widget)Add a widget that is linked to a given propertystatic PreferenceWindowcreate(java.util.Map<java.lang.String,java.lang.Object> values)Create a preference window (a singleton)static PreferenceWindowcreate(org.eclipse.swt.widgets.Shell parent, java.util.Map<java.lang.String,java.lang.Object> values)Create a preference window (a singleton)voidfireEnablers()Fire all enablersstatic PreferenceWindowgetInstance()intgetSelectedTab()org.eclipse.swt.widgets.ShellgetShell()java.lang.ObjectgetValueFor(java.lang.String key)java.util.Map<java.lang.String,java.lang.Object>getValues()booleanopen()Open the preference windowvoidsetSelectedTab(int selectedTab)Set the selected tabvoidsetValue(java.lang.String key, java.lang.Object value)Store a value associated to the key
-
Method Details
-
create
public static PreferenceWindow create(org.eclipse.swt.widgets.Shell parent, java.util.Map<java.lang.String,java.lang.Object> values)Create a preference window (a singleton)- Parameters:
parent- parent shell (may be null)values- a map that contains all values that will be displayed in widgets- Returns:
-
create
Create a preference window (a singleton)- Parameters:
values- a map that contains all values that will be displayed in widgets- Returns:
-
getInstance
- Returns:
- an instance of the preference window
-
addTab
Add a tab to the preference window- Parameters:
image- image associated to the tabtext- text associated to the image- Returns:
- the
-
addWidgetLinkedTo
Add a widget that is linked to a given property- Parameters:
propertyKey- the propertywidget- the widget
-
addRowGroupLinkedTo
Add a row group that is linked to a given property- Parameters:
propertyKey- the propertyrowGroup- the widget
-
open
public boolean open()Open the preference window- Returns:
trueif the user pressed on the Ok button,falseif the user pressed on the Cancel button
-
fireEnablers
public void fireEnablers()Fire all enablers -
getSelectedTab
public int getSelectedTab()- Returns:
- the selected tab
-
getValueFor
public java.lang.Object getValueFor(java.lang.String key)- Parameters:
key-- Returns:
- the value associated to the key
-
getValues
public java.util.Map<java.lang.String,java.lang.Object> getValues()- Returns:
- the list of all values
-
setValue
public void setValue(java.lang.String key, java.lang.Object value)Store a value associated to the key- Parameters:
key-value-
-
setSelectedTab
public void setSelectedTab(int selectedTab)Set the selected tab- Parameters:
selectedTab-
-
getShell
public org.eclipse.swt.widgets.Shell getShell()- Returns:
- the shell that contains the preferences window
-