Author: adietish
Date: 2012-01-30 10:16:27 -0500 (Mon, 30 Jan 2012)
New Revision: 38270
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/propertytable/ContainerElement.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/propertytable/StringElement.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsContentProvider.java
Log:
removed info-node from properties-tree
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/propertytable/ContainerElement.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/propertytable/ContainerElement.java 2012-01-30
14:31:50 UTC (rev 38269)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/propertytable/ContainerElement.java 2012-01-30
15:16:27 UTC (rev 38270)
@@ -19,6 +19,10 @@
private final List<Object> children;
private final ContainerElement parent;
+ public ContainerElement(String property) {
+ this(property, null);
+ }
+
public ContainerElement(String property, ContainerElement parent) {
this.property = property;
this.children = new ArrayList<Object>();
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/propertytable/StringElement.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/propertytable/StringElement.java 2012-01-30
14:31:50 UTC (rev 38269)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/propertytable/StringElement.java 2012-01-30
15:16:27 UTC (rev 38270)
@@ -15,10 +15,18 @@
private final String value;
private final boolean isLink;
+ public StringElement(String property, String value) {
+ this(property, value, false, null);
+ }
+
public StringElement(String property, String value, ContainerElement parent) {
this(property, value, false, parent);
}
+ public StringElement(String property, String value, boolean isLink) {
+ this(property, value, isLink, null);
+ }
+
public StringElement(String property, String value, boolean isLink, ContainerElement
parent) {
super(property, parent);
this.value = value;
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsContentProvider.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsContentProvider.java 2012-01-30
14:31:50 UTC (rev 38269)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsContentProvider.java 2012-01-30
15:16:27 UTC (rev 38270)
@@ -4,9 +4,12 @@
package org.jboss.tools.openshift.express.internal.ui.wizard;
import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
import
org.jboss.tools.openshift.express.internal.ui.propertytable.AbstractPropertyTableContentProvider;
import org.jboss.tools.openshift.express.internal.ui.propertytable.ContainerElement;
+import org.jboss.tools.openshift.express.internal.ui.propertytable.IProperty;
import org.jboss.tools.openshift.express.internal.ui.propertytable.StringElement;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
@@ -23,32 +26,32 @@
@Override
public Object[] getElements(Object inputElement) {
- Object[] elements = null;
+ List<IProperty> elements = new ArrayList<IProperty>();
if (inputElement instanceof IApplication) {
try {
IApplication application = (IApplication) inputElement;
- final ContainerElement infoContainer = new ContainerElement("info", null);
- infoContainer.add(new StringElement("Name", application.getName(),
infoContainer));
- infoContainer.add(new StringElement("Public URL",
application.getApplicationUrl().toString(), true,
- infoContainer));
- infoContainer.add(new StringElement("Type",
application.getCartridge().getName(), infoContainer));
- final SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd 'at'
HH:mm:ss");
- infoContainer.add(
- new StringElement("Created on",
format.format(application.getCreationTime()), infoContainer));
- infoContainer.add(new StringElement("UUID", application.getUUID(),
infoContainer));
- infoContainer.add(new StringElement("Git URL", application.getGitUri(),
infoContainer));
- infoContainer.add(createCartridges(application, infoContainer));
- elements = new Object[] { infoContainer };
+
+ elements.add(new StringElement("Name", application.getName()));
+ elements.add(
+ new StringElement("Public URL",
application.getApplicationUrl().toString(), true));
+ elements.add(new StringElement("Type",
application.getCartridge().getName()));
+ SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd 'at'
HH:mm:ss");
+ elements.add(
+ new StringElement("Created on",
format.format(application.getCreationTime())));
+ elements.add(new StringElement("UUID", application.getUUID()));
+ elements.add(new StringElement("Git URL", application.getGitUri()));
+ elements.add(createCartridges(application));
+
} catch (Exception e) {
Logger.error("Failed to display details for OpenShift application", e);
}
}
- return elements;
+ return elements.toArray();
}
- private ContainerElement createCartridges(IApplication application, ContainerElement
infoContainer)
+ private ContainerElement createCartridges(IApplication application)
throws OpenShiftException {
- ContainerElement cartridgesContainer = new ContainerElement("Cartridges",
infoContainer);
+ ContainerElement cartridgesContainer = new ContainerElement("Cartridges");
for (IEmbeddableCartridge cartridge : application.getEmbeddedCartridges()) {
cartridgesContainer.add(
new StringElement(cartridge.getName(), cartridge.getUrl().toString(), true,