Class EditorDescription
- java.lang.Object
-
- net.sf.okapi.common.uidescription.EditorDescription
-
public class EditorDescription extends Object
Describes the different UI parts and the layout to use for a generic editor.
-
-
Constructor Summary
Constructors Constructor Description EditorDescription()Creates a new EditorDescription object.EditorDescription(String caption)Creates a new EditorDescription object with a given caption.EditorDescription(String caption, boolean defaultVertical, boolean defaultLabelFlushed)Creates a new EditorDescription object with a given caption and given default options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CheckboxPartaddCheckboxPart(ParameterDescriptor paramDescriptor)Adds a check box UI part to this editor description.CheckListPartaddCheckListPart(String label, int heightHint)Adds a check list UI part to this editor description.CodeFinderPartaddCodeFinderPart(ParameterDescriptor paramDescriptor)Adds a code-finder panel part to this editor description.FolderInputPartaddFolderInputPart(ParameterDescriptor paramDescriptor, String browseTitle)Adds a folder input field UI part to this editor description.ListSelectionPartaddListSelectionPart(ParameterDescriptor paramDescriptor, String[] choices)Adds a selection list UI part to this editor description.TextInputPartaddOptionalTextInputPart(ParameterDescriptor paramDescriptor)Adds an optional text input UI part to this editor description.PathInputPartaddPathInputPart(ParameterDescriptor paramDescriptor, String browseTitle, boolean forSaveAs)Adds a path input field UI part to this editor description.SeparatorPartaddSeparatorPart()Adds a separator part to this editor description.SpinInputPartaddSpinInputPart(ParameterDescriptor paramDescriptor)Adds a spin part to this editor description.TextInputPartaddTextInputPart(ParameterDescriptor paramDescriptor)Adds a default text input UI part to this editor description.TextLabelPartaddTextLabelPart(String text)StringgetCaption()Gets the caption for this editor.AbstractPartgetDescriptor(String name)Gets the descriptor for a given UI part.Map<String,AbstractPart>getDescriptors()Gets a map of the descriptor of all UI parts for this editor.voidsetCaption(String caption)Sets the caption for this editor.
-
-
-
Constructor Detail
-
EditorDescription
public EditorDescription()
Creates a new EditorDescription object.
-
EditorDescription
public EditorDescription(String caption)
Creates a new EditorDescription object with a given caption.- Parameters:
caption- the caption of the editor.
-
EditorDescription
public EditorDescription(String caption, boolean defaultVertical, boolean defaultLabelFlushed)
Creates a new EditorDescription object with a given caption and given default options.- Parameters:
caption- the caption of the editor.defaultVertical- default value for this option.defaultLabelFlushed- default value for this option.
-
-
Method Detail
-
getCaption
public String getCaption()
Gets the caption for this editor.- Returns:
- the caption for this editor.
-
setCaption
public void setCaption(String caption)
Sets the caption for this editor.- Parameters:
caption- the caption for this editor.
-
getDescriptors
public Map<String,AbstractPart> getDescriptors()
Gets a map of the descriptor of all UI parts for this editor.- Returns:
- a map of all descriptor of the UI parts.
-
getDescriptor
public AbstractPart getDescriptor(String name)
Gets the descriptor for a given UI part.- Parameters:
name- the name of the UI part to lookup.- Returns:
- the descriptor for the given UI part.
-
addTextInputPart
public TextInputPart addTextInputPart(ParameterDescriptor paramDescriptor)
Adds a default text input UI part to this editor description.- Parameters:
paramDescriptor- the parameter descriptor for this UI part.- Returns:
- the UI part created by this call.
-
addOptionalTextInputPart
public TextInputPart addOptionalTextInputPart(ParameterDescriptor paramDescriptor)
Adds an optional text input UI part to this editor description.- Parameters:
paramDescriptor- the parameter descriptor for this UI part.- Returns:
- the UI part created
-
addCheckboxPart
public CheckboxPart addCheckboxPart(ParameterDescriptor paramDescriptor)
Adds a check box UI part to this editor description.- Parameters:
paramDescriptor- the parameter descriptor for this UI part.- Returns:
- the UI part created by this call.
-
addCheckListPart
public CheckListPart addCheckListPart(String label, int heightHint)
Adds a check list UI part to this editor description.- Parameters:
label- the text of the label above the listheightHint- the suggested height of the list.- Returns:
- the UI part created by this call.
-
addListSelectionPart
public ListSelectionPart addListSelectionPart(ParameterDescriptor paramDescriptor, String[] choices)
Adds a selection list UI part to this editor description.- Parameters:
paramDescriptor- the parameter descriptor for this UI part.choices- the list of items values that can be selected.- Returns:
- the UI part created by this call.
-
addPathInputPart
public PathInputPart addPathInputPart(ParameterDescriptor paramDescriptor, String browseTitle, boolean forSaveAs)
Adds a path input field UI part to this editor description.- Parameters:
paramDescriptor- the parameter descriptor for this UI part.browseTitle- the title to use for the path browsing dialog.forSaveAs- true if the path is to save a file (vs to open one).- Returns:
- the UI part created by this call.
-
addFolderInputPart
public FolderInputPart addFolderInputPart(ParameterDescriptor paramDescriptor, String browseTitle)
Adds a folder input field UI part to this editor description.- Parameters:
paramDescriptor- the parameter descriptor for this UI part.browseTitle- the title to use for the directory browsing dialog.- Returns:
- the UI part created by this call.
-
addCodeFinderPart
public CodeFinderPart addCodeFinderPart(ParameterDescriptor paramDescriptor)
Adds a code-finder panel part to this editor description.- Parameters:
paramDescriptor- the parameter descriptor for this UI part.- Returns:
- the UI part created by this call.
-
addSpinInputPart
public SpinInputPart addSpinInputPart(ParameterDescriptor paramDescriptor)
Adds a spin part to this editor description.- Parameters:
paramDescriptor- the parameter descriptor for this UI part.- Returns:
- the UI part created by this call.
-
addSeparatorPart
public SeparatorPart addSeparatorPart()
Adds a separator part to this editor description.- Returns:
- the UI part created by this call.
-
addTextLabelPart
public TextLabelPart addTextLabelPart(String text)
-
-