Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.dtd.ui/src-properties/org')
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java102
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.java117
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.properties86
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDTabbedPropertySheetPage.java49
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java334
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java152
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java76
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java95
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameFilter.java21
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java110
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeFilter.java26
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java123
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java139
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSelectIncludeFileWizard.java79
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDTypeMapper.java24
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java101
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java50
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java141
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java185
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java96
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java376
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java131
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceFilter.java26
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java105
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java92
25 files changed, 0 insertions, 2836 deletions
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
deleted file mode 100644
index 9dad7fb04b..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDEditor.java
+++ /dev/null
@@ -1,102 +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;
-
-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;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-/**
- * A DTD Editor subclass StructuredTextEditor, required to supply a complete
- * replacement for the property sheet page. When a better solution is found,
- * this class will be removed.
- */
-public class DTDEditor extends StructuredTextEditor {
- class DTDPropertySheetPageContributor implements ITabbedPropertySheetPageContributor {
- DTDPropertySheetPageContributor() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor#getContributorId()
- */
- public String getContributorId() {
- return getEditorSite().getId();
- }
- }
-
- TabbedPropertySheetPage fPropertySheetPage;
-
- public DTDEditor() {
- super();
- }
-
- /*
- * @see IAdaptable#getAdapter(Class)
- */
- public Object getAdapter(Class required) {
- if (IPropertySheetPage.class.equals(required)) {
- if (fPropertySheetPage == null) {
- 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;
- }
- return super.getAdapter(required);
- }
-
- /*
- * (non-Javadoc)
- *
- * @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 {
- super.init(site, editorInput);
-
- IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = dw.getActivePage();
- try {
- if (page != null) {
- page.showView(IPageLayout.ID_PROP_SHEET);
- }
- }
- catch (PartInitException e) {
- Logger.logException(e);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.java
deleted file mode 100644
index eb8f90c80e..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.java
+++ /dev/null
@@ -1,117 +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;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-public class DTDPropertiesMessages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages"; //$NON-NLS-1$
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.OccurrenceSection.java
- public static String _UI_ONCE;
- public static String _UI_ONE_OR_MORE;
- public static String _UI_OPTIONAL;
- public static String _UI_ZERO_OR_MORE;
- public static String _UI_LABEL_OCCURRENCE;
- // org.eclipse.wst.dtd.ui.internal.properties.section.AttribueDefaultSection.java
- public static String _UI_DEFAULT;
- public static String _UI_LABEL_USAGE;
- public static String _UI_LABEL_DEFAULT_VALUE;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelGroupSection.java
- public static String _UI_SEQUENCE;
- public static String _UI_CHOICE;
- public static String _UI_LABEL_MODEL_GROUP;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelNameSection.java
- public static String _UI_LABEL_CONTENT_MODEL;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelTypeSection.java
- public static String _UI_LABEL_CONTENT_TYPE;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.NameSection.java
- public static String _UI_LABEL_NAME;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.TypeSection.java
- public static String _UI_LABEL_TYPE;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.EntityTypeSection.java
- public static String _UI_LABEL_ENTITY_TYPE;
- public static String _UI_LABEL_EXTERNAL_ENTITY;
- public static String _UI_LABEL_PARAMETER_ENTITY;
- public static String _UI_LABEL_GENERAL_ENTITY;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.EntityValueSection.java
- public static String _UI_LABEL_ENTITY_VALUE;
- public static String _UI_LABEL_PUBLIC_ID;
- public static String _UI_LABEL_SYSTEM_ID;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.DTDSectionLabelProvider
- public static String _UI_PROPERTIES_VIEW_TITLE_ELEMENT;
- public static String _UI_PROPERTIES_VIEW_TITLE_ELEMENT_REF;
- public static String _UI_PROPERTIES_VIEW_TITLE_CHOICE;
- public static String _UI_PROPERTIES_VIEW_TITLE_SEQUENCE;
- public static String _UI_PROPERTIES_VIEW_TITLE_ATTRIBUTE;
- public static String _UI_PROPERTIES_VIEW_TITLE_ATTLIST;
- public static String _UI_PROPERTIES_VIEW_TITLE_COMMENT;
- public static String _UI_PROPERTIES_VIEW_TITLE_ENTITY;
- public static String _UI_PROPERTIES_VIEW_TITLE_NOTATION;
-
- // org.eclipse.wst.dtd.ui.internal.properties.section.NewEntitySection
- public static String _UI_FILEDIALOG_SELECT_DTD;
- public static String _UI_FILEDIALOG_SELECT_DTD_DESC;
-
- // New property tabs
- public static String _UI_LABEL_GENERAL;
- public static String _UI_LABEL_OTHER;
- public static String _UI_LABEL_ATTRIBUTES;
- public static String _UI_LABEL_DOCUMENTATION;
- public static String DTDEditor_0;
- public static String DTDEditor_1;
- public static String DTDEditor_2;
- public static String DTDEditor_3;
- public static String DTDSectionLabelProvider_0;
- public static String DTDSectionLabelProvider_1;
- public static String DTDSectionLabelProvider_10;
- public static String DTDSectionLabelProvider_11;
- public static String DTDSectionLabelProvider_6;
- public static String DTDSectionLabelProvider_7;
- public static String DTDSectionLabelProvider_8;
- public static String DTDSectionLabelProvider_9;
-
- private static ResourceBundle fResourceBundle;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, DTDPropertiesMessages.class);
- }
-
- public static ResourceBundle getResourceBundle() {
- try {
- if (fResourceBundle == null)
- fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
- }
- catch (MissingResourceException x) {
- fResourceBundle = null;
- }
- return fResourceBundle;
- }
-
- private DTDPropertiesMessages() {
- super();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.properties b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.properties
deleted file mode 100644
index dd19ba9c32..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDPropertiesMessages.properties
+++ /dev/null
@@ -1,86 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 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
-###############################################################################
-! Properties file for component: XML tools DTD Editor
-! Packaged for translation in: xml.zip
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.OccurrenceSection.java
-_UI_ONCE = Just once (1)
-_UI_ONE_OR_MORE = One or more (+)
-_UI_OPTIONAL = Optional (?)
-_UI_ZERO_OR_MORE = Zero or more (*)
-_UI_LABEL_OCCURRENCE = Occurrence
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.AttributeDefaultSection.java
-_UI_DEFAULT = Default
-_UI_LABEL_USAGE = Usage
-_UI_LABEL_DEFAULT_VALUE = Default Value
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelGroupSection.java
-_UI_SEQUENCE = Sequence (,)
-_UI_CHOICE = Choice (|)
-_UI_LABEL_MODEL_GROUP = Model Group
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelNameSection.java
-_UI_LABEL_CONTENT_MODEL = Content Model
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.ContentModelTypeSection.java
-_UI_LABEL_CONTENT_TYPE = Content Type
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.NameSection.java
-_UI_LABEL_NAME = Name
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.TypeSection.java
-_UI_LABEL_TYPE = Type
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.EntityTypeSection.java
-_UI_LABEL_ENTITY_TYPE = Entity Type
-_UI_LABEL_EXTERNAL_ENTITY = External
-_UI_LABEL_PARAMETER_ENTITY = Parameter
-_UI_LABEL_GENERAL_ENTITY = General
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.EntityValueSection.java
-_UI_LABEL_ENTITY_VALUE = Entity Value
-_UI_LABEL_PUBLIC_ID = Public ID
-_UI_LABEL_SYSTEM_ID = System ID
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.DTDSectionLabelProvider
-_UI_PROPERTIES_VIEW_TITLE_ELEMENT = element
-_UI_PROPERTIES_VIEW_TITLE_ELEMENT_REF = element reference
-_UI_PROPERTIES_VIEW_TITLE_CHOICE = choice
-_UI_PROPERTIES_VIEW_TITLE_SEQUENCE = sequence
-_UI_PROPERTIES_VIEW_TITLE_ATTRIBUTE = attribute
-_UI_PROPERTIES_VIEW_TITLE_ATTLIST = attribute list
-_UI_PROPERTIES_VIEW_TITLE_COMMENT = comment
-_UI_PROPERTIES_VIEW_TITLE_ENTITY = entity
-_UI_PROPERTIES_VIEW_TITLE_NOTATION = notation
-
-! org.eclipse.wst.dtd.ui.internal.properties.section.NewEntitySection
-_UI_FILEDIALOG_SELECT_DTD = Select DTD file
-_UI_FILEDIALOG_SELECT_DTD_DESC = Select a DTD file from the Workbench projects
-
-! New property tabs
-_UI_LABEL_GENERAL = General
-_UI_LABEL_OTHER = Other
-_UI_LABEL_ATTRIBUTES = Attributes
-_UI_LABEL_DOCUMENTATION = Documentation
-! end
-DTDEditor_0=general
-DTDEditor_1=other
-DTDEditor_2=attributes
-DTDEditor_3=documentation
-DTDSectionLabelProvider_0=choice
-DTDSectionLabelProvider_1=sequence
-DTDSectionLabelProvider_6=element
-DTDSectionLabelProvider_7=attribute
-DTDSectionLabelProvider_8=attribute list
-DTDSectionLabelProvider_9=comment
-DTDSectionLabelProvider_10=entity
-DTDSectionLabelProvider_11=notation
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
deleted file mode 100644
index 10ca85e64c..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/DTDTabbedPropertySheetPage.java
+++ /dev/null
@@ -1,49 +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;
-
-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
deleted file mode 100644
index 26747413e9..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AbstractSection.java
+++ /dev/null
@@ -1,334 +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.action.IStatusLineManager;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.part.EditorActionBarContributor;
-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;
-
-public class AbstractSection implements ISection, IPropertyChangeListener, Listener, SelectionListener {
- private TabbedPropertySheetWidgetFactory factory;
- protected IWorkbenchPart fWorkbenchPart;
- protected ISelection fSelection;
- protected Object fInput;
- protected int rightMarginSpace;
-
- public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
- createControls(parent, tabbedPropertySheetPage.getWidgetFactory());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory aFactory) {
- this.factory = aFactory;
- GC gc = new GC(parent);
- Point extent = gc.textExtent(" ... "); //$NON-NLS-1$
- rightMarginSpace = extent.x;
- gc.dispose();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#setInput(org.eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void setInput(IWorkbenchPart part, ISelection sel) {
- Assert.isTrue(sel instanceof IStructuredSelection, "selection " + sel.getClass() + "is not structured"); //$NON-NLS-1$ //$NON-NLS-2$
- this.fWorkbenchPart = part;
- this.fSelection = sel;
- this.fInput = ((IStructuredSelection) fSelection).getFirstElement();
- /*
- * if (fInput instanceof XSDConcreteComponent) { xsdSchema =
- * ((XSDConcreteComponent)fInput).getSchema(); }
- */
-
- // refresh();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeShown()
- */
- public void aboutToBeShown() {
- refresh();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#aboutToBeHidden()
- */
- public void aboutToBeHidden() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#dispose()
- */
- public void dispose() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#getMinimumHeight()
- */
- public int getMinimumHeight() {
- return SWT.DEFAULT;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#refresh()
- */
- public void refresh() {
- // TODO Auto-generated method stub
- }
-
- public Object getInput() {
- if (fInput instanceof Element) {
- // fInput = xsdSchema.getCorrespondingComponent((Element)fInput);
- }
- return fInput;
- }
-
- /**
- * Get the widget factory.
- *
- * @return the widget factory.
- */
- public TabbedPropertySheetWidgetFactory getWidgetFactory() {
- return factory;
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- refresh();
- }
-
- public void doWidgetDefaultSelected(SelectionEvent e) {
- }
-
- public void doWidgetSelected(SelectionEvent e) {
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- if (isListenerEnabled() && getInput() != null && !isInDoHandle) {
- isInDoHandle = true;
- doWidgetDefaultSelected(e);
- isInDoHandle = false;
- }
-
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- if (isListenerEnabled() && getInput() != null && !isInDoHandle) {
- isInDoHandle = true;
- doWidgetSelected(e);
- isInDoHandle = false;
- }
-
- }
-
- boolean listenerEnabled = true;
-
- /**
- * Get the value of listenerEnabled.
- *
- * @return value of listenerEnabled.
- */
- public boolean isListenerEnabled() {
- return listenerEnabled;
- }
-
- /**
- * Set the value of listenerEnabled.
- *
- * @param v
- * Value to assign to listenerEnabled.
- */
- public void setListenerEnabled(boolean v) {
- this.listenerEnabled = v;
- }
-
- public void handleEvent(Event event) {
- if (isListenerEnabled() && !isInDoHandle) {
- isInDoHandle = true;
- startDelayedEvent(event);
- isInDoHandle = false;
- } // end of if ()
- }
-
- public void doHandleEvent(Event event) {
-
- }
-
- protected DelayedEvent delayedTask;
-
- protected void startDelayedEvent(Event e) {
- if (delayedTask == null || delayedTask.getEvent() == null) {
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500, delayedTask);
- }
- else {
- Event delayedEvent = delayedTask.getEvent();
-
- if (e.widget == delayedEvent.widget && e.type == delayedEvent.type) {
- // same event, just different data, delay new event
- delayedTask.setEvent(null);
- }
- delayedTask = new DelayedEvent();
- delayedTask.setEvent(e);
- Display.getDefault().timerExec(500, delayedTask);
- }
- }
-
- class DelayedEvent implements Runnable {
- protected Event event;
-
- /*
- * @see Runnable#run()
- */
- public void run() {
- if (event != null) {
- isInDoHandle = true;
- doHandleEvent(event);
- isInDoHandle = false;
- event = null;
- }
- }
-
- /**
- * Gets the event.
- *
- * @return Returns a Event
- */
- public Event getEvent() {
- return event;
- }
-
- /**
- * Sets the event.
- *
- * @param event
- * The event to set
- */
- public void setEvent(Event e) {
- this.event = e;
- }
-
- }
-
- boolean isInDoHandle;
-
- /**
- * Get the value of isInDoHandle.
- *
- * @return value of isInDoHandle.
- */
- public boolean isInDoHandle() {
- return isInDoHandle;
- }
-
- static protected IEditorPart getActiveEditor() {
- IWorkbench workbench = DTDUIPlugin.getDefault().getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-
- return editorPart;
- }
-
- static protected IStatusLineManager getStatusLineManager(IEditorPart editorPart) {
- IStatusLineManager result = null;
- try {
- EditorActionBarContributor contributor = (EditorActionBarContributor) editorPart.getEditorSite().getActionBarContributor();
- result = contributor.getActionBars().getStatusLineManager();
- }
- catch (Exception e) {
- }
- return result;
- }
-
- DocumentImpl getDocument(Element element) {
- return (DocumentImpl) element.getOwnerDocument();
- }
-
- public void beginRecording(String description, Element element) {
- DocumentImpl doc = getDocument(element);
- doc.getModel().beginRecording(this, description);
- }
-
- public void endRecording(Element element) {
- DocumentImpl doc = getDocument(element);
-
- doc.getModel().endRecording(this);
- }
-
- protected boolean validateName(String name) {
- return true;
- }
-
- protected boolean validateLanguage(String lang) {
- return true;
- }
-
- protected boolean validatePrefix(String prefix) {
- return true;
- }
-
-} \ 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
deleted file mode 100644
index 224b1856f8..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/AttributeDefaultSection.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-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;
-
-public class AttributeDefaultSection extends AbstractSection {
-
- private final String IMPLIED = Attribute.IMPLIED;
- private final String REQUIRED = Attribute.REQUIRED;
- private final String FIXED = Attribute.FIXED;
-
- private CCombo usageCombo;
- private String[] usageComboValues = {IMPLIED, REQUIRED, FIXED, DTDPropertiesMessages._UI_DEFAULT};
- private Text defaultValueText;
- private CLabel defaultValueLabel;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel usageLabel = getWidgetFactory().createCLabel(composite, DTDPropertiesMessages._UI_LABEL_USAGE);
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = usageLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- usageLabel.setLayoutData(data);
-
- usageCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(usageLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(usageLabel, 0, SWT.CENTER);
- usageCombo.setLayoutData(data);
- usageCombo.addSelectionListener(this);
- usageCombo.setItems(usageComboValues);
-
- // Create label first then attach other control to it
- defaultValueLabel = getWidgetFactory().createCLabel(composite, DTDPropertiesMessages._UI_LABEL_DEFAULT_VALUE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = defaultValueLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(usageLabel, +ITabbedPropertyConstants.VSPACE);
- defaultValueLabel.setLayoutData(data);
-
- defaultValueText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(defaultValueLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(defaultValueLabel, 0, SWT.CENTER);
- defaultValueText.setLayoutData(data);
- defaultValueText.addListener(SWT.Modify, this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- if (input != null) {
- if (input instanceof Attribute) {
- String kind = ((Attribute) input).getDefaultKind();
- if ("".equals(kind)) //$NON-NLS-1$
- usageCombo.setText(DTDPropertiesMessages._UI_DEFAULT);
- else
- usageCombo.setText(kind);
-
- if ("".equals(kind) || FIXED.equals(kind)) { //$NON-NLS-1$
- defaultValueLabel.setVisible(true);
- defaultValueText.setVisible(true);
- defaultValueText.setEnabled(true);
- defaultValueText.setText(((Attribute) input).getDefaultValue());
- }
- else {
- defaultValueText.setText(""); //$NON-NLS-1$
- defaultValueLabel.setVisible(false);
- defaultValueText.setVisible(false);
- defaultValueText.setEnabled(false);
- }
- }
- }
- setListenerEnabled(true);
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == usageCombo) {
- Object input = getInput();
- if (input instanceof Attribute) {
- String usage = usageCombo.getText();
- Attribute attribute = (Attribute) input;
- if (usage.equals(DTDPropertiesMessages._UI_DEFAULT))
- attribute.setDefaultKind(""); //$NON-NLS-1$
- else
- attribute.setDefaultKind(usage);
-
- if (DTDPropertiesMessages._UI_DEFAULT.equals(usage) || FIXED.equals(usage)) {
- defaultValueLabel.setVisible(true);
- defaultValueText.setVisible(true);
- defaultValueText.setEnabled(true);
- }
- else {
- defaultValueLabel.setVisible(false);
- defaultValueText.setVisible(false);
- defaultValueText.setEnabled(false);
- }
- }
- }
- }
-
- public void doHandleEvent(Event event) {
- Object input = getInput();
- if (input instanceof Attribute) {
- if (event.widget == defaultValueText) {
- String newValue = defaultValueText.getText();
- ((Attribute) input).setDefaultValue(newValue, usageCombo.getText().equals(FIXED));
- }
- }
- }
-} \ 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
deleted file mode 100644
index 1c9f2dff2a..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/CommentSection.java
+++ /dev/null
@@ -1,76 +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.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Comment;
-
-public class CommentSection extends AbstractSection {
- private Text commentText;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
-
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
- commentText = getWidgetFactory().createText(composite, "", SWT.MULTI | SWT.NONE); //$NON-NLS-1$
- commentText.addListener(SWT.Modify, CommentSection.this);
-
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(0, 0);
- data.bottom = new FormAttachment(100, 0);
- commentText.setLayoutData(data);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- commentText.setEnabled(true);
- Object input = getInput();
- commentText.setText(""); //$NON-NLS-1$
- if (input != null) {
- if (input instanceof Comment)
- commentText.setText(((Comment) input).getText());
- }
- setListenerEnabled(true);
- }
-
-
- public void doHandleEvent(Event event) {
- Object input = getInput();
- if (input != null) {
- String newValue = commentText.getText();
- if (newValue.length() > 0 && input instanceof Comment) {
- Comment comment = (Comment) input;
- comment.setText(newValue);
- }
- }
-
- }
-
- public boolean shouldUseExtraSpace() {
- return true;
- }
-}
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
deleted file mode 100644
index 575185a093..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelGroupSection.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-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;
-
-public class ContentModelGroupSection extends AbstractSection {
- private final String SEQUENCE = DTDPropertiesMessages._UI_SEQUENCE;
- private final String CHOICE = DTDPropertiesMessages._UI_CHOICE;
- private final String MODEL_GROUP = DTDPropertiesMessages._UI_LABEL_MODEL_GROUP;
-
- private CCombo modelGroupCombo;
- private String[] modelGroupComboValues = {SEQUENCE, CHOICE};
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(composite, MODEL_GROUP);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- cLabel.setLayoutData(data);
-
- modelGroupCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- modelGroupCombo.setLayoutData(data);
- modelGroupCombo.addSelectionListener(this);
- modelGroupCombo.setItems(modelGroupComboValues);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- if (input != null) {
- if (input instanceof CMGroupNode) {
- CMGroupNode node = (CMGroupNode) input;
- char modelType = node.getConnector();
- if (CMGroupNode.CHOICE == modelType)
- modelGroupCombo.setText(CHOICE);
- else if (CMGroupNode.SEQUENCE == modelType)
- modelGroupCombo.setText(SEQUENCE);
- }
- }
- setListenerEnabled(true);
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == modelGroupCombo) {
- Object input = getInput();
- if (input instanceof CMGroupNode) {
- CMGroupNode node = (CMGroupNode) input;
- if (CHOICE.equals(modelGroupCombo.getText()))
- node.setConnector(CMGroupNode.CHOICE);
- else if (SEQUENCE.equals(modelGroupCombo.getText()))
- node.setConnector(CMGroupNode.SEQUENCE);
- }
- }
- }
-}
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
deleted file mode 100644
index 7150bff71c..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameFilter.java
+++ /dev/null
@@ -1,21 +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.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
deleted file mode 100644
index dfb1ecf3ef..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelNameSection.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-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;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class ContentModelNameSection extends AbstractSection {
- private final String CONTENT_MODEL = DTDPropertiesMessages._UI_LABEL_CONTENT_MODEL;
-
- private CCombo typeCombo;
- private String[] typeComboValues = {CMNode.PCDATA};
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(composite, CONTENT_MODEL);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- cLabel.setLayoutData(data);
-
- typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT | SWT.READ_ONLY);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.setItems(typeComboValues);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- Object input = getInput();
-
- if (input != null) {
- if (input instanceof CMBasicNode) {
- typeCombo.removeAll();
- typeCombo.add(CMNode.PCDATA);
- // NodeList list =
- // ((CMBasicNode)fInput).getDTDFile().getElementsAndParameterEntityReferences();
- Iterator iterator = ((CMBasicNode) input).getDTDFile().getNodes().iterator();
- boolean isForRootContent = ((CMBasicNode) input).isRootElementContent();
- while (iterator.hasNext()) {
- DTDNode node = (DTDNode) iterator.next();
- if (!isForRootContent && node instanceof Element)
- typeCombo.add(node.getName());
- if (node instanceof Entity && ((Entity) node).isParameterEntity())
- typeCombo.add("%" + node.getName() + ";"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- typeCombo.setText(((CMBasicNode) input).getName());
- }
- }
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == typeCombo) {
- Object input = getInput();
- if (input instanceof CMBasicNode) {
- CMBasicNode node = (CMBasicNode) input;
- String selected = typeCombo.getText();
- // if (CMNode.PCDATA.equals(selected))
- node.setName(selected);
- }
- }
- }
-
- public boolean shouldUseExtraSpace() {
- 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
deleted file mode 100644
index 3fdac83095..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeFilter.java
+++ /dev/null
@@ -1,26 +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.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
deleted file mode 100644
index e64a895e02..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/ContentModelTypeSection.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-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;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class ContentModelTypeSection extends AbstractSection {
- private final String CONTENT_TYPE = DTDPropertiesMessages._UI_LABEL_CONTENT_TYPE;
-
- private CCombo typeCombo;
- private String[] typeComboValues = {CMNode.ANY, CMNode.EMPTY, CMNode.PCDATA, CMNode.CHILDREN, CMNode.MIXED};
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(composite, CONTENT_TYPE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- cLabel.setLayoutData(data);
-
- typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.setItems(typeComboValues);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- Object input = getInput();
-
- if (input != null) {
- if (input instanceof CMNode) {
- typeCombo.removeAll();
- typeCombo.add(CMNode.ANY);
- typeCombo.add(CMNode.EMPTY);
- typeCombo.add(CMNode.PCDATA);
- typeCombo.add(CMNode.CHILDREN);
- typeCombo.add(CMNode.MIXED);
-
- Iterator iterator = ((CMNode) input).getDTDFile().getNodes().iterator();
- String nodeName = null;
- while (iterator.hasNext()) {
- DTDNode node = (DTDNode) iterator.next();
- nodeName = node.getName();
- if (node instanceof Element && typeCombo.indexOf(nodeName) == -1)
- typeCombo.add(nodeName);
- else if (node instanceof Entity && ((Entity) node).isParameterEntity() && typeCombo.indexOf(nodeName) == -1)
- typeCombo.add("%" + nodeName + ";"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (input instanceof CMGroupNode)
- typeCombo.setText(((CMGroupNode) input).getType());
- else if (input instanceof CMBasicNode)
- typeCombo.setText(((CMBasicNode) input).getType());
- }
- } // end if (fInput != null)
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == typeCombo) {
- Object input = getInput();
- if (input instanceof CMGroupNode || input instanceof CMBasicNode) {
- CMNode node = (CMNode) input;
- String selected = typeCombo.getText();
- if (CMNode.MIXED.equals(selected))
- node.setMixedContent();
- else if (CMNode.CHILDREN.equals(selected))
- node.setChildrenContent(""); //$NON-NLS-1$
- else if (CMNode.EMPTY.equals(selected) || CMNode.ANY.equals(selected) || CMNode.PCDATA.equals(selected))
- node.setContent(selected);
- else
- node.setChildrenContent(selected);
- }
- }
- }
-
- public boolean shouldUseExtraSpace() {
- 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/DTDSectionLabelProvider.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java
deleted file mode 100644
index 4bd37ac145..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSectionLabelProvider.java
+++ /dev/null
@@ -1,139 +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.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;
-import org.eclipse.wst.dtd.core.internal.Attribute;
-import org.eclipse.wst.dtd.core.internal.AttributeList;
-import org.eclipse.wst.dtd.core.internal.CMBasicNode;
-import org.eclipse.wst.dtd.core.internal.CMGroupNode;
-import org.eclipse.wst.dtd.core.internal.CMRepeatableNode;
-import org.eclipse.wst.dtd.core.internal.Comment;
-import org.eclipse.wst.dtd.core.internal.DTDFile;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-import org.eclipse.wst.dtd.core.internal.Element;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.core.internal.Notation;
-import org.eclipse.wst.dtd.core.internal.ParameterEntityReference;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-
-public class DTDSectionLabelProvider extends LabelProvider {
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object object) {
- if (object == null || object.equals(StructuredSelection.EMPTY)) {
- return null;
- }
-
- Image result = null;
-
- 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;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object object) {
- if (object == null || object.equals(StructuredSelection.EMPTY)) {
- return null;
- }
-
- Object selected = object;
- if (object instanceof IStructuredSelection) {
- selected = ((IStructuredSelection) object).getFirstElement();
- }
-
- 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
- return object.toString();
- }
-} \ 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/DTDSelectIncludeFileWizard.java b/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSelectIncludeFileWizard.java
deleted file mode 100644
index f315313be4..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDSelectIncludeFileWizard.java
+++ /dev/null
@@ -1,79 +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.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.common.ui.internal.viewers.SelectSingleFilePage;
-import org.eclipse.wst.dtd.core.internal.emf.DTDResource;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-/**
- * Extend the base wizard to select a file from the project or outside the
- * workbench and add error handling
- */
-class DTDSelectIncludeFileWizard extends Wizard implements INewWizard {
- DTDSelectSingleFilePage filePage;
-
- IFile resultFile;
-
- public DTDSelectIncludeFileWizard(String title, String desc, ViewerFilter filter, IStructuredSelection selection) {
- super();
- setWindowTitle(title);
- setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(DTDUIPlugin.getDefault().getBundle().getSymbolicName(), DTDResource.NEWDTD));
-
- // Select File Page
- filePage = new DTDSelectSingleFilePage(PlatformUI.getWorkbench(), selection, true);
- filePage.setTitle(title);
- filePage.setDescription(desc);
- filePage.addFilter(filter);
- }
-
- public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
- }
-
- public void addPages() {
- addPage(filePage);
- }
-
- public boolean canFinish() {
- return filePage.isPageComplete();
- }
-
- public boolean performFinish() {
- resultFile = filePage.getFile();
- return true;
- }
-
- public IFile getResultFile() {
- return resultFile;
- }
-
- /**
- * Select DTD File
- */
- class DTDSelectSingleFilePage extends SelectSingleFilePage {
- public DTDSelectSingleFilePage(IWorkbench w, IStructuredSelection selection, boolean isFileMandatory) {
- super(w, selection, isFileMandatory);
- }
-
- public boolean isPageComplete() {
- return super.isPageComplete();
- }
- }
-}
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
deleted file mode 100644
index 04e35d8500..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DTDTypeMapper.java
+++ /dev/null
@@ -1,24 +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.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
deleted file mode 100644
index 4f720eb49e..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/DocumentSection.java
+++ /dev/null
@@ -1,101 +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.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.dtd.core.internal.Comment;
-import org.eclipse.wst.dtd.core.internal.DTDNode;
-
-public class DocumentSection extends AbstractSection {
- private Text commentText;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
-
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
- commentText = getWidgetFactory().createText(composite, "", SWT.MULTI | SWT.NONE); //$NON-NLS-1$
- commentText.addListener(SWT.Modify, this);
-
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(0, 0);
- data.bottom = new FormAttachment(100, 0);
- commentText.setLayoutData(data);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- commentText.setEnabled(true);
- Object input = getInput();
- commentText.setText(""); //$NON-NLS-1$
- if (input != null) {
- if (input instanceof DTDNode) {
- Comment comment = getCommentNode((DTDNode) input);
- if (comment != null)
- commentText.setText(comment.getText());
- }
- }
- setListenerEnabled(true);
- }
-
- public void doHandleEvent(Event event) {
- Object input = getInput();
- if (input != null) {
- String newValue = commentText.getText();
- if (input instanceof DTDNode) {
- Comment comment = getCommentNode((DTDNode) input);
- if (comment != null)
- comment.setText(newValue);
- else {
- // Create a new comment node.
- ((DTDNode) input).getDTDFile().createComment((DTDNode) input, newValue, false);
- }
- }
- }
-
- }
-
- private Comment getCommentNode(DTDNode node) {
- 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 (Comment) prevNode;
- else
- prevNode = currentNode;
- }
- return null;
- }
-
- public boolean shouldUseExtraSpace() {
- return true;
- }
-
-}
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
deleted file mode 100644
index 78f42939ca..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EmptySection.java
+++ /dev/null
@@ -1,50 +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.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmptySection extends AbstractSection {
- public void doHandleEvent(Event event) {
- super.doHandleEvent(event);
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- super.refresh();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- return false;
- }
-
- public int getMinimumHeight() {
- return 0;
- }
-} \ 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
deleted file mode 100644
index 3f634baf4a..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityTypeSection.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-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;
-
-public class EntityTypeSection extends AbstractSection {
- private final String ENTITY_TYPE = DTDPropertiesMessages._UI_LABEL_ENTITY_TYPE;
- private final String EXTERNAL_ENTITY = DTDPropertiesMessages._UI_LABEL_EXTERNAL_ENTITY;
- private final String PARAMETER = DTDPropertiesMessages._UI_LABEL_PARAMETER_ENTITY;
- private final String GENERAL = DTDPropertiesMessages._UI_LABEL_GENERAL_ENTITY;
-
- private CCombo typeCombo;
- private String[] typeComboValues = {PARAMETER, GENERAL};
- private Button checkBox;
-
- public static boolean isExternalEntity = false;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(composite, ENTITY_TYPE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- cLabel.setLayoutData(data);
-
- typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.setItems(typeComboValues);
-
- checkBox = getWidgetFactory().createButton(composite, EXTERNAL_ENTITY, SWT.CHECK);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = checkBox.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(95, 0);
- data.top = new FormAttachment(cLabel, +ITabbedPropertyConstants.VSPACE);
- checkBox.setLayoutData(data);
- checkBox.addSelectionListener(this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
-
- if (input != null) {
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- if (entity.isParameterEntity())
- typeCombo.setText(PARAMETER);
- else
- typeCombo.setText(GENERAL);
-
- if (entity.isExternalEntity()) {
- checkBox.setSelection(true);
- isExternalEntity = true;
- }
- else {
- checkBox.setSelection(false);
- isExternalEntity = false;
- }
- }
- }
- setListenerEnabled(true);
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == typeCombo) {
- Object input = getInput();
- if (input instanceof Entity) {
- Entity node = (Entity) input;
- String selected = typeCombo.getText();
- if (PARAMETER.equals(selected))
- node.setParameterEntity(true);
- else
- node.setParameterEntity(false);
- }
- }
- else if (e.widget == checkBox) {
- Object input = getInput();
- if (input instanceof Entity) {
- Entity node = (Entity) input;
- boolean selected = checkBox.getSelection();
- if (selected) {
- node.setExternalEntity(true);
- isExternalEntity = true;
- }
- else {
- node.setExternalEntity(false);
- isExternalEntity = false;
- }
- }
- }
- }
-
- public boolean shouldUseExtraSpace() {
- 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
deleted file mode 100644
index abf35698d1..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/EntityValueSection.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-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;
-
-public class EntityValueSection extends AbstractSection {
- private final String VALUE = DTDPropertiesMessages._UI_LABEL_ENTITY_VALUE;
- private final String PUBLIC_ID = DTDPropertiesMessages._UI_LABEL_PUBLIC_ID;
- private final String SYSTEM_ID = DTDPropertiesMessages._UI_LABEL_SYSTEM_ID;
-
- private Text valueText;
- private Text publicIdText;
- private Text systemIdText;
-
- private CLabel valueLabel;
- private CLabel publicIdLabel;
- private CLabel systemIdLabel;
-
- public void doHandleEvent(Event event) {
- if (event.widget == valueText) {
- Object input = getInput();
- String newValue = valueText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setValue(newValue);
- }
- }
- else if (event.widget == publicIdText) {
- Object input = getInput();
- String newValue = publicIdText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setPublicID(newValue);
- }
- }
- else if (event.widget == systemIdText) {
- Object input = getInput();
- String newValue = systemIdText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setSystemID(newValue);
- }
- }
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- valueLabel = getWidgetFactory().createCLabel(composite, VALUE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = valueLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- valueLabel.setLayoutData(data);
-
- // Entity Value
- valueText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(valueLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(valueLabel, 0, SWT.CENTER);
- valueText.setLayoutData(data);
- valueText.addListener(SWT.Modify, this);
-
- // Create label first then attach other control to it
- publicIdLabel = getWidgetFactory().createCLabel(composite, PUBLIC_ID);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = publicIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(valueLabel, +ITabbedPropertyConstants.VSPACE);
- publicIdLabel.setLayoutData(data);
-
- // Public ID
- publicIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(publicIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(publicIdLabel, 0, SWT.CENTER);
- publicIdText.setLayoutData(data);
- publicIdText.addListener(SWT.Modify, this);
-
- // Create label first then attach other control to it
- systemIdLabel = getWidgetFactory().createCLabel(composite, SYSTEM_ID);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = systemIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(publicIdLabel, +ITabbedPropertyConstants.VSPACE);
- systemIdLabel.setLayoutData(data);
-
- // System ID
- systemIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(systemIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(systemIdLabel, 0, SWT.CENTER);
- systemIdText.setLayoutData(data);
- systemIdText.addListener(SWT.Modify, this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- if (isExternalEntity()) {
- valueLabel.setVisible(false);
- valueText.setVisible(false);
- publicIdLabel.setVisible(true);
- publicIdText.setVisible(true);
- systemIdLabel.setVisible(true);
- systemIdText.setVisible(true);
-
- publicIdText.setText(""); //$NON-NLS-1$
- systemIdText.setText(""); //$NON-NLS-1$
- if (input != null && input instanceof Entity) {
- Entity entity = (Entity) input;
- publicIdText.setText((entity).getPublicID());
- systemIdText.setText((entity).getSystemID());
- }
- }
- else {
- valueLabel.setVisible(true);
- valueText.setVisible(true);
- publicIdLabel.setVisible(false);
- publicIdText.setVisible(false);
- systemIdLabel.setVisible(false);
- systemIdText.setVisible(false);
-
- valueText.setText(""); //$NON-NLS-1$
- if (input != null && input instanceof Entity)
- valueText.setText(((Entity) input).getValue());
- }
- setListenerEnabled(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- return false;
- }
-
- private boolean isExternalEntity() {
- return EntityTypeSection.isExternalEntity;
- }
-} \ 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
deleted file mode 100644
index 0014c6779f..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NameSection.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-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;
-
-public class NameSection extends AbstractSection {
- private final String NAME = DTDPropertiesMessages._UI_LABEL_NAME;
- private Text nameText;
-
- public void doHandleEvent(Event event) {
- if (event.widget == nameText) {
- Object input = getInput();
- String newValue = nameText.getText();
- if (newValue.length() > 0 && input instanceof DTDNode) {
- DTDNode dtdNode = (DTDNode) input;
- dtdNode.setName(newValue);
- }
- }
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel nameLabel = getWidgetFactory().createCLabel(composite, NAME);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = nameLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- nameLabel.setLayoutData(data);
-
- nameText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(nameLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100);
- data.top = new FormAttachment(nameLabel, 0, SWT.CENTER);
- nameText.setLayoutData(data);
- nameText.addListener(SWT.Modify, this);
-
- // listener.startListeningForEnter(nameText);
- // listener.startListeningTo(nameText);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- nameText.setEnabled(true);
- Object input = getInput();
- nameText.setText(""); //$NON-NLS-1$
- if (input != null) {
- if (input instanceof DTDNode)
- nameText.setText(((DTDNode) input).getName());
- }
- setListenerEnabled(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- 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
deleted file mode 100644
index 64492227e7..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NewEntitySection.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-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.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.dtd.core.internal.Entity;
-import org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages;
-import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
-
-public class NewEntitySection extends AbstractSection {
- private final String NAME = DTDPropertiesMessages._UI_LABEL_NAME;
- private final String ENTITY_TYPE = DTDPropertiesMessages._UI_LABEL_ENTITY_TYPE;
- private final String EXTERNAL_ENTITY = DTDPropertiesMessages._UI_LABEL_EXTERNAL_ENTITY;
- private final String PARAMETER = DTDPropertiesMessages._UI_LABEL_PARAMETER_ENTITY;
- private final String GENERAL = DTDPropertiesMessages._UI_LABEL_GENERAL_ENTITY;
- private final String VALUE = DTDPropertiesMessages._UI_LABEL_ENTITY_VALUE;
- private final String PUBLIC_ID = DTDPropertiesMessages._UI_LABEL_PUBLIC_ID;
- private final String SYSTEM_ID = DTDPropertiesMessages._UI_LABEL_SYSTEM_ID;
-
- private Text systemIdText;
- private Text publicIdText;
- private Text nameText;
- private Button wizardButton;
-
- private Text entityValueText;
- private Button checkBox;
-
- private CCombo typeCombo;
- private String[] typeComboValues = {PARAMETER, GENERAL};
- private PageBook pageBook;
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- createEntityCommonComposite(composite);
-
- pageBook = new PageBook(composite, SWT.FLAT);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(entityCommonComposite, 0);
- data.bottom = new FormAttachment(100, 0);
- pageBook.setLayoutData(data);
-
- createExternalEntityComposite(pageBook);
- createInternalEntityComposite(pageBook);
-
- pageBook.showPage(externalEntityComposite);
- }
-
- private Composite entityCommonComposite;
-
- private Composite createEntityCommonComposite(Composite parent) {
- entityCommonComposite = getWidgetFactory().createFlatFormComposite(parent);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(0, 0);
- entityCommonComposite.setLayoutData(data);
-
- // Create label first then attach other control to it
- CLabel nameLabel = getWidgetFactory().createCLabel(entityCommonComposite, NAME); //$NON-NLS-1$
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = nameLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- nameLabel.setLayoutData(data);
-
- nameText = getWidgetFactory().createText(entityCommonComposite, "", SWT.NONE); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(nameLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(nameLabel, 0, SWT.CENTER);
- nameText.setLayoutData(data);
- nameText.addListener(SWT.Modify, this);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(entityCommonComposite, ENTITY_TYPE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(nameLabel, +ITabbedPropertyConstants.VSPACE);
- cLabel.setLayoutData(data);
-
- // Create Checkbox
- checkBox = getWidgetFactory().createButton(entityCommonComposite, EXTERNAL_ENTITY, SWT.CHECK); //$NON-NLS-1$
- data = new FormData();
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- checkBox.setLayoutData(data);
- checkBox.addSelectionListener(this);
-
- // Create CCombo
- typeCombo = getWidgetFactory().createCCombo(entityCommonComposite, SWT.FLAT | SWT.READ_ONLY);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE - 2);
- data.right = new FormAttachment(checkBox, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.setItems(typeComboValues);
- typeCombo.setText(PARAMETER);
-
- return entityCommonComposite;
- }
-
- private Composite internalEntityComposite;
-
- private Composite createInternalEntityComposite(Composite parent) {
- internalEntityComposite = getWidgetFactory().createFlatFormComposite(parent);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(entityCommonComposite, -ITabbedPropertyConstants.VSPACE);
- internalEntityComposite.setLayoutData(data);
-
- // Create label first then attach other control to it
- CLabel entityValueLabel = getWidgetFactory().createCLabel(internalEntityComposite, VALUE); //$NON-NLS-1$
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = entityValueLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- entityValueLabel.setLayoutData(data);
-
- entityValueText = getWidgetFactory().createText(internalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(entityValueLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(entityValueLabel, 0, SWT.CENTER);
- entityValueText.setLayoutData(data);
- entityValueText.setEditable(true);
- entityValueText.addListener(SWT.Modify, this);
-
- return internalEntityComposite;
- }
-
- private Composite externalEntityComposite;
-
- private Composite createExternalEntityComposite(Composite parent) {
- externalEntityComposite = getWidgetFactory().createFlatFormComposite(parent);
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(entityCommonComposite, -ITabbedPropertyConstants.VSPACE);
- externalEntityComposite.setLayoutData(data);
-
- // Create label first then attach other control to it
- CLabel publicIdLabel = getWidgetFactory().createCLabel(externalEntityComposite, PUBLIC_ID); //$NON-NLS-1$
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = publicIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- publicIdLabel.setLayoutData(data);
-
- publicIdText = getWidgetFactory().createText(externalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
- publicIdText.setEditable(true);
- data = new FormData();
- data.left = new FormAttachment(publicIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(publicIdLabel, 0, SWT.CENTER);
- publicIdText.setLayoutData(data);
- publicIdText.addListener(SWT.Modify, this);
-
- // Create label first then attach other control to it
- // Create System ID Label
- CLabel systemIdLabel = getWidgetFactory().createCLabel(externalEntityComposite, SYSTEM_ID); //$NON-NLS-1$
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = systemIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(publicIdLabel, +ITabbedPropertyConstants.VSPACE);
- systemIdLabel.setLayoutData(data);
-
- // Create Wizard Button
- wizardButton = getWidgetFactory().createButton(externalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
- wizardButton.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(DTDUIPlugin.getDefault().getBundle().getSymbolicName(), "icons/browsebutton.gif").createImage()); //$NON-NLS-1$
- data = new FormData();
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(systemIdLabel, 0, SWT.CENTER);
- wizardButton.setLayoutData(data);
- wizardButton.addSelectionListener(this);
-
- // Create System ID Text
- systemIdText = getWidgetFactory().createText(externalEntityComposite, "", SWT.NONE); //$NON-NLS-1$
- // systemIdText.setEditable(false);
- data = new FormData();
- data.left = new FormAttachment(systemIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(wizardButton, -ITabbedPropertyConstants.HSPACE);
- data.top = new FormAttachment(systemIdLabel, 0, SWT.CENTER);
- systemIdText.setLayoutData(data);
- systemIdText.addListener(SWT.Modify, this);
-
- return externalEntityComposite;
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == typeCombo) {
- Object input = getInput();
- if (input instanceof Entity) {
- Entity node = (Entity) input;
- String selected = typeCombo.getText();
- if (PARAMETER.equals(selected))
- node.setParameterEntity(true);
- else
- node.setParameterEntity(false);
- }
- }
- else if (e.widget == checkBox) {
- Object input = getInput();
- if (input instanceof Entity) {
- Entity node = (Entity) input;
- boolean selected = checkBox.getSelection();
- if (selected) {
- node.setExternalEntity(true);
- pageBook.showPage(externalEntityComposite);
- }
- else {
- node.setExternalEntity(false);
- pageBook.showPage(internalEntityComposite);
- }
- }
- }
- else if (e.widget == wizardButton) {
- Shell shell = Display.getCurrent().getActiveShell();
- IFile currentIFile = ((IFileEditorInput) getActiveEditor().getEditorInput()).getFile();
- ViewerFilter filter = new ResourceFilter(new String[]{".dtd"}, new IFile[]{currentIFile}, null); //$NON-NLS-1$
-
- DTDSelectIncludeFileWizard fileSelectWizard = new DTDSelectIncludeFileWizard(DTDPropertiesMessages._UI_FILEDIALOG_SELECT_DTD, DTDPropertiesMessages._UI_FILEDIALOG_SELECT_DTD_DESC, filter, (IStructuredSelection) fSelection);
-
- WizardDialog wizardDialog = new WizardDialog(shell, fileSelectWizard);
- wizardDialog.create();
- wizardDialog.setBlockOnOpen(true);
- int result = wizardDialog.open();
- if (result == Window.OK) {
- String value = systemIdText.getText();
- IFile selectedIFile = fileSelectWizard.getResultFile();
- String dtdFileString = value;
- if (selectedIFile != null) {
- dtdFileString = URIHelper.getRelativeURI(selectedIFile.getFullPath(), currentIFile.getFullPath());
- }
- systemIdText.setText(dtdFileString);
- }
- }
-
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- nameText.setText(""); //$NON-NLS-1$
- if (input != null) {
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- nameText.setText(entity.getName());
-
- if (entity.isParameterEntity())
- typeCombo.setText(PARAMETER);
- else
- typeCombo.setText(GENERAL);
-
- if (entity.isExternalEntity()) {
- checkBox.setSelection(true);
- pageBook.showPage(externalEntityComposite);
- publicIdText.setText(entity.getPublicID());
- systemIdText.setText(entity.getSystemID());
- }
- else {
- checkBox.setSelection(false);
- pageBook.showPage(internalEntityComposite);
- entityValueText.setText(entity.getValue());
- }
- }
- }
- setListenerEnabled(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- return true;
- }
-
- public void doHandleEvent(Event event) {
- if (event.widget == nameText) {
- Object input = getInput();
- String newValue = nameText.getText();
- if (newValue.length() > 0 && input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setName(newValue);
- }
- }
- else if (event.widget == entityValueText) {
- Object input = getInput();
- String newValue = entityValueText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setValue(newValue);
- }
- }
- else if (event.widget == publicIdText) {
- Object input = getInput();
- String newValue = publicIdText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setPublicID(newValue);
- }
- }
- else if (event.widget == systemIdText) {
- Object input = getInput();
- String newValue = systemIdText.getText();
- if (input instanceof Entity) {
- Entity entity = (Entity) input;
- entity.setSystemID(newValue);
- }
- }
-
- }
-}
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
deleted file mode 100644
index 2e960e77fc..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/NotationSection.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-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;
-
-public class NotationSection extends AbstractSection {
- private final String PUBLIC_ID = DTDPropertiesMessages._UI_LABEL_PUBLIC_ID;
- private final String SYSTEM_ID = DTDPropertiesMessages._UI_LABEL_SYSTEM_ID;
-
- private Text publicIdText;
- private Text systemIdText;
-
- private CLabel publicIdLabel;
- private CLabel systemIdLabel;
-
- public void doHandleEvent(Event event) {
- if (event.widget == publicIdText) {
- Object input = getInput();
- String newValue = publicIdText.getText();
- if (input instanceof Notation) {
- Notation notation = (Notation) input;
- notation.setPublicID(newValue);
- }
- }
- else if (event.widget == systemIdText) {
- Object input = getInput();
- String newValue = systemIdText.getText();
- if (input instanceof Notation) {
- Notation notation = (Notation) input;
- notation.setSystemID(newValue);
- }
- }
- }
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- publicIdLabel = getWidgetFactory().createCLabel(composite, PUBLIC_ID);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = publicIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- publicIdLabel.setLayoutData(data);
-
- // Public ID
- publicIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(publicIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(publicIdLabel, 0, SWT.CENTER);
- publicIdText.setLayoutData(data);
- publicIdText.addListener(SWT.Modify, this);
-
- // Create label first then attach other control to it
- systemIdLabel = getWidgetFactory().createCLabel(composite, SYSTEM_ID);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- p = systemIdLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- labelWidth = Math.max(p.x, 98);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(publicIdLabel, +ITabbedPropertyConstants.VSPACE);
- systemIdLabel.setLayoutData(data);
-
- // System ID
- systemIdText = getWidgetFactory().createText(composite, ""); //$NON-NLS-1$
- data = new FormData();
- data.left = new FormAttachment(systemIdLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(systemIdLabel, 0, SWT.CENTER);
- systemIdText.setLayoutData(data);
- systemIdText.addListener(SWT.Modify, this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- publicIdText.setText(""); //$NON-NLS-1$
- systemIdText.setText(""); //$NON-NLS-1$
-
- if (input != null && input instanceof Notation) {
- Notation notation = (Notation) input;
- publicIdText.setText((notation).getPublicID());
- systemIdText.setText((notation).getSystemID());
- }
-
- setListenerEnabled(true);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISection#shouldUseExtraSpace()
- */
- public boolean shouldUseExtraSpace() {
- 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
deleted file mode 100644
index eb57e01655..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceFilter.java
+++ /dev/null
@@ -1,26 +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.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
deleted file mode 100644
index 90f5ffa5a5..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/OccurrenceSection.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-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;
-
-public class OccurrenceSection extends AbstractSection {
- private final String ONCE = DTDPropertiesMessages._UI_ONCE;
- private final String ONE_OR_MORE = DTDPropertiesMessages._UI_ONE_OR_MORE;
- private final String OPTIONAL = DTDPropertiesMessages._UI_OPTIONAL;
- private final String ZERO_OR_MORE = DTDPropertiesMessages._UI_ZERO_OR_MORE;
- private final String OCCURENCE = DTDPropertiesMessages._UI_LABEL_OCCURRENCE;
-
- private CCombo occurrenceCombo;
- private String[] occurrenceComboValues = {ONCE, ONE_OR_MORE, OPTIONAL, ZERO_OR_MORE};
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel usageLabel = getWidgetFactory().createCLabel(composite, OCCURENCE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = usageLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- usageLabel.setLayoutData(data);
-
- occurrenceCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(usageLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(usageLabel, 0, SWT.CENTER);
- occurrenceCombo.setLayoutData(data);
- occurrenceCombo.addSelectionListener(this);
- occurrenceCombo.setItems(occurrenceComboValues);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- setListenerEnabled(false);
- Object input = getInput();
- if (input instanceof CMRepeatableNode) {
- char occurence = ((CMRepeatableNode) input).getOccurrence();
- if (CMRepeatableNode.ONCE == occurence)
- occurrenceCombo.setText(ONCE);
- else if (CMRepeatableNode.ONE_OR_MORE == occurence)
- occurrenceCombo.setText(ONE_OR_MORE);
- else if (CMRepeatableNode.OPTIONAL == occurence)
- occurrenceCombo.setText(OPTIONAL);
- else if (CMRepeatableNode.ZERO_OR_MORE == occurence)
- occurrenceCombo.setText(ZERO_OR_MORE);
- else
- occurrenceCombo.setText(ONCE);
- }
- setListenerEnabled(true);
- }
-
- public void widgetSelected(SelectionEvent e) {
- Object input = getInput();
- if (input instanceof CMRepeatableNode) {
- setListenerEnabled(false);
- CMRepeatableNode node = (CMRepeatableNode) input;
- String occurrence = occurrenceCombo.getText();
- if (ONCE.equals(occurrence))
- node.setOccurrence(CMRepeatableNode.ONCE);
- else if (ONE_OR_MORE.equals(occurrence))
- node.setOccurrence(CMRepeatableNode.ONE_OR_MORE);
- else if (OPTIONAL.equals(occurrence))
- node.setOccurrence(CMRepeatableNode.OPTIONAL);
- else if (ZERO_OR_MORE.equals(occurrence))
- node.setOccurrence(CMRepeatableNode.ZERO_OR_MORE);
- setListenerEnabled(true);
- }
- }
-} \ 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
deleted file mode 100644
index d18795c46a..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src-properties/org/eclipse/wst/dtd/ui/internal/properties/section/TypeSection.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.widgets.Composite;
-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;
-
-public class TypeSection extends AbstractSection {
- private final String TYPE = DTDPropertiesMessages._UI_LABEL_TYPE;
-
- private CCombo typeCombo;
- private String[] typeComboValues = {Attribute.CDATA, Attribute.ID, Attribute.IDREF, Attribute.IDREFS, Attribute.ENTITY, Attribute.ENTITIES, Attribute.NMTOKEN, Attribute.NMTOKENS, Attribute.ENUMERATED_NAME, Attribute.ENUMERATED_NOTATION};
-
- /**
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
- * org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetWidgetFactory)
- */
- public void createControls(Composite parent, TabbedPropertySheetWidgetFactory factory) {
- super.createControls(parent, factory);
- Composite composite = getWidgetFactory().createFlatFormComposite(parent);
-
- // Create label first then attach other control to it
- CLabel cLabel = getWidgetFactory().createCLabel(composite, TYPE);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=141106
- Point p = cLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int labelWidth = Math.max(p.x, 98);
- FormData data = new FormData(labelWidth, SWT.DEFAULT);
- data = new FormData(labelWidth, SWT.DEFAULT);
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- cLabel.setLayoutData(data);
-
- typeCombo = getWidgetFactory().createCCombo(composite, SWT.FLAT);
- data = new FormData();
- data.left = new FormAttachment(cLabel, -ITabbedPropertyConstants.HSPACE);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(cLabel, 0, SWT.CENTER);
- typeCombo.setLayoutData(data);
- typeCombo.addSelectionListener(this);
- typeCombo.setItems(typeComboValues);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh() {
- Object input = getInput();
-
- if (input != null) {
- if (input instanceof Attribute)
- typeCombo.setText(((Attribute) input).getType());
- }
-
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == typeCombo) {
- Object input = getInput();
- if (input instanceof Attribute) {
- Attribute attribute = (Attribute) input;
- attribute.setType(typeCombo.getText());
- }
- }
- }
-
- public boolean shouldUseExtraSpace() {
- return false;
- }
-} \ No newline at end of file

Back to the top