Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2010-12-30 14:02:27 -0500
committerkmoore2010-12-30 14:02:27 -0500
commitefff6ace83460ae1ba5eea7babaea2e4829323f3 (patch)
tree8d08ff5af516bb8d87c80f6db2608d3b727d0ed6
parent25a7d0612db77d72a87eb2abc104899698898d91 (diff)
downloadwebtools.dali-efff6ace83460ae1ba5eea7babaea2e4829323f3.tar.gz
webtools.dali-efff6ace83460ae1ba5eea7babaea2e4829323f3.tar.xz
webtools.dali-efff6ace83460ae1ba5eea7babaea2e4829323f3.zip
added navigator UI support for JAXB attribute(fields/properties)
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gifbin0 -> 124 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gifbin0 -> 193 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemContentProvider.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentFieldItemLabelProvider.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentPropertyItemLabelProvider.java51
8 files changed, 167 insertions, 0 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif
new file mode 100644
index 0000000000..d4cb4254d9
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif
new file mode 100644
index 0000000000..7d24707ee8
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java
index 90ee2676c7..1b5ac5e342 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java
@@ -18,6 +18,8 @@ public class JptJaxbUiIcons
public static final String PACKAGE = "full/obj16/package";
public static final String PERSISTENT_CLASS = "full/obj16/persistent_class";
public static final String PERSISTENT_ENUM = "full/obj16/persistent_enum";
+ public static final String PERSISTENT_FIELD = "full/obj16/persistent_field";
+ public static final String PERSISTENT_PROPERTY = "full/obj16/persistent_property";
public static final String ENUM_CONSTANT = "full/obj16/enum_constant";
public static final String SCHEMA_GEN = "full/wizban/NewXSD";
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
index a95f89df89..8a8c409a71 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
@@ -13,6 +13,8 @@ import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
+import org.eclipse.jpt.jaxb.core.context.JaxbPersistentField;
+import org.eclipse.jpt.jaxb.core.context.JaxbPersistentProperty;
import org.eclipse.jpt.jaxb.core.context.JaxbType;
import org.eclipse.jpt.ui.jface.DelegatingContentAndLabelProvider;
import org.eclipse.jpt.ui.jface.ItemLabelProvider;
@@ -54,6 +56,12 @@ public class GenericJaxb_2_1_NavigatorItemLabelProviderFactory
else if (item instanceof JaxbType) {
return new JaxbTypeItemLabelProvider((JaxbType) item, contentAndLabelProvider);
}
+ else if (item instanceof JaxbPersistentField) {
+ return new JaxbPersistentFieldItemLabelProvider((JaxbPersistentField) item, contentAndLabelProvider);
+ }
+ else if (item instanceof JaxbPersistentProperty) {
+ return new JaxbPersistentPropertyItemLabelProvider((JaxbPersistentProperty) item, contentAndLabelProvider);
+ }
else if (item instanceof JaxbEnumConstant) {
return new JaxbEnumConstantItemLabelProvider((JaxbEnumConstant) item, contentAndLabelProvider);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java
index 5409e730ce..8a378e25c1 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java
@@ -11,6 +11,7 @@ package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
+import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
@@ -51,6 +52,9 @@ public class GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory
else if (item instanceof JaxbPackage) {
return new JaxbPackageItemContentProvider((JaxbPackage) item, treeContentAndLabelProvider);
}
+ else if (item instanceof JaxbPersistentClass) {
+ return new JaxbPersistentClassItemContentProvider((JaxbPersistentClass) item, treeContentAndLabelProvider);
+ }
else if (item instanceof JaxbPersistentEnum) {
return new JaxbPersistentEnumItemContentProvider((JaxbPersistentEnum) item, treeContentAndLabelProvider);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemContentProvider.java
new file mode 100644
index 0000000000..a91c447eb1
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemContentProvider.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
+
+import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
+import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
+import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
+import org.eclipse.jpt.ui.internal.jface.AbstractTreeItemContentProvider;
+import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
+import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
+import org.eclipse.jpt.utility.model.value.CollectionValueModel;
+
+
+public class JaxbPersistentClassItemContentProvider
+ extends AbstractTreeItemContentProvider<JaxbPersistentAttribute> {
+
+ public JaxbPersistentClassItemContentProvider(
+ JaxbPersistentClass jaxbPersistentClass, DelegatingTreeContentAndLabelProvider contentProvider) {
+
+ super(jaxbPersistentClass, contentProvider);
+ }
+
+
+ @Override
+ public JaxbPersistentClass getModel() {
+ return (JaxbPersistentClass) super.getModel();
+ }
+
+ @Override
+ public JaxbContextRoot getParent() {
+ return (JaxbContextRoot) getModel().getParent();
+ }
+
+ @Override
+ protected CollectionValueModel<JaxbPersistentAttribute> buildChildrenModel() {
+ return new CollectionAspectAdapter<JaxbPersistentClass, JaxbPersistentAttribute>(
+ JaxbPersistentClass.ATTRIBUTES_COLLECTION, getModel()) {
+ @Override
+ protected Iterable<JaxbPersistentAttribute> getIterable() {
+ return this.subject.getAttributes();
+ }
+ };
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentFieldItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentFieldItemLabelProvider.java
new file mode 100644
index 0000000000..1e903de442
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentFieldItemLabelProvider.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
+
+import org.eclipse.jpt.jaxb.core.context.JaxbPersistentField;
+import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
+import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
+import org.eclipse.jpt.ui.internal.jface.AbstractItemLabelProvider;
+import org.eclipse.jpt.ui.jface.DelegatingContentAndLabelProvider;
+import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.graphics.Image;
+
+
+public class JaxbPersistentFieldItemLabelProvider
+ extends AbstractItemLabelProvider {
+
+ public JaxbPersistentFieldItemLabelProvider(
+ JaxbPersistentField jaxbField, DelegatingContentAndLabelProvider labelProvider) {
+
+ super(jaxbField, labelProvider);
+ }
+
+
+ @Override
+ public JaxbPersistentField model() {
+ return (JaxbPersistentField) super.model();
+ }
+
+ @Override
+ protected PropertyValueModel<Image> buildImageModel() {
+ return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.PERSISTENT_FIELD));
+ }
+
+ @Override
+ protected PropertyValueModel<String> buildTextModel() {
+ return new StaticPropertyValueModel<String>(model().getName());
+ }
+
+ @Override
+ protected PropertyValueModel<String> buildDescriptionModel() {
+ return new StaticPropertyValueModel<String>(model().getName());
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentPropertyItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentPropertyItemLabelProvider.java
new file mode 100644
index 0000000000..29bfd5698e
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentPropertyItemLabelProvider.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
+
+import org.eclipse.jpt.jaxb.core.context.JaxbPersistentProperty;
+import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
+import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
+import org.eclipse.jpt.ui.internal.jface.AbstractItemLabelProvider;
+import org.eclipse.jpt.ui.jface.DelegatingContentAndLabelProvider;
+import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.graphics.Image;
+
+
+public class JaxbPersistentPropertyItemLabelProvider
+ extends AbstractItemLabelProvider {
+
+ public JaxbPersistentPropertyItemLabelProvider(
+ JaxbPersistentProperty jaxbProperty, DelegatingContentAndLabelProvider labelProvider) {
+
+ super(jaxbProperty, labelProvider);
+ }
+
+
+ @Override
+ public JaxbPersistentProperty model() {
+ return (JaxbPersistentProperty) super.model();
+ }
+
+ @Override
+ protected PropertyValueModel<Image> buildImageModel() {
+ return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.PERSISTENT_PROPERTY));
+ }
+
+ @Override
+ protected PropertyValueModel<String> buildTextModel() {
+ return new StaticPropertyValueModel<String>(model().getName());
+ }
+
+ @Override
+ protected PropertyValueModel<String> buildDescriptionModel() {
+ return new StaticPropertyValueModel<String>(model().getName());
+ }
+}

Back to the top