mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
199379: update docs and tidy code
This commit is contained in:
parent
80e1e13539
commit
e96881fb2c
5 changed files with 57 additions and 39 deletions
|
@ -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/*<UIElement>*/();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UIElement
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.ui.templateengine.uitree.UIElement#setValues(java.util.Map)
|
||||
*/
|
||||
public void setValues(Map/*<String, String>*/ 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/*<String, String>*/ getValues() {
|
||||
|
||||
HashMap/*<String, String>*/ valueMap = new HashMap/*<String, String>*/();
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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$
|
||||
}
|
|
@ -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.
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -181,36 +181,40 @@ title.
|
|||
</p>
|
||||
<li>
|
||||
<p>
|
||||
<code>type</code>: Use this attribute to specify the wizard page
|
||||
type. The possible values for this attribute are:
|
||||
<code>type</code>: This attribute is for future expansion. Currently, the only
|
||||
valid value is:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<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.
|
||||
</p>
|
||||
|
||||
<!-- Constants currently unsupported
|
||||
<li>
|
||||
<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.
|
||||
</p>
|
||||
<li>
|
||||
<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.
|
||||
</p>
|
||||
<li>
|
||||
<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.
|
||||
</p>
|
||||
<li>
|
||||
<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.
|
||||
</p>
|
||||
</li>
|
||||
-->
|
||||
|
||||
</ul>
|
||||
<li>
|
||||
<p>
|
||||
|
|
Loading…
Add table
Reference in a new issue