mixconfig.panels.TermsAndConditionsContentDialog Class Reference

Inherits gui::dialog::JAPDialog, java::awt::event::ItemListener, java::awt::event::ActionListener, and java::awt::event::FocusListener.

List of all members.

Public Member Functions

void loadSectionList ()
void loadSectionList (TCComponent selected)
void loadParagraphList ()
void loadParagraphList (TCComponent selected)
void itemStateChanged (ItemEvent e)
void actionPerformed (ActionEvent e)
void focusGained (FocusEvent e)
void focusLost (FocusEvent e)

Static Public Member Functions

static TCComposite showContentDialog (TermsAndConditionsPanel parentPanel, TermsAndConditionsTemplate template, TermsAndConditionsTranslation translation)

Protected Member Functions

void enableComponents ()

Static Package Attributes

static final String MSG_STATUS_PREFIX = TermsAndConditionsContentDialog.class.getName() + "_status"
static final String MSG_NAME = TermsAndConditionsContentDialog.class.getName() + "_name"
static final String MSG_ID = TermsAndConditionsContentDialog.class.getName() + "_id"
static final String MSG_ID_DESCRIPTION = TermsAndConditionsContentDialog.class.getName() + "_idDescription"
static final String MSG_BUTTON_FROM_TEMPLATE = TermsAndConditionsContentDialog.class.getName() + "_btnFromTemplate"
static final String MSG_BUTTON_CAPITALIZE = TermsAndConditionsContentDialog.class.getName() + "_btnCapitalize"
static final String MSG_BUTTON_BOLD = TermsAndConditionsContentDialog.class.getName() + "_btnBold"
static final String MSG_BUTTON_URL_TAG = TermsAndConditionsContentDialog.class.getName() + "_btnUrlTag"
static final String URL_TAG = "<Url></Url>"

Private Member Functions

 TermsAndConditionsContentDialog (TermsAndConditionsPanel parentPanel, TermsAndConditionsTemplate template, TermsAndConditionsTranslation translation)
void initializeComponents ()
void placeComponents ()
void loadComboBoxItems (JComboBox comboBox, Collection< TCComponentListItem > items, TCComponent selected)
Section getSelectedTemplateSection ()
Section getSelectedTranslationSection ()
TCComponent[] getParagraphsOfSelectedTemplateSection ()
TCComponent[] getParagraphsOfSelectedTranslationSection ()
Paragraph getSelectedTemplateParagraph ()
Paragraph getSelectedTranslationParagraph ()
Section getCustomizedSection (boolean withSectionName)
Section getCustomizedSection ()
Paragraph getCustomizedParagraph (boolean withSectionName)
Paragraph getCustomizedParagraph ()
void actionAddSection ()
void actionAddParagraph ()
void actionDeleteSection ()
void actionDeleteParagraph ()
void actionContentFromTemplate ()
void actionCapitalizeContent ()
void actionSetContentBold ()
void actionAddUrlTag ()
void capitalizeTextContent (Paragraph p)
void capitalizeTextContentRecursion (Node node)
void deleteSelectedComponent (TCComponentListItem item, TCComposite container)
void actionResetSection ()
void actionResetParagraph ()
void actionPreview ()
void resetCustomizedComponent (TCComponentListItem item, TCComposite container)
void editSection (String content)
void editParagraph (String content)
boolean isSectionSelectable ()
boolean isSectionResettable ()
boolean isSectionDeletable ()
boolean isParagraphSelectable ()
boolean isParagraphDeletable ()
boolean isParagraphResettable ()
boolean isParagraphEditable ()
boolean isContentCapitalizable ()
boolean isContentSetToBoldPossible ()
boolean isContentFromTemplateAvailable ()
boolean isParagraphAddable ()
boolean isSectionNameEditable ()
boolean isItemDeletable (TCComponentListItem item)

Static Private Member Functions

