Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsViewFactory.java')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsViewFactory.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsViewFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsViewFactory.java
new file mode 100644
index 00000000000..2fa57ccc31f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.common.ui/src/org/eclipse/papyrus/emf/facet/common/ui/internal/views/ElementsViewFactory.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ * 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:
+ * Nicolas Bros (Mia-Software) - Bug 372732 - [Facet] Rewrite the catalog views for 0.2
+ *******************************************************************************/
+
+package org.eclipse.papyrus.emf.facet.common.ui.internal.views;
+
+import java.util.Collection;
+
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views.IColumnDescription;
+import org.eclipse.papyrus.emf.facet.common.ui.internal.exported.views.IElementsViewFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.part.ViewPart;
+
+public class ElementsViewFactory implements IElementsViewFactory {
+
+ public ViewPart createElementsView(final Collection<? extends IColumnDescription> columns,
+ final ITreeContentProvider contentProvider, final Object input, final String title, final Image titleImage, final IOpenListener openListener) {
+ return new ElementsView(columns, contentProvider, input, title, titleImage, openListener);
+ }
+
+ public IColumnDescription createColumnDescription(final String columnText,
+ final String uniqueID, final int defaultWidth,
+ final ColumnLabelProvider columnLabelProvider) {
+ return new IColumnDescription() {
+ public String getUniqueID() {
+ return uniqueID;
+ }
+
+ public int getDefaultWidth() {
+ return defaultWidth;
+ }
+
+ public String getTitle() {
+ return columnText;
+ }
+
+ public ColumnLabelProvider getColumnLabelProvider() {
+ return columnLabelProvider;
+ }
+ };
+ }
+}

Back to the top