Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2010-12-15 13:33:45 -0500
committerkmoore2010-12-15 13:33:45 -0500
commit6a1386f063a9c2bcbf8dc34f71e91987fa850d77 (patch)
treeb7c0a9142e872cc03b153cfc8598f879759df293
parent62e8d72310608aa8005178dc619ded65f811e6c2 (diff)
downloadwebtools.dali-6a1386f063a9c2bcbf8dc34f71e91987fa850d77.tar.gz
webtools.dali-6a1386f063a9c2bcbf8dc34f71e91987fa850d77.tar.xz
webtools.dali-6a1386f063a9c2bcbf8dc34f71e91987fa850d77.zip
added enums, registries, and enum constants to the navigator view
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gifbin0 -> 124 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_enum.gifbin0 -> 361 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.java8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemContentProvider.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemLabelProvider.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java39
9 files changed, 210 insertions, 0 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif
new file mode 100644
index 0000000000..d4cb4254d9
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_enum.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_enum.gif
new file mode 100644
index 0000000000..15535f52f5
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_enum.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 d351ffdabd..90ee2676c7 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
@@ -17,6 +17,8 @@ public class JptJaxbUiIcons
public static final String JAXB_CONTENT = "full/obj16/jaxb_content";
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 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 f37b5b2cc2..a95f89df89 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
@@ -10,7 +10,9 @@
package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
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.JaxbType;
import org.eclipse.jpt.ui.jface.DelegatingContentAndLabelProvider;
import org.eclipse.jpt.ui.jface.ItemLabelProvider;
@@ -46,9 +48,15 @@ public class GenericJaxb_2_1_NavigatorItemLabelProviderFactory
else if (item instanceof JaxbPackage) {
return new JaxbPackageItemLabelProvider((JaxbPackage) item, contentAndLabelProvider);
}
+ else if (item instanceof JaxbPersistentEnum) {
+ return new JaxbPersistentEnumItemLabelProvider((JaxbPersistentEnum) item, contentAndLabelProvider);
+ }
else if (item instanceof JaxbType) {
return new JaxbTypeItemLabelProvider((JaxbType) item, contentAndLabelProvider);
}
+ else if (item instanceof JaxbEnumConstant) {
+ return new JaxbEnumConstantItemLabelProvider((JaxbEnumConstant) item, contentAndLabelProvider);
+ }
return null;
}
}
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 5e33b1ad2e..5409e730ce 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,8 @@ 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.JaxbPersistentEnum;
+import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
import org.eclipse.jpt.ui.jface.DelegatingContentAndLabelProvider;
import org.eclipse.jpt.ui.jface.TreeItemContentProvider;
@@ -49,6 +51,12 @@ public class GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory
else if (item instanceof JaxbPackage) {
return new JaxbPackageItemContentProvider((JaxbPackage) item, treeContentAndLabelProvider);
}
+ else if (item instanceof JaxbPersistentEnum) {
+ return new JaxbPersistentEnumItemContentProvider((JaxbPersistentEnum) item, treeContentAndLabelProvider);
+ }
+ else if (item instanceof JaxbRegistry) {
+ return new JaxbRegistryItemContentProvider((JaxbRegistry) item, treeContentAndLabelProvider);
+ }
return null;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.java
new file mode 100644
index 0000000000..d11ec38eb3
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.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.JaxbEnumConstant;
+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 JaxbEnumConstantItemLabelProvider
+ extends AbstractItemLabelProvider {
+
+ public JaxbEnumConstantItemLabelProvider(
+ JaxbEnumConstant jaxbEnumConstant, DelegatingContentAndLabelProvider labelProvider) {
+
+ super(jaxbEnumConstant, labelProvider);
+ }
+
+
+ @Override
+ public JaxbEnumConstant model() {
+ return (JaxbEnumConstant) super.model();
+ }
+
+ @Override
+ protected PropertyValueModel<Image> buildImageModel() {
+ return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.ENUM_CONSTANT));
+ }
+
+ @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/JaxbPersistentEnumItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemContentProvider.java
new file mode 100644
index 0000000000..6510e62098
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemContentProvider.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.JaxbEnumConstant;
+import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
+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 JaxbPersistentEnumItemContentProvider
+ extends AbstractTreeItemContentProvider<JaxbEnumConstant> {
+
+ public JaxbPersistentEnumItemContentProvider(
+ JaxbPersistentEnum jaxbPersistentEnum, DelegatingTreeContentAndLabelProvider contentProvider) {
+
+ super(jaxbPersistentEnum, contentProvider);
+ }
+
+
+ @Override
+ public JaxbPersistentEnum getModel() {
+ return (JaxbPersistentEnum) super.getModel();
+ }
+
+ @Override
+ public JaxbContextRoot getParent() {
+ return (JaxbContextRoot) getModel().getParent();
+ }
+
+ @Override
+ protected CollectionValueModel<JaxbEnumConstant> buildChildrenModel() {
+ return new CollectionAspectAdapter<JaxbPersistentEnum, JaxbEnumConstant>(
+ JaxbPersistentEnum.ENUM_CONSTANTS_COLLECTION, getModel()) {
+ @Override
+ protected Iterable<JaxbEnumConstant> getIterable() {
+ return this.subject.getEnumConstants();
+ }
+ };
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemLabelProvider.java
new file mode 100644
index 0000000000..3798ce9162
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemLabelProvider.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.JaxbPersistentEnum;
+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 JaxbPersistentEnumItemLabelProvider
+ extends AbstractItemLabelProvider {
+
+ public JaxbPersistentEnumItemLabelProvider(
+ JaxbPersistentEnum jaxbEnum, DelegatingContentAndLabelProvider labelProvider) {
+
+ super(jaxbEnum, labelProvider);
+ }
+
+ @Override
+ public JaxbPersistentEnum model() {
+ return (JaxbPersistentEnum) super.model();
+ }
+
+ @Override
+ protected PropertyValueModel<Image> buildImageModel() {
+ return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.PERSISTENT_ENUM));
+ }
+
+ @Override
+ protected PropertyValueModel<String> buildTextModel() {
+ return new StaticPropertyValueModel(model().getTypeQualifiedName());
+ }
+
+ @Override
+ protected PropertyValueModel<String> buildDescriptionModel() {
+ return new StaticPropertyValueModel(
+ model().getFullyQualifiedName() + " - " + model().getResource().getFullPath().makeRelative());
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java
new file mode 100644
index 0000000000..b8c677b10a
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.JaxbElementFactoryMethod;
+import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
+import org.eclipse.jpt.ui.internal.jface.AbstractTreeItemContentProvider;
+import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
+
+
+public class JaxbRegistryItemContentProvider
+ extends AbstractTreeItemContentProvider<JaxbElementFactoryMethod> {
+
+ public JaxbRegistryItemContentProvider(
+ JaxbRegistry jaxbRegistry, DelegatingTreeContentAndLabelProvider contentProvider) {
+
+ super(jaxbRegistry, contentProvider);
+ }
+
+
+ @Override
+ public JaxbRegistry getModel() {
+ return (JaxbRegistry) super.getModel();
+ }
+
+ @Override
+ public JaxbContextRoot getParent() {
+ return (JaxbContextRoot) getModel().getParent();
+ }
+
+}

Back to the top