static TCComponentListItem getSelectedListItem (JComboBox comboBox)
static TitledGridBagPanel createTCComponentPanel (String nameKey, JComboBox choiceBox, JButton addButton, JButton deleteButton, JButton resetButton)
static TitledGridBagPanel createContentPanel (String contentSourceNameKey, JTextField sectionNameTF, JTextArea paragraphTextArea, JPanel buttonPanel)

Private Attributes

TermsAndConditionsPanel parentPanel
JButton sectionAddButton
JButton sectionDeleteButton
JButton sectionResetButton
JButton paragraphAddButton
JButton paragraphDeleteButton
JButton paragraphResetButton
JButton fromTemplateButton
JButton capitalizeButton
JButton boldButton
JButton urlTagButton
JButton previewButton
JButton okButton
JButton cancelButton
JComboBox sectionChoice
JComboBox paragraphChoice
JTextField sectionNameTemplate
JTextArea templateText
JTextField sectionNameTranslation
JTextArea translationText
TitledGridBagPanel sectionPanel
TitledGridBagPanel paragraphPanel
TitledGridBagPanel templateContentPanel
TitledGridBagPanel customizedContentPanel
TCComposite templateSections = null
TCComposite translationSections = null
int lastCaretPosition = 0

Classes

class  AddComponentDialog
class  TCComponentListItem
class  TCComponentListItemRenderer


Detailed Description

The content management dialog for the terms and conditions
Author:
simon

Constructor & Destructor Documentation

mixconfig.panels.TermsAndConditionsContentDialog.TermsAndConditionsContentDialog ( TermsAndConditionsPanel  parentPanel,
TermsAndConditionsTemplate  template,
TermsAndConditionsTranslation  translation 
) [private]


Member Function Documentation

void mixconfig.panels.TermsAndConditionsContentDialog.initializeComponents (  )  [private]

References mixconfig.panels.TermsAndConditionsContentDialog.boldButton, mixconfig.panels.TermsAndConditionsContentDialog.cancelButton, mixconfig.panels.TermsAndConditionsContentDialog.capitalizeButton, mixconfig.panels.TermsAndConditionsContentDialog.createContentPanel(), mixconfig.panels.TermsAndConditionsContentDialog.createTCComponentPanel(), mixconfig.panels.TermsAndConditionsContentDialog.customizedContentPanel, mixconfig.panels.TermsAndConditionsContentDialog.fromTemplateButton, mixconfig.panels.TermsAndConditionsContentDialog.MSG_BUTTON_BOLD, mixconfig.panels.TermsAndConditionsContentDialog.MSG_BUTTON_CAPITALIZE, mixconfig.panels.TermsAndConditionsContentDialog.MSG_BUTTON_FROM_TEMPLATE, mixconfig.panels.TermsAndConditionsContentDialog.MSG_BUTTON_URL_TAG, mixconfig.panels.TermsAndConditionsContentDialog.okButton, mixconfig.panels.TermsAndConditionsContentDialog.paragraphAddButton, mixconfig.panels.TermsAndConditionsContentDialog.paragraphChoice, mixconfig.panels.TermsAndConditionsContentDialog.paragraphDeleteButton, mixconfig.panels.TermsAndConditionsContentDialog.paragraphPanel, mixconfig.panels.TermsAndConditionsContentDialog.paragraphResetButton, mixconfig.panels.TermsAndConditionsContentDialog.previewButton, mixconfig.panels.TermsAndConditionsContentDialog.sectionAddButton, mixconfig.panels.TermsAndConditionsContentDialog.sectionChoice, mixconfig.panels.TermsAndConditionsContentDialog.sectionDeleteButton, mixconfig.panels.TermsAndConditionsContentDialog.sectionNameTemplate, mixconfig.panels.TermsAndConditionsContentDialog.sectionNameTranslation, mixconfig.panels.TermsAndConditionsContentDialog.sectionPanel, mixconfig.panels.TermsAndConditionsContentDialog.sectionResetButton, mixconfig.panels.TermsAndConditionsContentDialog.templateContentPanel, mixconfig.panels.TermsAndConditionsContentDialog.templateText, mixconfig.panels.TermsAndConditionsContentDialog.translationText, and mixconfig.panels.TermsAndConditionsContentDialog.urlTagButton.

