From e96881fb2ca40e7ce5cd4eaacbf330b425bd4b6a Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Thu, 25 Oct 2007 11:02:57 +0000 Subject: 199379: update docs and tidy code --- .../uitree/GenericUIElementGroup.java | 50 +++++++++++----------- .../templateengine/uitree/IPageTypeConstants.java | 10 +++++ .../uitree/UIElementTreeBuilderHelper.java | 6 +-- .../ui/templateengine/uitree/UIGroupTypeEnum.java | 10 +++-- .../Howtodeveloptemplates.html | 20 +++++---- 5 files changed, 57 insertions(+), 39 deletions(-) create mode 100644 core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/IPageTypeConstants.java diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/GenericUIElementGroup.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/GenericUIElementGroup.java index 56d14af1cf3..b7b853aa3bc 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/GenericUIElementGroup.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/GenericUIElementGroup.java @@ -17,29 +17,30 @@ import java.util.Map; import org.eclipse.cdt.ui.templateengine.uitree.uiwidgets.UIComposite; - /** - * * The GenericUIElementGroup extends UIElement, implements the default behaviour * expected from UIElementGroup. This gives behaviour expected for PAGES-ONLY * type. Any other type of UIElement groups can override the definitions given * to methods in this class. * + * @since 4.0 */ - public class GenericUIElementGroup extends UIElement { - /** - * Type of UIElement group. The possible values are PAGES_ONLY, PAGES_TAB, - * PAGES_TREE, PAGES_TREE_TREE, PAGES_TAB_TREE. + * @deprecated use {@value UIGroupTypeEnum#PAGES_ONLY} + */ + public static String PAGES_ONLY = UIGroupTypeEnum.PAGES_ONLY.getId(); + /** + * @deprecated use {@value UIGroupTypeEnum#PAGES_ONLY} + */ + public static String PAGES_TAB = UIGroupTypeEnum.PAGES_TAB.getId(); + /** + * @deprecated */ - public static String PAGES_ONLY = "PAGES-ONLY"; //$NON-NLS-1$ - public static String PAGES_TAB = "PAGES-TAB"; //$NON-NLS-1$ public static String LOGTYPE = "UIElement"; //$NON-NLS-1$ UIGroupTypeEnum type = null; - /** * child list for this UIElement */ @@ -56,8 +57,9 @@ public class GenericUIElementGroup extends UIElement { this.childList = new ArrayList/**/(); } - /** - * @see UIElement + /* + * (non-Javadoc) + * @see org.eclipse.cdt.ui.templateengine.uitree.UIElement#setValues(java.util.Map) */ public void setValues(Map/**/ valueMap) { int childCount = getChildCount(); @@ -67,11 +69,11 @@ public class GenericUIElementGroup extends UIElement { } } - /** - * @see UIElement + /* + * (non-Javadoc) + * @see org.eclipse.cdt.ui.templateengine.uitree.UIElement#getValues() */ public Map/**/ getValues() { - HashMap/**/ valueMap = new HashMap/**/(); int childCount = getChildCount(); @@ -82,14 +84,15 @@ public class GenericUIElementGroup extends UIElement { return valueMap; } - /** - * @see UIElement + /* + * (non-Javadoc) + * @see org.eclipse.cdt.ui.templateengine.uitree.UIElement#createWidgets(org.eclipse.cdt.ui.templateengine.uitree.uiwidgets.UIComposite) */ public void createWidgets(UIComposite uiComposite) { int childCount = getChildCount(); // call createWidgets on all the contained - // UI wigets. + // UI widgets. if (uiComposite != null) { for (int i = 0; i < childCount; i++) { getChild(i).createWidgets(uiComposite); @@ -131,7 +134,6 @@ public class GenericUIElementGroup extends UIElement { * @param aUIElement */ public void addToChildList(UIElement aUIElement) { - childList.add(aUIElement); } @@ -143,7 +145,6 @@ public class GenericUIElementGroup extends UIElement { * @return the child count of UIElement */ public int getChildCount() { - return childList.size(); } @@ -152,23 +153,24 @@ public class GenericUIElementGroup extends UIElement { * during UIPage construction. */ public UIGroupTypeEnum getType() { - return type; } - // @see UIElement + /* + * (non-Javadoc) + * @see org.eclipse.cdt.ui.templateengine.uitree.UIElement#isValid() + */ public boolean isValid() { - boolean retVal = true; int childCount = getChildCount(); - for (int i = 0; i < childCount; i++) + for (int i = 0; i < childCount; i++) { if (!getChild(i).isValid()) { retVal = false; break; } + } return retVal; } - } diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/IPageTypeConstants.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/IPageTypeConstants.java new file mode 100644 index 00000000000..11dcf5c241f --- /dev/null +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/IPageTypeConstants.java @@ -0,0 +1,10 @@ +package org.eclipse.cdt.ui.templateengine.uitree; + +public interface IPageTypeConstants { + /** + * Type of UIElement group. The possible values are PAGES_ONLY, PAGES_TAB, + * PAGES_TREE, PAGES_TREE_TREE, PAGES_TAB_TREE. + */ + + public static String LOGTYPE = "UIElement"; //$NON-NLS-1$ +} diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java index fe143e17ec7..23b198a8af7 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIElementTreeBuilderHelper.java @@ -65,7 +65,7 @@ public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper { /** * Given an XML Element, representing a PropertyElement. A UIElement for the * same is returned. The Type attribute is verified, based on Type - * approprioate UIWidget is instantiated. This calss the getUIWidget private + * appropriate UIWidget is instantiated. This class the getUIWidget private * method. * * @param element @@ -172,11 +172,11 @@ public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper { // PAGES(Groups). - if (type.equalsIgnoreCase(GenericUIElementGroup.PAGES_ONLY)) { + if (type.equalsIgnoreCase(UIGroupTypeEnum.PAGES_ONLY.getId())) { widgetElement = new SimpleUIElementGroup(uiAttributes); } - if (type.equalsIgnoreCase(GenericUIElementGroup.PAGES_TAB)) { + if (type.equalsIgnoreCase(UIGroupTypeEnum.PAGES_TAB.getId())) { // Note: This is not implemented now as we haven't found a use case // for generating UI pages as TABS in a single page. } diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIGroupTypeEnum.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIGroupTypeEnum.java index 179df093cf5..2a6a9ed027a 100644 --- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIGroupTypeEnum.java +++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/uitree/UIGroupTypeEnum.java @@ -10,14 +10,12 @@ *******************************************************************************/ package org.eclipse.cdt.ui.templateengine.uitree; - /** * This class defines various types of UIElement groups. */ - public class UIGroupTypeEnum { - public static final UIGroupTypeEnum PAGES_ONLY = new UIGroupTypeEnum("PAGES_ONLY"); //$NON-NLS-1$ - public static final UIGroupTypeEnum PAGES_TAB = new UIGroupTypeEnum("PAGES_TAB"); //$NON-NLS-1$ + public static final UIGroupTypeEnum PAGES_ONLY = new UIGroupTypeEnum("PAGES-ONLY"); //$NON-NLS-1$ + public static final UIGroupTypeEnum PAGES_TAB = new UIGroupTypeEnum("PAGES-TAB"); //$NON-NLS-1$ private String id; @@ -36,6 +34,10 @@ public class UIGroupTypeEnum { return id.hashCode(); } + public String getId() { + return id; + } + public String toString() { return id; } diff --git a/doc/org.eclipse.cdt.doc.isv/guide/projectTemplateEngine/Howtodeveloptemplates.html b/doc/org.eclipse.cdt.doc.isv/guide/projectTemplateEngine/Howtodeveloptemplates.html index 3861e5ab5ba..44692ba8d34 100644 --- a/doc/org.eclipse.cdt.doc.isv/guide/projectTemplateEngine/Howtodeveloptemplates.html +++ b/doc/org.eclipse.cdt.doc.isv/guide/projectTemplateEngine/Howtodeveloptemplates.html @@ -181,36 +181,40 @@ title.

  • -type: Use this attribute to specify the wizard page -type. The possible values for this attribute are: +type: This attribute is for future expansion. Currently, the only +valid value is:

    • -PAGES_ONLY: If you want all the properties to be -listed in a simple page. +PAGES-ONLY: If you want all the properties to be +listed in a simple page.

      + + +
  • -- cgit v1.2.3