1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

199379: update docs and tidy code

This commit is contained in:
Andrew Ferguson 2007-10-25 11:02:57 +00:00
parent 80e1e13539
commit e96881fb2c
5 changed files with 57 additions and 39 deletions

View file

@ -17,29 +17,30 @@ import java.util.Map;
import org.eclipse.cdt.ui.templateengine.uitree.uiwidgets.UIComposite; import org.eclipse.cdt.ui.templateengine.uitree.uiwidgets.UIComposite;
/** /**
*
* The GenericUIElementGroup extends UIElement, implements the default behaviour * The GenericUIElementGroup extends UIElement, implements the default behaviour
* expected from UIElementGroup. This gives behaviour expected for PAGES-ONLY * expected from UIElementGroup. This gives behaviour expected for PAGES-ONLY
* type. Any other type of UIElement groups can override the definitions given * type. Any other type of UIElement groups can override the definitions given
* to methods in this class. * to methods in this class.
* *
* @since 4.0
*/ */
public class GenericUIElementGroup extends UIElement { public class GenericUIElementGroup extends UIElement {
/** /**
* Type of UIElement group. The possible values are PAGES_ONLY, PAGES_TAB, * @deprecated use {@value UIGroupTypeEnum#PAGES_ONLY}
* PAGES_TREE, PAGES_TREE_TREE, PAGES_TAB_TREE. */
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$ public static String LOGTYPE = "UIElement"; //$NON-NLS-1$
UIGroupTypeEnum type = null; UIGroupTypeEnum type = null;
/** /**
* child list for this UIElement * child list for this UIElement
*/ */
@ -56,8 +57,9 @@ public class GenericUIElementGroup extends UIElement {
this.childList = new ArrayList/*<UIElement>*/(); this.childList = new ArrayList/*<UIElement>*/();
} }
/** /*
* @see UIElement * (non-Javadoc)
* @see org.eclipse.cdt.ui.templateengine.uitree.UIElement#setValues(java.util.Map)
*/ */
public void setValues(Map/*<String, String>*/ valueMap) { public void setValues(Map/*<String, String>*/ valueMap) {
int childCount = getChildCount(); 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/*<String, String>*/ getValues() { public Map/*<String, String>*/ getValues() {
HashMap/*<String, String>*/ valueMap = new HashMap/*<String, String>*/(); HashMap/*<String, String>*/ valueMap = new HashMap/*<String, String>*/();
int childCount = getChildCount(); int childCount = getChildCount();
@ -82,14 +84,15 @@ public class GenericUIElementGroup extends UIElement {
return valueMap; 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) { public void createWidgets(UIComposite uiComposite) {
int childCount = getChildCount(); int childCount = getChildCount();
// call createWidgets on all the contained // call createWidgets on all the contained
// UI wigets. // UI widgets.
if (uiComposite != null) { if (uiComposite != null) {
for (int i = 0; i < childCount; i++) { for (int i = 0; i < childCount; i++) {
getChild(i).createWidgets(uiComposite); getChild(i).createWidgets(uiComposite);
@ -131,7 +134,6 @@ public class GenericUIElementGroup extends UIElement {
* @param aUIElement * @param aUIElement
*/ */
public void addToChildList(UIElement aUIElement) { public void addToChildList(UIElement aUIElement) {
childList.add(aUIElement); childList.add(aUIElement);
} }
@ -143,7 +145,6 @@ public class GenericUIElementGroup extends UIElement {
* @return the child count of UIElement * @return the child count of UIElement
*/ */
public int getChildCount() { public int getChildCount() {
return childList.size(); return childList.size();
} }
@ -152,23 +153,24 @@ public class GenericUIElementGroup extends UIElement {
* during UIPage construction. * during UIPage construction.
*/ */
public UIGroupTypeEnum getType() { public UIGroupTypeEnum getType() {
return type; return type;
} }
// @see UIElement /*
* (non-Javadoc)
* @see org.eclipse.cdt.ui.templateengine.uitree.UIElement#isValid()
*/
public boolean isValid() { public boolean isValid() {
boolean retVal = true; boolean retVal = true;
int childCount = getChildCount(); int childCount = getChildCount();
for (int i = 0; i < childCount; i++) for (int i = 0; i < childCount; i++) {
if (!getChild(i).isValid()) { if (!getChild(i).isValid()) {
retVal = false; retVal = false;
break; break;
} }
}
return retVal; return retVal;
} }
} }

View file

@ -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$
}

View file

@ -65,7 +65,7 @@ public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper {
/** /**
* Given an XML Element, representing a PropertyElement. A UIElement for the * Given an XML Element, representing a PropertyElement. A UIElement for the
* same is returned. The Type attribute is verified, based on Type * 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. * method.
* *
* @param element * @param element
@ -172,11 +172,11 @@ public class UIElementTreeBuilderHelper implements IUIElementTreeBuilderHelper {
// PAGES(Groups). // PAGES(Groups).
if (type.equalsIgnoreCase(GenericUIElementGroup.PAGES_ONLY)) { if (type.equalsIgnoreCase(UIGroupTypeEnum.PAGES_ONLY.getId())) {
widgetElement = new SimpleUIElementGroup(uiAttributes); 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 // Note: This is not implemented now as we haven't found a use case
// for generating UI pages as TABS in a single page. // for generating UI pages as TABS in a single page.
} }

View file

@ -10,14 +10,12 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.ui.templateengine.uitree; package org.eclipse.cdt.ui.templateengine.uitree;
/** /**
* This class defines various types of UIElement groups. * This class defines various types of UIElement groups.
*/ */
public class UIGroupTypeEnum { public class UIGroupTypeEnum {
public static final UIGroupTypeEnum PAGES_ONLY = new UIGroupTypeEnum("PAGES_ONLY"); //$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$ public static final UIGroupTypeEnum PAGES_TAB = new UIGroupTypeEnum("PAGES-TAB"); //$NON-NLS-1$
private String id; private String id;
@ -36,6 +34,10 @@ public class UIGroupTypeEnum {
return id.hashCode(); return id.hashCode();
} }
public String getId() {
return id;
}
public String toString() { public String toString() {
return id; return id;
} }

View file

@ -181,36 +181,40 @@ title.
</p> </p>
<li> <li>
<p> <p>
<code>type</code>: Use this attribute to specify the wizard page <code>type</code>: This attribute is for future expansion. Currently, the only
type. The possible values for this attribute are: valid value is:
</p> </p>
<ul> <ul>
<li> <li>
<p> <p>
<code>PAGES_ONLY</code>: If you want all the properties to be <code>PAGES-ONLY</code>: If you want all the properties to be
listed in a simple page. listed in a simple page.
</p> </p>
<!-- Constants currently unsupported
<li> <li>
<p> <p>
<code>PAGES_TAB</code>: If you want all the properties to be <code>PAGES-TAB</code>: If you want all the properties to be
displayed as tabs in a page. displayed as tabs in a page.
</p> </p>
<li> <li>
<p> <p>
<code>PAGES_TREE</code>: If you want all the properties to be <code>PAGES-TREE</code>: If you want all the properties to be
displayed in a simple tree structure. displayed in a simple tree structure.
</p> </p>
<li> <li>
<p> <p>
<code>PAGES_TREE_TREE</code>: If you want all the properties to <code>PAGES-TREE-TREE</code>: If you want all the properties to
be displayed in a multi-level tree structure. be displayed in a multi-level tree structure.
</p> </p>
<li> <li>
<p> <p>
<code>PAGES_TAB_TREE</code>: If you want all the properties to be <code>PAGES-TAB-TREE</code>: If you want all the properties to be
displayed as tabs or as a tree structure. displayed as tabs or as a tree structure.
</p> </p>
</li> </li>
-->
</ul> </ul>
<li> <li>
<p> <p>