Referenced by mixconfig.panels.TermsAndConditionsContentDialog.TermsAndConditionsContentDialog().

void mixconfig.panels.TermsAndConditionsContentDialog.placeComponents (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.loadSectionList (  ) 

void mixconfig.panels.TermsAndConditionsContentDialog.loadSectionList ( TCComponent  selected  ) 

void mixconfig.panels.TermsAndConditionsContentDialog.loadParagraphList (  ) 

void mixconfig.panels.TermsAndConditionsContentDialog.loadParagraphList ( TCComponent  selected  ) 

void mixconfig.panels.TermsAndConditionsContentDialog.loadComboBoxItems ( JComboBox  comboBox,
Collection< TCComponentListItem items,
TCComponent  selected 
) [private]

Used by the list-item-loading-functions to fill the content of the comboBoxes

Parameters:
comboBox the comboBox to fill in the items
items collection of items to be filled in the comboBox
selected component that will be selected if a customized- or template-component with the same id exists in the collection of list-items, if null, this parameter will be ignored.

Referenced by mixconfig.panels.TermsAndConditionsContentDialog.loadParagraphList(), and mixconfig.panels.TermsAndConditionsContentDialog.loadSectionList().

void mixconfig.panels.TermsAndConditionsContentDialog.itemStateChanged ( ItemEvent  e  ) 

void mixconfig.panels.TermsAndConditionsContentDialog.actionPerformed ( ActionEvent  e  ) 

ActionListener implementations

References mixconfig.panels.TermsAndConditionsContentDialog.actionAddParagraph(), mixconfig.panels.TermsAndConditionsContentDialog.actionAddSection(), mixconfig.panels.TermsAndConditionsContentDialog.actionAddUrlTag(), mixconfig.panels.TermsAndConditionsContentDialog.actionCapitalizeContent(), mixconfig.panels.TermsAndConditionsContentDialog.actionContentFromTemplate(), mixconfig.panels.TermsAndConditionsContentDialog.actionDeleteParagraph(), mixconfig.panels.TermsAndConditionsContentDialog.actionDeleteSection(), mixconfig.panels.TermsAndConditionsContentDialog.actionPreview(), mixconfig.panels.TermsAndConditionsContentDialog.actionResetParagraph(), mixconfig.panels.TermsAndConditionsContentDialog.actionResetSection(), mixconfig.panels.TermsAndConditionsContentDialog.actionSetContentBold(), mixconfig.panels.TermsAndConditionsContentDialog.boldButton, mixconfig.panels.TermsAndConditionsContentDialog.cancelButton, mixconfig.panels.TermsAndConditionsContentDialog.capitalizeButton, mixconfig.panels.TermsAndConditionsContentDialog.enableComponents(), mixconfig.panels.TermsAndConditionsContentDialog.fromTemplateButton, mixconfig.panels.TermsAndConditionsContentDialog.okButton, mixconfig.panels.TermsAndConditionsContentDialog.paragraphAddButton, mixconfig.panels.TermsAndConditionsContentDialog.paragraphDeleteButton, mixconfig.panels.TermsAndConditionsContentDialog.paragraphResetButton, mixconfig.panels.TermsAndConditionsContentDialog.previewButton, mixconfig.panels.TermsAndConditionsContentDialog.sectionAddButton, mixconfig.panels.TermsAndConditionsContentDialog.sectionDeleteButton, mixconfig.panels.TermsAndConditionsContentDialog.sectionResetButton, mixconfig.panels.TermsAndConditionsContentDialog.translationSections, and mixconfig.panels.TermsAndConditionsContentDialog.urlTagButton.

Section mixconfig.panels.TermsAndConditionsContentDialog.getSelectedTemplateSection (  )  [private]

Section mixconfig.panels.TermsAndConditionsContentDialog.getSelectedTranslationSection (  )  [private]

TCComponent [] mixconfig.panels.TermsAndConditionsContentDialog.getParagraphsOfSelectedTemplateSection (  )  [private]

Returns:
an array with the paragraphs of the selected template-section or null if no template-section is defined by the selected section-item.

References mixconfig.panels.TermsAndConditionsContentDialog.getSelectedTemplateSection().

Referenced by mixconfig.panels.TermsAndConditionsContentDialog.loadParagraphList().

TCComponent [] mixconfig.panels.TermsAndConditionsContentDialog.getParagraphsOfSelectedTranslationSection (  )  [private]

Returns:
an array with the paragraphs of the selected translation-section or null if no translation-section is defined by the selected section-item.

References mixconfig.panels.TermsAndConditionsContentDialog.getSelectedTranslationSection().

Referenced by mixconfig.panels.TermsAndConditionsContentDialog.loadParagraphList().

Paragraph mixconfig.panels.TermsAndConditionsContentDialog.getSelectedTemplateParagraph (  )  [private]

Paragraph mixconfig.panels.TermsAndConditionsContentDialog.getSelectedTranslationParagraph (  )  [private]

Section mixconfig.panels.TermsAndConditionsContentDialog.getCustomizedSection ( boolean  withSectionName  )  [private]

convenience function to get a customized section as a container for a modified or added paragraph. The returned section will also be part of the model. If no customized section with the id of the selected section exists it will be created and added to the model before it will be returned.

Parameters:
withSectionName if true the section-name from the template will be set for the customized section if it is created, otherwise a newly created customized section will have no name. This parameter has no effect if a customized section already exists.
Returns:
customized section that acts as a container for the modified or added paragraphs.

References mixconfig.panels.TermsAndConditionsContentDialog.getSelectedListItem(), mixconfig.panels.TermsAndConditionsContentDialog.TCComponentListItem.getTemplateComponent(), mixconfig.panels.TermsAndConditionsContentDialog.TCComponentListItem.getTranslationComponent(), mixconfig.panels.TermsAndConditionsContentDialog.sectionChoice, mixconfig.panels.TermsAndConditionsContentDialog.TCComponentListItem.setTranslationComponent(), and mixconfig.panels.TermsAndConditionsContentDialog.translationSections.

Section mixconfig.panels.TermsAndConditionsContentDialog.getCustomizedSection (  )  [private]

Paragraph mixconfig.panels.TermsAndConditionsContentDialog.getCustomizedParagraph ( boolean  withSectionName  )  [private]

returns a customized paragraph that can be edited. if it does not exist in the model it will be created and added to the model before it will be returned. This method will also create a new customized section if the customized paragraph has no container yet.

Parameters:
withSectionName refers to the creation of customized section as container.
Returns:
an editable customized paragraph.

References mixconfig.panels.TermsAndConditionsContentDialog.getCustomizedSection(), mixconfig.panels.TermsAndConditionsContentDialog.getSelectedListItem(), mixconfig.panels.TermsAndConditionsContentDialog.TCComponentListItem.getTemplateComponent(), mixconfig.panels.TermsAndConditionsContentDialog.TCComponentListItem.getTranslationComponent(), and mixconfig.panels.TermsAndConditionsContentDialog.paragraphChoice.

Paragraph mixconfig.panels.TermsAndConditionsContentDialog.getCustomizedParagraph (  )  [private]

static TCComponentListItem mixconfig.panels.TermsAndConditionsContentDialog.getSelectedListItem ( JComboBox  comboBox  )  [static, private]

static TitledGridBagPanel mixconfig.panels.TermsAndConditionsContentDialog.createTCComponentPanel ( String  nameKey,
JComboBox  choiceBox,
JButton  addButton,
JButton  deleteButton,
JButton  resetButton 
) [static, private]

static TitledGridBagPanel mixconfig.panels.TermsAndConditionsContentDialog.createContentPanel ( String  contentSourceNameKey,
JTextField  sectionNameTF,
JTextArea  paragraphTextArea,
JPanel  buttonPanel 
) [static, private]

void mixconfig.panels.TermsAndConditionsContentDialog.actionAddSection (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.actionAddParagraph (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.actionDeleteSection (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.actionDeleteParagraph (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.actionContentFromTemplate (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.actionCapitalizeContent (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.actionSetContentBold (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.actionAddUrlTag (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.capitalizeTextContent ( Paragraph  p  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.capitalizeTextContentRecursion ( Node  node  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.deleteSelectedComponent ( TCComponentListItem  item,
TCComposite  container 
) [private]

Reusable function to remove Sections or Paragraphs from the model

Parameters:
item the list-item representing the component to be removed
if a customized component has to be removed, this is the container from where to remove it.
returns the component that was deleted or the null-content object which represents the disabling of a corresponding template component

References mixconfig.panels.TermsAndConditionsContentDialog.TCComponentListItem.getStatus(), mixconfig.panels.TermsAndConditionsContentDialog.TCComponentListItem.getTemplateComponent(), and mixconfig.panels.TermsAndConditionsContentDialog.TCComponentListItem.getTranslationComponent().

Referenced by mixconfig.panels.TermsAndConditionsContentDialog.actionDeleteParagraph(), and mixconfig.panels.TermsAndConditionsContentDialog.actionDeleteSection().

void mixconfig.panels.TermsAndConditionsContentDialog.actionResetSection (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.actionResetParagraph (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.actionPreview (  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.resetCustomizedComponent ( TCComponentListItem  item,
TCComposite  container 
) [private]

void mixconfig.panels.TermsAndConditionsContentDialog.focusGained ( FocusEvent  e  ) 

void mixconfig.panels.TermsAndConditionsContentDialog.focusLost ( FocusEvent  e  ) 

void mixconfig.panels.TermsAndConditionsContentDialog.editSection ( String  content  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.editParagraph ( String  content  )  [private]

void mixconfig.panels.TermsAndConditionsContentDialog.enableComponents (  )  [protected]

to be invoked for enabling or disabling view components

References mixconfig.panels.TermsAndConditionsContentDialog.boldButton, mixconfig.panels.TermsAndConditionsContentDialog.capitalizeButton, mixconfig.panels.TermsAndConditionsContentDialog.fromTemplateButton, mixconfig.panels.TermsAndConditionsContentDialog.isContentCapitalizable(), mixconfig.panels.TermsAndConditionsContentDialog.isContentFromTemplateAvailable(), mixconfig.panels.TermsAndConditionsContentDialog.isContentSetToBoldPossible(), mixconfig.panels.TermsAndConditionsContentDialog.isParagraphAddable(), mixconfig.panels.TermsAndConditionsContentDialog.isParagraphDeletable(), mixconfig.panels.TermsAndConditionsContentDialog.isParagraphEditable(), mixconfig.panels.TermsAndConditionsContentDialog.isParagraphResettable(), mixconfig.panels.TermsAndConditionsContentDialog.isParagraphSelectable(), mixconfig.panels.TermsAndConditionsPanel.isPreviewPossible(), mixconfig.panels.TermsAndConditionsContentDialog.isSectionDeletable(), mixconfig.panels.TermsAndConditionsContentDialog.isSectionNameEditable(), mixconfig.panels.TermsAndConditionsContentDialog.isSectionResettable(), mixconfig.panels.TermsAndConditionsContentDialog.isSectionSelectable(), mixconfig.panels.TermsAndConditionsContentDialog.paragraphAddButton, mixconfig.panels.TermsAndConditionsContentDialog.paragraphChoice, mixconfig.panels.TermsAndConditionsContentDialog.paragraphDeleteButton, mixconfig.panels.TermsAndConditionsContentDialog.paragraphResetButton, mixconfig.panels.TermsAndConditionsContentDialog.parentPanel, mixconfig.panels.TermsAndConditionsContentDialog.previewButton, mixconfig.panels.TermsAndConditionsContentDialog.sectionChoice, mixconfig.panels.TermsAndConditionsContentDialog.sectionDeleteButton, mixconfig.panels.TermsAndConditionsContentDialog.sectionNameTranslation, mixconfig.panels.TermsAndConditionsContentDialog.sectionResetButton, and mixconfig.panels.TermsAndConditionsContentDialog.translationText.

Referenced by mixconfig.panels.TermsAndConditionsContentDialog.actionPerformed(), mixconfig.panels.TermsAndConditionsContentDialog.focusLost(), and mixconfig.panels.TermsAndConditionsContentDialog.itemStateChanged().

boolean mixconfig.panels.TermsAndConditionsContentDialog.isSectionSelectable (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isSectionResettable (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isSectionDeletable (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isParagraphSelectable (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isParagraphDeletable (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isParagraphResettable (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isParagraphEditable (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isContentCapitalizable (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isContentSetToBoldPossible (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isContentFromTemplateAvailable (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isParagraphAddable (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isSectionNameEditable (  )  [private]

boolean mixconfig.panels.TermsAndConditionsContentDialog.isItemDeletable ( TCComponentListItem  item  )  [private]

static TCComposite mixconfig.panels.TermsAndConditionsContentDialog.showContentDialog ( TermsAndConditionsPanel  parentPanel,
TermsAndConditionsTemplate  template,
TermsAndConditionsTranslation  translation 
) [static]

used to synchronously show a T&C content management dialog and return the customized sections as result.

Parameters:
parentPanel the parentComponent of the content management dialog
template the base template from which the content shall be customized
translation the translation from which to take the customized content.
Returns:
the sections containing the customized content.

References mixconfig.panels.TermsAndConditionsContentDialog.TermsAndConditionsContentDialog(), and mixconfig.panels.TermsAndConditionsContentDialog.translationSections.


Member Data Documentation

final String mixconfig.panels.TermsAndConditionsContentDialog.MSG_STATUS_PREFIX = TermsAndConditionsContentDialog.class.getName() + "_status" [static, package]

final String mixconfig.panels.TermsAndConditionsContentDialog.MSG_NAME = TermsAndConditionsContentDialog.class.getName() + "_name" [static, package]

final String mixconfig.panels.TermsAndConditionsContentDialog.MSG_ID = TermsAndConditionsContentDialog.class.getName() + "_id" [static, package]

final String mixconfig.panels.TermsAndConditionsContentDialog.MSG_ID_DESCRIPTION = TermsAndConditionsContentDialog.class.getName() + "_idDescription" [static, package]

final String mixconfig.panels.TermsAndConditionsContentDialog.MSG_BUTTON_FROM_TEMPLATE = TermsAndConditionsContentDialog.class.getName() + "_btnFromTemplate" [static, package]

final String mixconfig.panels.TermsAndConditionsContentDialog.MSG_BUTTON_CAPITALIZE = TermsAndConditionsContentDialog.class.getName() + "_btnCapitalize" [static, package]

final String mixconfig.panels.TermsAndConditionsContentDialog.MSG_BUTTON_BOLD = TermsAndConditionsContentDialog.class.getName() + "_btnBold" [static, package]

final String mixconfig.panels.TermsAndConditionsContentDialog.MSG_BUTTON_URL_TAG = TermsAndConditionsContentDialog.class.getName() + "_btnUrlTag" [static, package]

final String mixconfig.panels.TermsAndConditionsContentDialog.URL_TAG = "<Url></Url>" [static, package]


The documentation for this class was generated from the following file:

Generated on Mon Nov 16 23:24:48 2009 for MixConfig by  doxygen 1.5.6