[128715] Migrate property sheets to use platform API
[129840] Property Sheet hard to use
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java
index 4d73294..9dad7fb 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java
@@ -11,6 +11,9 @@
*******************************************************************************/
package org.eclipse.wst.dtd.ui.internal;
+import org.eclipse.jface.viewers.IPostSelectionProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IPageLayout;
@@ -19,8 +22,8 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySheetPageContributor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetPage;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
/**
@@ -29,21 +32,19 @@
* this class will be removed.
*/
public class DTDEditor extends StructuredTextEditor {
- private class DTDPropertySheetPageContributor implements ITabbedPropertySheetPageContributor {
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySheetPageContributor#getContributorId()
+ class DTDPropertySheetPageContributor implements ITabbedPropertySheetPageContributor {
+ DTDPropertySheetPageContributor() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor#getContributorId()
*/
public String getContributorId() {
return getEditorSite().getId();
}
-
- /**
- * @return String[]
- */
- public String[] getPropertyCategories() {
- return new String[]{DTDPropertiesMessages.DTDEditor_0, DTDPropertiesMessages.DTDEditor_1, DTDPropertiesMessages.DTDEditor_2, DTDPropertiesMessages.DTDEditor_3};
- }
-
}
TabbedPropertySheetPage fPropertySheetPage;
@@ -58,7 +59,20 @@
public Object getAdapter(Class required) {
if (IPropertySheetPage.class.equals(required)) {
if (fPropertySheetPage == null) {
- fPropertySheetPage = new TabbedPropertySheetPage(new DTDPropertySheetPageContributor());
+ fPropertySheetPage = new DTDTabbedPropertySheetPage(new DTDPropertySheetPageContributor());
+ /*
+ * Add the property sheet page as a direct post selection
+ * listener so standard cursor navigation triggers a selection
+ * notification. The default tabbed property sheet does not
+ * listen to post selection.
+ */
+ ((IPostSelectionProvider) getSelectionProvider()).addPostSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ if (fPropertySheetPage != null && !fPropertySheetPage.getControl().isDisposed()) {
+ fPropertySheetPage.selectionChanged(DTDEditor.this, getSelectionProvider().getSelection());
+ }
+ }
+ });
}
return fPropertySheetPage;
}
@@ -68,7 +82,7 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
+ * @see org.eclipse.wst.sse.ui.StructuredTextEditor#init(org.eclipse.ui.IEditorSite,
* org.eclipse.ui.IEditorInput)
*/
public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDTabbedPropertySheetPage.java
new file mode 100644
index 0000000..10ca85e
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDTabbedPropertySheetPage.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *
+ *******************************************************************************/
+package org.eclipse.wst.dtd.ui.internal;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+class DTDTabbedPropertySheetPage extends TabbedPropertySheetPage {
+
+ private ISelection oldSelection = null;
+
+ public DTDTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor) {
+ super(tabbedPropertySheetPageContributor);
+ }
+
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ IWorkbenchWindow workbenchWindow = getSite().getWorkbenchWindow();
+ if (workbenchWindow != null) {
+ IWorkbenchPage activePage = workbenchWindow.getActivePage();
+ if (activePage != null) {
+ IEditorPart activeEditor = activePage.getActiveEditor();
+ if (activeEditor != null) {
+ // make sure the correct editor is active
+ if (activeEditor.getAdapter(IPropertySheetPage.class) == DTDTabbedPropertySheetPage.this) {
+ if (oldSelection == null || !oldSelection.equals(selection)) {
+ oldSelection = selection;
+ super.selectionChanged(part, selection);
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java
index e9c09e6..2674741 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java
@@ -31,9 +31,9 @@
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.part.EditorActionBarContributor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetPage;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.ISection;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
import org.w3c.dom.Element;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSectionDescriptor.java
deleted file mode 100644
index 5266776..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSectionDescriptor.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITypeMapper;
-import org.w3c.dom.Element;
-
-public class AbstractSectionDescriptor implements ISectionDescriptor {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return ""; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getFilter()
- */
- public ITypeMapper getFilter() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes() {
- List list = new ArrayList();
- // list.add(XSDConcreteComponent.class);
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof StructuredSelection) {
- StructuredSelection structuredSelection = (StructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- // System.out.println("fSelection is: " + object);
- if (object instanceof Element) {
- return true;
- }
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getAfterSection()
- */
- public String getAfterSection() {
- return ""; //$NON-NLS-1$
- }
-
- protected boolean inputEquals(Object input, String tagname, boolean isRef) {
- return false;
- }
-
- public int getEnablesFor() {
- return ENABLES_FOR_ANY;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java
index 41859e8..07a5b65 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java
@@ -20,8 +20,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.Attribute;
import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSectionDescriptor.java
deleted file mode 100644
index bd220fb..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSectionDescriptor.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-
-public class AttributeDefaultSectionDescriptor extends AbstractSectionDescriptor {
- private AttributeDefaultSection attributeDefaultSection;
-
- public AttributeDefaultSectionDescriptor() {
- super();
- attributeDefaultSection = new AttributeDefaultSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.attributedefault"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes() {
- List list = new ArrayList();
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return attributeDefaultSection;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof Attribute)
- return true;
- else
- return false;
- }
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java
index b6e5900..1c9f2df 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java
@@ -17,7 +17,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.Comment;
public class CommentSection extends AbstractSection {
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSectionDescriptor.java
deleted file mode 100644
index cde6eea..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSectionDescriptor.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.Comment;
-
-public class CommentSectionDescriptor extends AbstractSectionDescriptor {
- /**
- *
- */
- public CommentSectionDescriptor() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.comment"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes() {
- List list = new ArrayList();
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return new CommentSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof Comment)
- return true;
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java
index 8aaff7a..18fee0e 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java
@@ -18,8 +18,8 @@
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.CMGroupNode;
import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSectionDescriptor.java
deleted file mode 100644
index 089acf3..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSectionDescriptor.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-
-public class ContentModelGroupSectionDescriptor extends AbstractSectionDescriptor {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.modelgroup"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes() {
- List list = new ArrayList();
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return new ContentModelGroupSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof CMGroupNode)
- return true;
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameFilter.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameFilter.java
new file mode 100644
index 0000000..7150bff
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameFilter.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *
+ *******************************************************************************/
+package org.eclipse.wst.dtd.ui.internal.properties.section;
+
+import org.eclipse.jface.viewers.IFilter;
+import org.eclipse.wst.dtd.core.internal.CMBasicNode;
+
+public class ContentModelNameFilter implements IFilter {
+ public boolean select(Object toTest) {
+ return toTest instanceof CMBasicNode && !((CMBasicNode) toTest).isRootElementContent();
+ }
+}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java
index e96b8d6..55e68bc 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java
@@ -20,8 +20,8 @@
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.CMBasicNode;
import org.eclipse.wst.dtd.core.internal.CMNode;
import org.eclipse.wst.dtd.core.internal.DTDNode;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSectionDescriptor.java
deleted file mode 100644
index fb68035..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSectionDescriptor.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-
-public class ContentModelNameSectionDescriptor extends AbstractSectionDescriptor {
- private ContentModelNameSection contentModelNameSection;
-
- public ContentModelNameSectionDescriptor() {
- super();
- contentModelNameSection = new ContentModelNameSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.contentmodelname"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes() {
- List list = new ArrayList();
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return contentModelNameSection;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof CMBasicNode && !((CMBasicNode) object).isRootElementContent())
- return true;
- else
- return false;
- }
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeFilter.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeFilter.java
new file mode 100644
index 0000000..3fdac83
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeFilter.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *
+ *******************************************************************************/
+package org.eclipse.wst.dtd.ui.internal.properties.section;
+
+import org.eclipse.jface.viewers.IFilter;
+import org.eclipse.wst.dtd.core.internal.CMBasicNode;
+import org.eclipse.wst.dtd.core.internal.CMGroupNode;
+
+public class ContentModelTypeFilter implements IFilter {
+ public boolean select(Object toTest) {
+ if (toTest instanceof CMBasicNode && !((CMBasicNode) toTest).isRootElementContent())
+ return true;
+ if (toTest instanceof CMGroupNode && ((CMGroupNode) toTest).isRootElementContent())
+ return true;
+ return false;
+ }
+}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java
index ede6580..e26fcc2 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java
@@ -20,8 +20,8 @@
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.CMBasicNode;
import org.eclipse.wst.dtd.core.internal.CMGroupNode;
import org.eclipse.wst.dtd.core.internal.CMNode;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSectionDescriptor.java
deleted file mode 100644
index 5c2ac1c..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSectionDescriptor.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-
-public class ContentModelTypeSectionDescriptor extends AbstractSectionDescriptor {
- private ContentModelTypeSection contentModelTypeSection;
-
- public ContentModelTypeSectionDescriptor() {
- super();
- contentModelTypeSection = new ContentModelTypeSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.contentmodeltype"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes() {
- List list = new ArrayList();
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return contentModelTypeSection;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof CMGroupNode && ((CMGroupNode) object).isRootElementContent())
- return true;
- else if (object instanceof CMBasicNode && ((CMBasicNode) object).isRootElementContent()) // ANY,
- // EMPTY,
- // PCDATA
- return true;
- else
- return false;
- }
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionDescriptorProvider.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionDescriptorProvider.java
deleted file mode 100644
index d838230..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionDescriptorProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptorProvider;
-
-public class DTDSectionDescriptorProvider implements ISectionDescriptorProvider {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptorProvider#getSectionDescriptors()
- */
- public ISectionDescriptor[] getSectionDescriptors() {
- ISectionDescriptor[] descriptors = new ISectionDescriptor[11];
-
- descriptors[0] = new NameSectionDescriptor();
- descriptors[1] = new ContentModelTypeSectionDescriptor();
- descriptors[2] = new TypeSectionDescriptor();
- descriptors[3] = new AttributeDefaultSectionDescriptor();
- descriptors[4] = new ContentModelGroupSectionDescriptor();
- descriptors[5] = new ContentModelNameSectionDescriptor();
- descriptors[6] = new OccurrenceSectionDescriptor();
- descriptors[7] = new CommentSectionDescriptor();
- descriptors[8] = new DocumentSectionDescriptor();
- // descriptors[9] = new EntityTypeSectionDescriptor();
- // descriptors[10]= new EntityValueSectionDescriptor();
- descriptors[9] = new NotationSectionDescriptor();
- descriptors[10] = new NewEntitySectionDescriptor();
- // descriptors[11]= new EmptySectionDescriptor();
- return descriptors;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java
index 1583e3a..4bd37ac 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java
@@ -11,7 +11,8 @@
*******************************************************************************/
package org.eclipse.wst.dtd.ui.internal.properties.section;
-import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.graphics.Image;
@@ -40,19 +41,21 @@
}
Image result = null;
- if (object instanceof StructuredSelection) {
- Object selected = ((StructuredSelection) object).getFirstElement();
- if (selected instanceof DTDFile) {
- return null; // ((DTDFile) selected).getImage();
- }
- else if (selected instanceof DTDNode) {
- if (selected instanceof ParameterEntityReference)
- return null;
- return ((DTDNode) selected).getImage();
- }
- else if (selected instanceof org.w3c.dom.Element) {
+
+ Object selected = object;
+ if (object instanceof IStructuredSelection) {
+ selected = ((IStructuredSelection) object).getFirstElement();
+ }
+ if (selected instanceof DTDFile) {
+ return null; // ((DTDFile) selected).getImage();
+ }
+ else if (selected instanceof DTDNode) {
+ if (selected instanceof ParameterEntityReference)
return null;
- }
+ return ((DTDNode) selected).getImage();
+ }
+ else if (selected instanceof org.w3c.dom.Element) {
+ return null;
}
return result;
}
@@ -65,69 +68,69 @@
return null;
}
- if (object instanceof StructuredSelection) {
- Object selected = ((StructuredSelection) object).getFirstElement();
- if (selected instanceof DTDFile) {
- return null; // ((DTDFile) selected).getName();
- }
- else if (selected instanceof CMBasicNode) {
- if (((CMBasicNode) selected).isReference())
- return DTDPropertiesMessages._UI_PROPERTIES_VIEW_TITLE_ELEMENT_REF;
- else
- return ((CMBasicNode) selected).getName();
- }
- else if (selected instanceof CMRepeatableNode) {
- CMRepeatableNode node = (CMRepeatableNode) selected;
- String name = node.getName();
- if (node instanceof CMGroupNode) {
- if (((CMGroupNode) node).getConnector() == CMGroupNode.CHOICE)
- name = DTDPropertiesMessages.DTDSectionLabelProvider_0;
- else
- name = DTDPropertiesMessages.DTDSectionLabelProvider_1;
- }
- char occurrence = node.getOccurrence();
- switch (occurrence) {
- case CMRepeatableNode.ONCE :
- name += " [1..1]"; //$NON-NLS-1$
- break;
- case CMRepeatableNode.OPTIONAL :
- name += " [0..1]"; //$NON-NLS-1$
- break;
- case CMRepeatableNode.ONE_OR_MORE :
- name += " [1..*]"; //$NON-NLS-1$
- break;
- case CMRepeatableNode.ZERO_OR_MORE :
- name += " [0..*]"; //$NON-NLS-1$
- break;
- }
- return name;
- }
- else if (selected instanceof DTDNode) {
- if (selected instanceof Element)
- return DTDPropertiesMessages.DTDSectionLabelProvider_6;
- else if (selected instanceof Attribute)
- return DTDPropertiesMessages.DTDSectionLabelProvider_7;
- else if (selected instanceof AttributeList)
- return DTDPropertiesMessages.DTDSectionLabelProvider_8;
- else if (selected instanceof Comment)
- return DTDPropertiesMessages.DTDSectionLabelProvider_9;
- else if (selected instanceof Entity)
- return DTDPropertiesMessages.DTDSectionLabelProvider_10;
- else if (selected instanceof Notation)
- return DTDPropertiesMessages.DTDSectionLabelProvider_11;
- else if (selected instanceof ParameterEntityReference)
- // return "parameter entity reference";
- return null;
- else
- return ((DTDNode) selected).getName();
- }
- else if (selected instanceof org.w3c.dom.Element) {
- return ((org.w3c.dom.Element) selected).getLocalName();
- }
- else
- return ""; //$NON-NLS-1$
+ Object selected = object;
+ if (object instanceof IStructuredSelection) {
+ selected = ((IStructuredSelection) object).getFirstElement();
}
- else if (object instanceof TextSelection) {
+
+ if (selected instanceof DTDFile) {
+ return ((DTDFile) selected).getName();
+ }
+ else if (selected instanceof CMBasicNode) {
+ if (((CMBasicNode) selected).isReference())
+ return DTDPropertiesMessages._UI_PROPERTIES_VIEW_TITLE_ELEMENT_REF;
+ else
+ return ((CMBasicNode) selected).getName();
+ }
+ else if (selected instanceof CMRepeatableNode) {
+ CMRepeatableNode node = (CMRepeatableNode) selected;
+ String name = node.getName();
+ if (node instanceof CMGroupNode) {
+ if (((CMGroupNode) node).getConnector() == CMGroupNode.CHOICE)
+ name = DTDPropertiesMessages.DTDSectionLabelProvider_0;
+ else
+ name = DTDPropertiesMessages.DTDSectionLabelProvider_1;
+ }
+ char occurrence = node.getOccurrence();
+ switch (occurrence) {
+ case CMRepeatableNode.ONCE :
+ name += " [1..1]"; //$NON-NLS-1$
+ break;
+ case CMRepeatableNode.OPTIONAL :
+ name += " [0..1]"; //$NON-NLS-1$
+ break;
+ case CMRepeatableNode.ONE_OR_MORE :
+ name += " [1..*]"; //$NON-NLS-1$
+ break;
+ case CMRepeatableNode.ZERO_OR_MORE :
+ name += " [0..*]"; //$NON-NLS-1$
+ break;
+ }
+ return name;
+ }
+ else if (selected instanceof DTDNode) {
+ if (selected instanceof Element)
+ return DTDPropertiesMessages.DTDSectionLabelProvider_6;
+ else if (selected instanceof Attribute)
+ return DTDPropertiesMessages.DTDSectionLabelProvider_7;
+ else if (selected instanceof AttributeList)
+ return DTDPropertiesMessages.DTDSectionLabelProvider_8;
+ else if (selected instanceof Comment)
+ return DTDPropertiesMessages.DTDSectionLabelProvider_9;
+ else if (selected instanceof Entity)
+ return DTDPropertiesMessages.DTDSectionLabelProvider_10;
+ else if (selected instanceof Notation)
+ return DTDPropertiesMessages.DTDSectionLabelProvider_11;
+ else if (selected instanceof ParameterEntityReference)
+ // return "parameter entity reference";
+ return null;
+ else
+ return ((DTDNode) selected).getName();
+ }
+ else if (selected instanceof org.w3c.dom.Element) {
+ return ((org.w3c.dom.Element) selected).getLocalName();
+ }
+ else if (object instanceof ITextSelection) {
return ""; //$NON-NLS-1$
}
else
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDTypeMapper.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDTypeMapper.java
new file mode 100644
index 0000000..04e35d8
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDTypeMapper.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *
+ *******************************************************************************/
+package org.eclipse.wst.dtd.ui.internal.properties.section;
+
+import org.eclipse.ui.views.properties.tabbed.ITypeMapper;
+
+public class DTDTypeMapper implements ITypeMapper {
+ public DTDTypeMapper() {
+ super();
+ }
+
+ public Class mapType(Object object) {
+ return object.getClass();
+ }
+}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java
index f913043..4f720eb 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java
@@ -19,7 +19,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.Comment;
import org.eclipse.wst.dtd.core.internal.DTDNode;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSectionDescriptor.java
deleted file mode 100644
index 9f37afb..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSectionDescriptor.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.Notation;
-
-public class DocumentSectionDescriptor extends AbstractSectionDescriptor {
- /**
- *
- */
- public DocumentSectionDescriptor() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.document"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes() {
- List list = new ArrayList();
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return new DocumentSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.documentation"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- /*
- * if (object instanceof DTDNode) { DTDNode node =
- * (DTDNode)object; Iterator iterator =
- * node.getDTDFile().getNodes().iterator(); DTDNode currentNode =
- * null; DTDNode prevNode = null; while (iterator.hasNext()) {
- * currentNode = (DTDNode)iterator.next(); if (node == currentNode &&
- * prevNode != null && prevNode instanceof Comment) return true;
- * else prevNode = currentNode; }
- *
- * return false; }
- */
- if (object instanceof Element || object instanceof Entity || object instanceof AttributeList || object instanceof Notation)
- return true;
- else
- return false;
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java
index a3d661a..ea7e617 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java
@@ -13,7 +13,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
public class EmptySection extends AbstractSection {
public void doHandleEvent(Event event) {
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySectionDescriptor.java
deleted file mode 100644
index 594ca8e..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySectionDescriptor.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-public class EmptySectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.emptySection"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return new EmptySection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof DTDFile || object instanceof IndexedRegion)
- return true;
- else
- return false;
- }
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java
index e90262c..075f9e7 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java
@@ -19,8 +19,8 @@
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.Entity;
import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSectionDescriptor.java
deleted file mode 100644
index cdd4e96..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSectionDescriptor.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.Entity;
-
-public class EntityTypeSectionDescriptor extends AbstractSectionDescriptor {
- private EntityTypeSection entityTypeSection;
-
- public EntityTypeSectionDescriptor() {
- super();
- entityTypeSection = new EntityTypeSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.entitytype"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes() {
- List list = new ArrayList();
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return entityTypeSection;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof Entity)
- return true;
- else
- return false;
- }
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java
index b65f61b..febd7a8 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java
@@ -18,8 +18,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.Entity;
import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSectionDescriptor.java
deleted file mode 100644
index de2b608..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSectionDescriptor.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.dtd.core.internal.Entity;
-
-public class EntityValueSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.entityValue"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return new EntityValueSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.other"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof Entity)
- return true;
- else
- return false;
- }
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java
index 0506fe8..7ced288 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java
@@ -18,8 +18,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.DTDNode;
import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSectionDescriptor.java
deleted file mode 100644
index 6c16a63..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSectionDescriptor.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Notation;
-
-public class NameSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.name"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- /*
- * public List getInputTypes() { List list = new ArrayList();
- * list.add(DTDNode.class); return list; }
- */
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return new NameSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof Element
- // || object instanceof Entity
- || object instanceof Attribute || object instanceof AttributeList || object instanceof Notation)
- return true;
- else
- return false;
- }
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java
index a6e8a1e..95afdb0 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java
@@ -31,9 +31,9 @@
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.common.ui.internal.viewers.ResourceFilter;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
import org.eclipse.wst.dtd.core.internal.Entity;
import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySectionDescriptor.java
deleted file mode 100644
index a677077..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySectionDescriptor.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.Entity;
-
-public class NewEntitySectionDescriptor extends AbstractSectionDescriptor {
- NewEntitySection entitySection;
-
- /**
- *
- */
- public NewEntitySectionDescriptor() {
- super();
- entitySection = new NewEntitySection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.newEntitySection"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes() {
- List list = new ArrayList();
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return entitySection;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
-
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof Entity)
- return true;
- else
- return false;
- }
-
- return false;
- }
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java
index 83c3d80..c164dd0 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java
@@ -18,8 +18,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.Notation;
import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSectionDescriptor.java
deleted file mode 100644
index b381e34..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSectionDescriptor.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor;
-import org.eclipse.wst.dtd.core.internal.Notation;
-
-public class NotationSectionDescriptor extends AbstractSectionDescriptor implements ISectionDescriptor {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.notation"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return new NotationSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof Notation)
- return true;
- else
- return false;
- }
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceFilter.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceFilter.java
new file mode 100644
index 0000000..eb57e01
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceFilter.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *
+ *******************************************************************************/
+package org.eclipse.wst.dtd.ui.internal.properties.section;
+
+import org.eclipse.jface.viewers.IFilter;
+import org.eclipse.wst.dtd.core.internal.CMBasicNode;
+import org.eclipse.wst.dtd.core.internal.CMRepeatableNode;
+
+public class OccurrenceFilter implements IFilter {
+ public boolean select(Object toTest) {
+ if (toTest instanceof CMBasicNode && ((CMBasicNode) toTest).isEmptyAnyOrPCData())
+ return false;
+ else if (toTest instanceof CMRepeatableNode)
+ return true;
+ return false;
+ }
+}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java
index 68f677e..fd1fb09 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java
@@ -18,8 +18,8 @@
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.CMRepeatableNode;
import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSectionDescriptor.java
deleted file mode 100644
index ed33469..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSectionDescriptor.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMRepeatableNode;
-
-public class OccurrenceSectionDescriptor extends AbstractSectionDescriptor {
- private OccurrenceSection occurenceSection;
-
- public OccurrenceSectionDescriptor() {
- super();
- occurenceSection = new OccurrenceSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.occurence"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes() {
- List list = new ArrayList();
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return occurenceSection;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof CMBasicNode && ((CMBasicNode) object).isEmptyAnyOrPCData())
- return false;
- else if (object instanceof CMRepeatableNode)
- return true;
- else
- return false;
- }
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java
index 4d43647..68d5334 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java
@@ -18,8 +18,8 @@
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
-import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.eclipse.wst.dtd.core.internal.Attribute;
import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSectionDescriptor.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSectionDescriptor.java
deleted file mode 100644
index 836d3ef..0000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSectionDescriptor.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.internal.properties.section;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.common.ui.properties.internal.provisional.ISection;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-
-public class TypeSectionDescriptor extends AbstractSectionDescriptor {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId() {
- return "org.eclipse.wst.dtd.ui.internal.section.type"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes() {
- List list = new ArrayList();
- return list;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass() {
- return new TypeSection();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab() {
- return "org.eclipse.wst.dtd.ui.internal.general"; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
- Object object = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- object = structuredSelection.getFirstElement();
-
- if (object instanceof Attribute)
- return true;
- else
- return false;
- }
- return false;
- }
-
-}
\ No newline at end of file