Skip to main content
summaryrefslogtreecommitdiffstats
blob: c66cc607c5126ef73528a170fd1d11393c5c293e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
/*******************************************************************************
 * Copyright (c) 2006, 2008 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
 * yyyymmdd bug      Email and other contact information
 * -------- -------- -----------------------------------------------------------
 * yyyymmdd   bug     Email and other contact information
 * 20060329   127016 andyzhai@ca.ibm.com - Andy Zhai    
 * 20080428   224726 pmoogk@ca.ibm.com - Peter Moogk
 *******************************************************************************/
package org.eclipse.jst.ws.internal.axis.consumption.ui.preferences;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterContext;
import org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterDefaults;
import org.eclipse.jst.ws.internal.axis.consumption.core.plugin.WebServiceAxisConsumptionCorePlugin;
import org.eclipse.jst.ws.internal.axis.consumption.ui.AxisConsumptionUIMessages;
import org.eclipse.jst.ws.internal.axis.consumption.ui.plugin.WebServiceAxisConsumptionUIPlugin;
import org.eclipse.jst.ws.internal.ui.common.UIUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.help.IWorkbenchHelpSystem;



public class AxisEmitterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
{
  /*CONTEXT_ID PPAE0001 for the Axis Emitter Preference Page*/
  private String INFOPOP_PPAE_PAGE = WebServiceAxisConsumptionUIPlugin.ID + ".PPAE0001";
  //
  private Button allWanted;
  /*CONTEXT_ID PPAE0002 for the all wanted check box on the Axis Emitter Preference Page*/
  private String INFOPOP_PPAE_CHECKBOX_ALL_WANTED = "PPAE0002";
  //
  private Button helperWanted;
  /*CONTEXT_ID PPAE0003 for helper wanted check box on the Axis Emitter Preference Page*/
  private String INFOPOP_PPAE_CHECKBOX_HELPER_WANTED = "PPAE0003";
  //
  private Button wrapArrays;
  /*CONTEXT_ID PPAE0004 for the wrap arrays check box on the Axis Emitter Preference Page*/
  private String INFOPOP_PPAE_CHECKBOX_WRAP_ARRAYS = "PPAE0004";

  private Combo deployScopeTypes;
  //*CONTEXT_ID PPAE0005 for the deploy scope type combo box on the Axis Emitter page*/
  private String INFOPOP_PPAE_COMBO_DEPLOY_SCOPE = "PPAE0005";
  
  private StackLayout timeOutSubCompositeStackLayout;
  
  private Text timeOutField;
  int timeOut;
  String wsdl2JavaTimeoutProperty = System.getProperty("AxisWsdl2JavaTimeout");
  
  private Text timeOutMsgText;
  /*CONTEXT_ID PPAE0006 for the time out field on the Axis Emitter Preference page*/
  private String INFOPOP_PPAE_FIELD_TIME_OUT = "PPAE0006";

  private Button useInheritedMethods;
  /*CONTEXT_ID PPAE0007 for the use inherited methods check box on the Axis Emitter Preference page*/
  private String INFOPOP_PPAE_CHECKBOX_USE_INHERITED_METHODS = "PPAE0007";

  private Button validateAgainstJAXRPC;
  /*CONTEXT_ID PPAE0010 for the "validate against JAXRPC..." check box on the Axis Emitter Preference page*/
  private String INFOPOP_PPAE_CHECKBOX_VALIDATE_AGAINST_JAXRPC = "PPAE0010";
  
  /*CONTEXT_ID PPAE0008 for the wsdl2java group on the Axis Emitter Preference page*/
  private String INFOPOP_PPAE_GROUP_WSDL2JAVA = "PPAE0008";
  /*CONTEXT_ID PPAE0009 for the java2wsdl group on the Axis Emitter Preference page*/
  private String INFOPOP_PPAE_GROUP_JAVA2WSDL = "PPAE0009";
/**
   * Creates preference page controls on demand.
   *   @param parent  the parent for the preference page
   */
  protected Control createContents(Composite superparent)
  {
	UIUtils utils = new UIUtils( WebServiceAxisConsumptionUIPlugin.ID );
  	IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
  	
    Composite   parent = new Composite( superparent, SWT.NONE );	
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    parent.setLayout( layout );
    parent.setToolTipText(AxisConsumptionUIMessages.TOOLTIP_PPAE_PAGE);
    helpSystem.setHelp(parent, INFOPOP_PPAE_PAGE);
    Group wsdl2JavaGroup = utils.createGroup(parent, AxisConsumptionUIMessages.GROUP_WSDL2JAVA_NAME, AxisConsumptionUIMessages.TOOLTIP_PPAE_GROUP_WSDL2JAVA, INFOPOP_PPAE_GROUP_WSDL2JAVA, 2, 10,10);
    allWanted = createCheckBox(wsdl2JavaGroup, AxisConsumptionUIMessages.BUTTON_ALL_WANTED,AxisConsumptionUIMessages.TOOLTIP_PPAE_CHECKBOX_ALL_WANTED,INFOPOP_PPAE_CHECKBOX_ALL_WANTED);

    helperWanted  = createCheckBox(wsdl2JavaGroup, AxisConsumptionUIMessages.BUTTON_HELPER_WANTED,AxisConsumptionUIMessages.TOOLTIP_PPAE_CHECKBOX_HELPER_WANTED,INFOPOP_PPAE_CHECKBOX_HELPER_WANTED);

    wrapArrays = createCheckBox(wsdl2JavaGroup, AxisConsumptionUIMessages.BUTTON_WRAP_ARRAYS,AxisConsumptionUIMessages.TOOLTIP_PPAE_CHECKBOX_WRAP_ARRAYS,INFOPOP_PPAE_CHECKBOX_WRAP_ARRAYS);    
    
    deployScopeTypes = utils.createCombo(wsdl2JavaGroup, AxisConsumptionUIMessages.LABEL_DEPLOY_SCOPE, AxisConsumptionUIMessages.TOOLTIP_PPAE_COMBO_DEPLOY_SCOPE, INFOPOP_PPAE_COMBO_DEPLOY_SCOPE, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
    /* 
     * Ensure the order is the same as it in the fields for class
     * org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterContext
     */
    deployScopeTypes.setItems(new String []{AxisConsumptionUIMessages.DEPLOY_SCOPE_APPLICATION, AxisConsumptionUIMessages.DEPLOY_SCOPE_REQUEST,AxisConsumptionUIMessages.DEPLOY_SCOPE_SESSION});
    
    Label timeoutLabel = new Label(wsdl2JavaGroup, SWT.WRAP);
    timeoutLabel.setText(AxisConsumptionUIMessages.LABEL_TIME_OUT);
    timeoutLabel.setToolTipText(AxisConsumptionUIMessages.TOOLTIP_PPAE_FIELD_TIME_OUT);
    
    Composite timeOutSubComposite = utils.createComposite(wsdl2JavaGroup, 1);
    timeOutSubCompositeStackLayout = new StackLayout();
    timeOutSubComposite.setLayout(timeOutSubCompositeStackLayout);
    
    // only one of this is displayed at one time, they share infopop and tooltip text
    timeOutField = createTextField(timeOutSubComposite, null ,AxisConsumptionUIMessages.TOOLTIP_PPAE_FIELD_TIME_OUT,INFOPOP_PPAE_FIELD_TIME_OUT);
    timeOutMsgText = createTextField(timeOutSubComposite, null ,AxisConsumptionUIMessages.TOOLTIP_PPAE_FIELD_TIME_OUT,INFOPOP_PPAE_FIELD_TIME_OUT);
    
    timeOutMsgText.setEditable(false);
    
    Group java2WsdlGroup = utils.createGroup(parent, AxisConsumptionUIMessages.GROUP_JAVA2WSDL_NAME, AxisConsumptionUIMessages.TOOLTIP_PPAE_GROUP_JAVA2WSDL, INFOPOP_PPAE_GROUP_JAVA2WSDL, 2, 10,10);
    useInheritedMethods = createCheckBox(java2WsdlGroup, AxisConsumptionUIMessages.BUTTON_USE_INHERITED_METHODS,AxisConsumptionUIMessages.TOOLTIP_PPAE_CHECKBOX_USE_INHERITED_METHODS,INFOPOP_PPAE_CHECKBOX_USE_INHERITED_METHODS);
    validateAgainstJAXRPC = createCheckBox(java2WsdlGroup, AxisConsumptionUIMessages.BUTTON_VALIDATE_AGAINST_JAXRPC,AxisConsumptionUIMessages.TOOLTIP_PPAE_CHECKBOX_VALIDATE_AGAINST_JAXRPC,INFOPOP_PPAE_CHECKBOX_VALIDATE_AGAINST_JAXRPC);

    initializeValues();
    org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent);    

    return parent;
  }
  
  /**
   * Creates checkbox with horizontalSpan = 2 in its grid data in order to
   * match the grid layout for combo 
   */
  private Button createCheckBox( Composite parent, String labelName, String tooltip, String infopop )
  {
    Button button = new Button( parent, SWT.CHECK );
    button.setText(labelName);
    button.setToolTipText( tooltip );
    if( infopop != null ) PlatformUI.getWorkbench().getHelpSystem().setHelp( button, WebServiceAxisConsumptionUIPlugin.ID + "." + infopop );
	GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
	gd.horizontalSpan= 2;
	button.setLayoutData(gd);	
    return button;
  }
     
  private Text createTextField(Composite parent,String labelName, String tooltip, String infopop) 
  { tooltip = tooltip == null ? labelName : tooltip;
	if( labelName != null )
    {
      Label label = new Label( parent, SWT.WRAP);
      label.setText( labelName );
      label.setToolTipText( tooltip );
    }
     Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
     GridData data = new GridData();
     data.verticalAlignment = GridData.FILL;
     data.horizontalAlignment = GridData.FILL;
     data.grabExcessHorizontalSpace = true;
     text.setLayoutData(data);
     text.setToolTipText(tooltip);
     if( infopop != null ) PlatformUI.getWorkbench().getHelpSystem().setHelp( text, WebServiceAxisConsumptionUIPlugin.ID + "." + infopop );
     
     text.addModifyListener( new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			numberFieldChanged((Text) e.widget);
		}
	 }
     );
     return text;
  }

  /**
   * Does anything necessary because the default button has been pressed.
   */
  protected void performDefaults()
  {
    super.performDefaults();
    initializeDefaults();
  }

  /**
   * Do anything necessary because the OK button has been pressed.
   *  @return whether it is okay to close the preference page
   */
  public boolean performOk()
  {
    if(validateNumber(timeOutField.getText()).isOK())
    	storeValues();
    return true;
  }

  protected void performApply()
  {
    performOk();
  }

  /**
   * @see IWorkbenchPreferencePage
   */
  public void init(IWorkbench workbench)  { }

  /**
   * Initializes states of the controls using default values
   * in the preference store.
   */
  private void initializeDefaults()
  {
    allWanted.setSelection( AxisEmitterDefaults.getAllWantedDefault());
    helperWanted.setSelection( AxisEmitterDefaults.getHelperWantedDefault());
    wrapArrays.setSelection( AxisEmitterDefaults.getWrapArraysDefault());
    deployScopeTypes.select(AxisEmitterDefaults.getDeployScopeDefault());
    if (wsdl2JavaTimeoutProperty != null) timeOutField.setText(""+ getTimeOutValueWithProperty());
    else timeOutField.setText("" + AxisEmitterDefaults.getTimeOutDefault());	
    useInheritedMethods.setSelection(AxisEmitterDefaults.getUseInheritedMethodsDefault());
    validateAgainstJAXRPC.setSelection(AxisEmitterDefaults.getValidateAgainstJAXRPC());
  }

  /**
   * Initializes states of the controls from the preference store.
   */
  private void initializeValues()
  {
    // get the persistent context from the plugin
    AxisEmitterContext context = WebServiceAxisConsumptionCorePlugin.getInstance().getAxisEmitterContext();
    allWanted.setSelection( context.isAllWantedEnabled());
    helperWanted.setSelection( context.isHelperWantedEnabled());
    wrapArrays.setSelection( context.isWrapArraysEnabled());
    deployScopeTypes.select(context.getDeployScopeType());
    useInheritedMethods.setSelection( context.isUseInheritedMethodsEnabled());
    validateAgainstJAXRPC.setSelection( context.isValidateAgainstJAXRPCEnabled() );
    if (wsdl2JavaTimeoutProperty != null) 
    {	timeOut=getTimeOutValueWithProperty();
    	//timeOutField.setEnabled(false);
    	timeOutSubCompositeStackLayout.topControl = timeOutMsgText;
        timeOutMsgText.setText(AxisConsumptionUIMessages.MSG_USE_JVM_ARGUMENT_FOR_TIME_OUT);		
    }
	else
	{
	    timeOut = context.getTimeOut();
	    timeOutSubCompositeStackLayout.topControl = timeOutField;
	}
    timeOutField.setText(""+ timeOut);
   }

  /**
   * Stores the values of the controls back to the preference store.
   */
  private void storeValues()
  {
    // get the persistent context from the plugin
    AxisEmitterContext context = WebServiceAxisConsumptionCorePlugin.getInstance().getAxisEmitterContext();
    context.setAllWantedEnabled( allWanted.getSelection() );
    context.setHelperWantedEnabled( helperWanted.getSelection() );
    context.setWrapArraysEnabled( wrapArrays.getSelection() );
    context.selectDeployScopeType(deployScopeTypes.getSelectionIndex());
    timeOut = Integer.parseInt(timeOutField.getText().trim());
    context.setTimeOut(timeOut);
    context.setUseInheritedMethodsEnabled( useInheritedMethods.getSelection() );
    context.setValidateAgainstJAXRPCEnabled( validateAgainstJAXRPC.getSelection() );
  }
  
  private void numberFieldChanged(Text textControl) {
		IStatus status = validateNumber(textControl.getText());
		setValid(!status.matches(IStatus.ERROR));
		applyToStatusLine(this,status);	
 }
  
  private int getTimeOutValueWithProperty() 
  {
	  if (wsdl2JavaTimeoutProperty != null)
	  {	try {
		  long timeOutProperty = Long.parseLong(wsdl2JavaTimeoutProperty);
		  if (timeOutProperty < 0) return -1; // timeout = -1 equals never time out; treating all negative number as -1
		  else return (int)Math.ceil(timeOutProperty/1000.0);
	    } catch (NumberFormatException e){
	      System.err.print("AxisWSDL2JavaTimeout is not a valid number");
	      return AxisEmitterDefaults.getTimeOutDefault();
	    }
	  }
	  else return AxisEmitterDefaults.getTimeOutDefault();
  }
  
  private IStatus validateNumber(String numberString)
  {
	    IStatus status;
		try 
		{
			int number = Integer.parseInt(numberString);
			if (number <= 0 && number != -1)
			{
				status = new Status(IStatus.ERROR, WebServiceAxisConsumptionUIPlugin.ID, IStatus.ERROR,
						AxisConsumptionUIMessages.MSG_ERROR_INVALID_TIME_OUT, null);
			}
			else
			{	timeOut = number;
				status = Status.OK_STATUS;
				//we set param:message="" here, Later in 
				//applyToStatusLine(), we do page.setMessage(null,type) 
				status = new Status(IStatus.OK, WebServiceAxisConsumptionUIPlugin.ID, IStatus.OK, "",null);
			}
		} 
		catch 
		(NumberFormatException e) 
		{
			status = new Status(IStatus.ERROR, WebServiceAxisConsumptionUIPlugin.ID, IStatus.ERROR,
					AxisConsumptionUIMessages.MSG_ERROR_INVALID_TIME_OUT, null);
		}
		return status; 
  	}
  
	private void applyToStatusLine(DialogPage page, IStatus status) {
		String message= status.getMessage();
		switch (status.getSeverity()) {
			case IStatus.OK:
				page.setMessage(null, IMessageProvider.NONE);
				page.setErrorMessage(null);
				break;
			case IStatus.WARNING:
				page.setMessage(message, IMessageProvider.WARNING);
				page.setErrorMessage(null);
				break;				
			case IStatus.INFO:
				page.setMessage(message, IMessageProvider.INFORMATION);
				page.setErrorMessage(null);
				break;			
			default:
				if (message.length() == 0) {
					message= null;
				}
				page.setMessage(null);
				page.setErrorMessage(message);
				break;		
		}
	}
}

Back to the top

'/> -rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeUseAdapter.java79
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java199
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java208
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDChildUtility.java280
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java418
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java295
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEmptyFieldAdapter.java120
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java231
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java200
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDParticleAdapter.java161
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java503
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java151
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java68
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java219
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java177
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java227
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/DragAndDropCommand.java505
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java109
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java223
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ConnectableEditPart.java207
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java73
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/SpaceFillerForFieldEditPart.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java41
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDAttributesForAnnotationEditPart.java59
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java88
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDEditPartFactory.java150
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDGroupsForAnnotationEditPart.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDModelGroupRouter.java379
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java322
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java157
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java163
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/TargetConnectionSpaceFiller.java50
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/DragAndDropEditPolicy.java45
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java33
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java237
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelComponentLabelCellEditorLocator.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java97
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java98
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java93
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java47
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ContainerLayout.java219
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/FillLayout.java158
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ModelGroupLayout.java197
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/BuiltInTypesTreeViewerProvider.java221
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementButtonHandler.java26
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementDialog.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeButtonHandler.java26
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java108
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java267
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java157
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java192
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java460
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java69
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java104
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java254
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gifbin806 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gifbin605 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gifbin609 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gifbin860 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.gifbin3261 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gifbin54 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gifbin92 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gifbin558 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gifbin88 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gifbin594 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gifbin613 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gifbin384 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gifbin121 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gifbin235 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gifbin361 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gifbin350 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gifbin145 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gifbin211 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gifbin155 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gifbin594 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gifbin368 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gifbin585 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gifbin101 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gifbin227 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gifbin361 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gifbin205 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gifbin899 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gifbin114 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gifbin324 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gifbin323 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gifbin558 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gifbin177 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gifbin115 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gifbin373 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gifbin136 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gifbin91 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gifbin210 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gifbin105 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gifbin347 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gifbin120 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gifbin141 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gifbin150 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gifbin150 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gifbin138 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gifbin210 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gifbin323 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gifbin583 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gifbin873 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gifbin825 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gifbin339 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gifbin874 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gifbin612 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gifbin225 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.gifbin3241 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gifbin365 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gifbin159 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gifbin598 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java189
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java124
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java110
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java50
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java208
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java152
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java216
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java193
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java195
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/DocumentAdapter.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java83
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java409
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java246
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java431
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java39
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java64
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java335
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java421
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java68
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java69
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java129
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java371
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/AddFieldAction.java77
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseDirectEditAction.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java77
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/ShowPropertiesViewAction.java56
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java161
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/FlatCCombo.java1493
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IAnnotationProvider.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java367
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ComboBoxCellEditorManager.java224
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ElementReferenceDirectEditManager.java179
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelCellEditorLocator.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java132
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/TypeReferenceDirectEditManager.java187
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTEditPartFactory.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java201
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java183
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BoxEditPart.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ColumnEditPart.java112
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/EditPartNavigationHandlerUtil.java72
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/FieldEditPart.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IConnectionContainer.java6
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/INamedEditPart.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java168
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java223
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java62
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/AbstractModelCollection.java65
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Annotation.java37
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Compartment.java73
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/FocusTypeColumn.java47
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IActionProvider.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IFeedbackHandler.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IModelProxy.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/ReferencedTypeColumn.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTDirectEditPolicy.java46
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java40
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/DirectEditPolicyDelegate.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/IADTUpdateCommand.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/KeyBoardAccessibilityEditPolicy.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/SimpleDirectEditPolicy.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IADTFigure.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/ICompartmentFigure.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFieldFigure.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFigureFactory.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IStructureFigure.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager.java26
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/IComponentDialog.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonSelectionManager.java111
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ContextMenuParticipant.java15
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IEditorModeListener.java6
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java41
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties24
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObject.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObjectListener.java16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java34
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IModel.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IStructure.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java217
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTLabelProvider.java79
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ITreeElement.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/properties/ADTTabbedPropertySheetPage.java40
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyElementAction.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupAction.java95
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java75
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java53
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java112
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetMultiplicityAction.java88
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionCommand.java48
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSchemaDirectiveCommand.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionAttributerCommand.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionElementCommand.java46
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java365
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSectionDescriptor.java108
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/CommonDirectivesSection.java155
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java405
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/FacetViewer.java559
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/IDocumentChangedNotifier.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java216
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java93
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SimpleContentUnionMemberTypesDialog.java312
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SpecificConstraintsWidget.java692
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDActionManager.java148
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSectionFilter.java42
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDTableTreeViewer.java126
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionDetailsContentProvider.java201
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemEditManager.java40
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemMenuListener.java117
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeContentProvider.java73
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeLabelProvider.java56
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsContentProvider.java9
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsViewer.java269
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItem.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItemEditManager.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SelectFromCatalogDialog.java212
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DefaultListNodeEditorConfiguration.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DialogNodeEditorConfiguration.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/ListNodeEditorConfiguration.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeCustomizationRegistry.java129
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorConfiguration.java33
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorProvider.java8
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/Messages.java113
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/messages.properties96
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java38
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java35
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/PerformUnsavedRefactoringOperation.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java62
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java115
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java158
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java118
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java156
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java57
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java195
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java50
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java54
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties41
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java52
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java174
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameTargetNamespaceProcessor.java419
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java108
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java296
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java87
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/AbstractCommand.java71
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeAnonymousTypeGlobalCommand.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java98
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java168
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java220
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java97
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorActionGroup.java215
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java146
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java57
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactoringWizardMessages.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameRefactoringWizard.java72
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties55
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java29
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/SearchMessages.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java93
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java51
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchQuery.java54
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/CompositeActionGroup.java99
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/DeclarationsSearchGroup.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesAction.java149
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ImplementorsSearchGroup.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/OccurrencesSearchGroup.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/SearchGroup.java20
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchActionGroup.java35
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchDeclarationsGroupActionDelegate.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchReferencesGroupActionDelegate.java46
396 files changed, 0 insertions, 34301 deletions
diff --git a/bundles/org.eclipse.wst.xsd.ui/.cvsignore b/bundles/org.eclipse.wst.xsd.ui/.cvsignore
deleted file mode 100644
index 6500e4dc83..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-xsdeditor.jar
-build.xml
-temp.folder
-org.eclipse.wst.xsd.ui_1.0.0.jar
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.xsd.ui/.project b/bundles/org.eclipse.wst.xsd.ui/.project
deleted file mode 100644
index aab3824094..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.xsd.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.xsd.ui/about.html b/bundles/org.eclipse.wst.xsd.ui/about.html
deleted file mode 100644
index 4ec5989581..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 2, 2006</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor’s license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.xsd.ui/build.properties b/bundles/org.eclipse.wst.xsd.ui/build.properties
deleted file mode 100644
index 856249acfd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/build.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 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
-###############################################################################
-source.. = src-search/,\
- src-refactor/,\
- src-adt/,\
- src-adt-xsd/,\
- src-adt-xsd-typeviz/,\
- src-common/
-bin.includes = .,\
- plugin.xml,\
- icons/,\
- plugin.properties,\
- META-INF/,\
- about.html
-src.includes = build.properties,\
- component.xml
-output.. = bin/
diff --git a/bundles/org.eclipse.wst.xsd.ui/component.xml b/bundles/org.eclipse.wst.xsd.ui/component.xml
deleted file mode 100644
index 294443a7d4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/component.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model"
- name="org.eclipse.wst.xsd">
- <component-depends unrestricted="true"></component-depends>
- <plugin id="org.eclipse.wst.xsd.ui" fragment="false" />
- <plugin id="org.eclipse.wst.xsd.core" fragment="false" />
-</component> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gif b/bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gif
deleted file mode 100644
index 3900f1b55d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/blank.gif b/bundles/org.eclipse.wst.xsd.ui/icons/blank.gif
deleted file mode 100644
index 1936e21a7c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/blank.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/browsebutton.gif b/bundles/org.eclipse.wst.xsd.ui/icons/browsebutton.gif
deleted file mode 100644
index 13dae59bea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/browsebutton.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/collapse_attr.gif b/bundles/org.eclipse.wst.xsd.ui/icons/collapse_attr.gif
deleted file mode 100644
index b872beee62..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/collapse_attr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/delete_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/delete_obj.gif
deleted file mode 100644
index b6922ac11c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/delete_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/schemaview_co.gif b/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/schemaview_co.gif
deleted file mode 100644
index 5b67950b38..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/schemaview_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/showproperties_obj.gif
deleted file mode 100644
index d94ff10555..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/showproperties_obj.gif
deleted file mode 100644
index d94ff10555..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/dtool16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/schemaview_co.gif b/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/schemaview_co.gif
deleted file mode 100644
index f2d7f1b8b8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/schemaview_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/showproperties_obj.gif
deleted file mode 100644
index 1dc19a31a0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/elcl16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/showproperties_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/etool16/showproperties_obj.gif
deleted file mode 100644
index 1dc19a31a0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/etool16/showproperties_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/expand_attr.gif b/bundles/org.eclipse.wst.xsd.ui/icons/expand_attr.gif
deleted file mode 100644
index 5c287e92dd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/expand_attr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/filter.gif b/bundles/org.eclipse.wst.xsd.ui/icons/filter.gif
deleted file mode 100644
index 6fe6f0e10a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/filter.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnyAttributedis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnyAttributedis.gif
deleted file mode 100644
index 2440a24c26..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnyAttributedis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnydis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnydis.gif
deleted file mode 100644
index 44da7510b0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnydis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroup.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroup.gif
deleted file mode 100644
index 5a8df73015..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroup.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRef.gif
deleted file mode 100644
index b2c1db9ef4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRefdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRefdis.gif
deleted file mode 100644
index 79dc58fe6c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRefdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupdis.gif
deleted file mode 100644
index 1e81677a91..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeRefdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeRefdis.gif
deleted file mode 100644
index f80af50633..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeRefdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributedis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributedis.gif
deleted file mode 100644
index 121d192343..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributedis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexContent.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexContent.gif
deleted file mode 100644
index b90c12e78d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexContent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexType.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexType.gif
deleted file mode 100644
index 878b94f132..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexType.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexTypedis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexTypedis.gif
deleted file mode 100644
index 36d1b3e560..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexTypedis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementRefdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementRefdis.gif
deleted file mode 100644
index 40bd3aa68e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementRefdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementdis.gif
deleted file mode 100644
index 7b56868c26..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroup.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroup.gif
deleted file mode 100644
index 462c2d4aa5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroup.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRef.gif
deleted file mode 100644
index 068987bf0b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRefdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRefdis.gif
deleted file mode 100644
index e217e9b228..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRefdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupdis.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupdis.gif
deleted file mode 100644
index 98df7f416e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupdis.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDSimpleContent.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDSimpleContent.gif
deleted file mode 100644
index 2ae812cefb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDSimpleContent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/all_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/all_obj.gif
deleted file mode 100644
index da37fbad3e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/all_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/alldis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/alldis_obj.gif
deleted file mode 100644
index 6f5484c764..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/alldis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/annotationsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/annotationsheader.gif
deleted file mode 100644
index 9bfb682d28..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/annotationsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributegroupsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributegroupsheader.gif
deleted file mode 100644
index 78092ff114..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributegroupsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributesheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributesheader.gif
deleted file mode 100644
index 9254879842..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/attributesheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choice_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choice_obj.gif
deleted file mode 100644
index 8af583f4bd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choice_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choicedis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choicedis_obj.gif
deleted file mode 100644
index 7ecc4ff4b9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/choicedis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/directivesheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/directivesheader.gif
deleted file mode 100644
index 6000cb80f4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/directivesheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/elementsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/elementsheader.gif
deleted file mode 100644
index 26f720648d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/elementsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_marker.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_marker.gif
deleted file mode 100644
index 61e1e258d7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/error_marker.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gif
deleted file mode 100644
index 7ca11cd95c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/index.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/index.gif
deleted file mode 100644
index 5bf9ac077e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/index.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/notationsheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/notationsheader.gif
deleted file mode 100644
index e05c6455ea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/notationsheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequence_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequence_obj.gif
deleted file mode 100644
index 16b8612332..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequence_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequencedis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequencedis_obj.gif
deleted file mode 100644
index fd972de440..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequencedis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletype_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletype_obj.gif
deleted file mode 100644
index 2e74430cc2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletype_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletypedis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletypedis_obj.gif
deleted file mode 100644
index 320973eedd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletypedis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gif
deleted file mode 100644
index 0b518c602b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_listdis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_listdis_obj.gif
deleted file mode 100644
index b83825cd0a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_listdis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gif
deleted file mode 100644
index d6a9afd1b8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrictdis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrictdis_obj.gif
deleted file mode 100644
index 2b67663dfd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrictdis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gif
deleted file mode 100644
index 6613149c90..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_uniondis_obj.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_uniondis_obj.gif
deleted file mode 100644
index 717203b3d3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_uniondis_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/typesheader.gif b/bundles/org.eclipse.wst.xsd.ui/icons/obj16/typesheader.gif
deleted file mode 100644
index 3267542eac..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/obj16/typesheader.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/attributeoverlay.gif b/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/attributeoverlay.gif
deleted file mode 100644
index 1931f929b2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/attributeoverlay.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/textoverlay.gif b/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/textoverlay.gif
deleted file mode 100644
index d455c2b53f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/icons/ovr16/textoverlay.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/plugin.properties b/bundles/org.eclipse.wst.xsd.ui/plugin.properties
deleted file mode 100644
index f36768051e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/plugin.properties
+++ /dev/null
@@ -1,848 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 2004 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: XMSCH - XML Tools - XML Schema Editor
-! Packaged for translation in: xml.zip
-
-!
-! Plugin
-!
-_UI_PLUGIN_NAME = XML Schema Editor
-_UI_EDITOR_NAME = XML Schema Editor
-
-_UI_ACTION_EXT_GENERATE = &Generate
-_UI_ACTION_EXT_GENERATE_DDL = &DDL...
-_UI_ACTION_EXT_GENERATE_DTD = D&TD...
-_UI_ACTION_EXT_GENERATE_JAVA = &Java Beans...
-
-_UI_ACTION_EXT_GENERATE_XSD = &Generate XML Schema
-_UI_WIZARD_NAME_NEW_XSD = XML Schema
-
-_UI_XML_TOOLS_PREFERENCE_PAGE = XML
-_UI_XML_SCHEMA_PREFERENCE = XML Schema Files
-
-_UI_WIZARD_NEW_XSD = XML Schema
-_UI_CREATE_A_NEW_SCHEMA = Create a new XML schema file
-
-! New property tabs
-_UI_LABEL_GENERAL = General
-_UI_LABEL_ATTRIBUTES = Attributes
-_UI_LABEL_DOCUMENTATION = Documentation
-_UI_LABEL_TYPE_CONSTRAINTS = Constraints
-_UI_LABEL_APPLICATION_INFO = Application Info
-_UI_LABEL_EXTENSIONS = Extensions
-_UI_LABEL_FACETS = Facets
-_UI_LABEL_ENUMERATIONS = Enumerations
-_UI_LABEL_NAMESPACE = Namespace
-_UI_LABEL_ADVANCED = Advanced
-
-_UI_LABEL_READ_ONLY = read-only
-_UI_LABEL_KIND = Kind:
-_UI_LABEL_VARIETY = Variety:
-
-_UI_LABEL_APP_INFO = App Info
-
-!
-! Schema File Window
-!
-_UI_LABEL_FILE_NAME = File name:
-_UI_LABEL_VERSION = Version:
-_UI_TOOLTIP_VERSION = Convenient attribute to store version number
-_UI_LABEL_LANGUAGE = Language:
-_UI_TOOLTIP_LANGUAGE = Represents natural language identifiers
-_UI_GROUP_NAMESPACE = Namespace
-_UI_LABEL_SCHEMA_PREFIX = Prefix:
-_UI_TOOLTIP_SCHEMA_PREFIX = The prefix associated with the current namespace.
-_UI_LABEL_TARGET_NAME_SPACE = Target namespace:
-_UI_TOOLTIP_TARGET_NAME_SPACE = The namespace for this schema.
-_UI_BUTTON_APPLY = Apply
-_UI_LABEL_ATTRIBUTE_FORM_DEFAULT = Attribute form default:
-_UI_TOOLTIP_ATTRIBUTE_FORM = Indicates if all attributes in a schema must be qualified or not in the instance document
-_UI_LABEL_ELEMENT_FORM_DEFAULT = Element form default:
-_UI_TOOLTIP_ELEMENT_FORM_DEFAULT = Indicates if all elements in a schema must be qualified or not in the instance document
-_UI_LABEL_BLOCK_DEFAULT = Block default:
-_UI_TOOLTIP_BLOCK_DEFAULT = Control derivations for every type and element in the schema
-_UI_LABEL_FINAL_DEFAULT = Final default:
-_UI_TOOLTIP_FINAL_DEFAULT = Control derivations for every type and element in the schema
-_UI_ACTION_DELETE_INCLUDE = Delete
-_UI_ACTION_DELETE_NODES = Delete Nodes
-! Note to translators: The following is the acronym for Uniform Resource Indicator
-_UI_LABEL_URI = URI:
-
-
-_UI_LABEL_ADD = Add...
-_UI_LABEL_EDIT = Edit...
-_UI_LABEL_PATTERNS = Patterns
-_ERROR_FILE_ALREADY_EXISTS = The file name already exists: {0}
-
-!
-! Any Section
-!
-! Note to translators - translate only the word and
-_UI_LABEL_NAMESPACE_AND_PROCESS_CONTENTS = namespace and processContents
-
-!
-! minOccurs and maxOccurs section
-!
-! Note to translators - translate only the word and
-_UI_LABEL_MINOCCURS_AND_MAXOCCURS = minOccurs and maxOccurs
-
-!
-! Value Information Section
-!
-_UI_LABEL_VALUE_INFORMATION = Value Information
-
-!
-! Notation window
-!
-_UI_NOTATION_NAME = Name:
-_UI_NOTATION_PUBLIC = Public:
-_UI_NOTATION_SYSTEM = System:
-_UI_TOOLTIP_PUBLIC = An optional public identifier
-_UI_TOOLTIP_SYSTEM = An optional URI reference
-
-!
-! Complex Type Window
-!
-_UI_NAME = Name:
-_UI_ABSTRACT = Abstract:
-_UI_MIXED = Mixed:
-_UI_BLOCK = Block:
-_UI_FINAL = Final:
-
-_UI_CT_TOOLTIP_MIXED = Indicates if type may contain mixed content
-_UI_CT_TOOLTIP_ABSTRACT = When a complex type is declared abstract, it cannot be used in an instance document
-_UI_CT_TOOLTIP_FINAL = You can use this to prevent further derivations
-_UI_CT_TOOLTIP_BLOCK = You can use this to block any derivations
-
-!
-! SimpleContent and ComplexContent Window
-!
-_UI_LABEL_DERIVED_BY = Derived by:
-_UI_TOOLTIP_DERIVED_BY = Derive by extension to inherit from a base type content model and add to it. Derive by restriction to restrict the content model of an existing type.
-
-!
-! Combo box items - no need to translate
-!
-_UI_COMBO_RESTRICTION = restriction
-_UI_COMBO_EXTENSION = extension
-
-!
-! Element & Element Ref Window
-!
-_UI_ELEMENT_NAME = Name:
-_UI_CHECKBOX_NILLABLE = Nillable
-_UI_CHECKBOX_ABSTRACT = Abstract
-_UI_SUBSTITUTION = Substitution group:
-_UI_MINIMUM = Minimum:
-_UI_MAXIMUM = Maximum:
-_UI_REFERENCE_NAME = Reference name:
-
-_UI_TOOLTIP_ELEMENT_MINIMUM = A non-negative integer that specifies the minimum number of times an element can occur.
-_UI_TOOLTIP_ELEMENT_MAXIMUM = A non-negative integer or unbounded if there is no upper limit on the number of times the element can occur.
-_UI_TOOLTIP_ELEMENT_ABSTRACT = When an element is declared abstract, a member of its equivalent class must appear in the instance document,
-_UI_TOOLTIP_ELEMENT_NIL = If selected, an attribute can be included in the instance document to indicate that the element has a nil value.
-_UI_TOOLTIP_ELEMENT_SUBSTITUTION = Select the element that can be substituted by this element
-_UI_TOOLTIP_ELEMENT_FORM = Indicates if the element is qualifed in the instance document
-_UI_TOOLTIP_ELEMENT_VALUE = Provides a default or fixed value for the element.
-
-
-!
-! Attribute Window
-! _UI_COMBO_BOX strings are used in code generation.
-! Probably don't need to be translated
-!
-_UI_COMBO_BOX_REQUIRED = required
-_UI_COMBO_BOX_OPTIONAL = optional
-_UI_COMBO_BOX_PROHIBITED = prohibited
-
-_UI_FIXED = Fixed
-_UI_DEFAULT = Default
-_UI_ATTRIBUTE_NAME = Attribute name:
-_UI_USAGE = Usage:
-_UI_FORM = Form qualification:
-_UI_VALUE = Value
-
-_UI_LABEL_OTHER_ATTRIBUTES = Other Attributes
-
-_UI_TOOLTIP_ATTRIBUTE_USE = Indicates if the attribute is required, optional, or prohibited
-_UI_TOOLTIP_ATTRIBUTE_FORM = Indicates if the attribute is qualifed or not in the instance document
-_UI_TOOLTIP_ATTRIBUTE_VALUE = Provides default or fixed value for the attribute. Default value only valid if Usage value is set to optional.
-
-_UI_PROCESS_CONTENTS = Process contents:
-
-!
-! Annotation - Doc & AppInfo Window
-!
-_UI_COMMENT = Comment
-_UI_TOOLTIP_COMMENT = Information useful to the user or application
-_UI_SOURCE = Source:
-_UI_TOOLTIP_SOURCE = An optional URI reference to supplement the local information
-_UI_LANGUAGE = Language:
-_UI_TOOLTIP_LANGUAGE_ANNOTATION = Indicate the language in which the annotation is expressed
-
-!
-! Group
-!
-_UI_CONTENT_MODEL = Content model
-_UI_SEQUENCE = Sequence
-_UI_CHOICE = Choice
-_UI_ALL = All
-
-
-!
-! Simple Type Related Facets - appear as entries in a table - restriction on simple type
-!
-_UI_GROUP_FACETS = Facets
-_UI_LENGTH = Length
-_UI_MINIMUM_LENGTH = Minimum Length
-_UI_MAXIMUM_LENGTH = Maximum Length
-_UI_MINIMUM_INCLUSIVE = Minimum Inclusive
-_UI_MAXIMUM_INCLUSIVE = Maximum Inclusive
-_UI_MINIMUM_EXCLUSIVE = Minimum Exclusive
-_UI_MAXIMUM_EXCLUSIVE = Maximum Exclusive
-_UI_TOTAL_DIGITS = Total Digits
-_UI_FRACTION_DIGITS = Fraction Digits
-_UI_WHITE_SPACE = White Space
-_UI_FACET_NAME = Name
-_UI_FACET_VALUE = Value
-_UI_FACET_FIXED = Fixed
-
-_UI_TOOLTIP_LENGTH = The number of units of length. Must be a non-negative integer.
-_UI_TOOLTIP_MIN_LEN = The minimum number of units of length. Must be a non-negative integer.
-_UI_TOOLTIP_MAX_LEN = The maximum number of units of length. Must be a non-negative integer.
-_UI_TOOLTIP_MAX_INCLUSIVE = The upper bound of the value space. The value is itself included.
-_UI_TOOLTIP_MAX_EXCLUSIVE = The upper bound of the value space. The value is itself excluded.
-_UI_TOOLTIP_MIN_INCLUSIVE = The lower bound of the value space. The value is itself included.
-_UI_TOOLTIP_MIN_EXCLUSIVE = The lower bound of the value space. The value is itself excluded.
-_UI_TOOLTIP_TOTAL_DIGITS = The maximum number of decimal digits. Must be a positive integer.
-_UI_TOOLTIP_FRACTION_DIGITS = The maximum number of decimal digits in the fractional part. Must be a non-negative integer.
-_UI_TOOLTIP_WHITE_SPACE = Indicates if white space should be preserved, replaced or collapsed.
-
-_UI_TOOLTIP_PATTERN = Constrains the value to match a specific pattern. The pattern must be a regular expression.
-_UI_TOOLTIP_ENUM = Constrains the value to a specified set of values.
-
-!
-! Simple/Complex Type Selection
-!
-_UI_LABEL_TYPE_INFORMATION = Type information
-_UI_LABEL_BASE_TYPE = Base type
-_UI_LABEL_BASE_TYPE_WITH_COLON = Base type:
-_UI_LABEL_SET_BASE_TYPE = Set Base Type
-_UI_ACTION_SET_BASE_TYPE = Set Base Type...
-_UI_RADIO_NONE = None
-_UI_RADIO_BUILT_IN_SIMPLE_TYPE = Built-in simple type
-_UI_RADIO_USER_DEFINED_SIMPLE_TYPE = User-defined simple type
-_UI_RADIO_USER_DEFINED_COMPLEX_TYPE = User-defined complex type
-_UI_LABEL_NEW_COMPLEX_TYPE = New Complex Type
-_UI_LABEL_NEW_SIMPLE_TYPE = New Simple Type
-_UI_LABEL_SET_TYPE = Set Type
-_UI_LABEL_SET_EXISTING_TYPE = Set Existing Type...
-_UI_NO_TYPE = **none**
-_UI_LABEL_COMPONENTS = Components:
-_UI_LABEL_QUALIFIER = Qualifier:
-
-_UI_LABEL_COMPONENT_NAME = Component Name:
-_UI_LABEL_MATCHING_COMPONENTS = Matching Components:
-_UI_LABEL_MATCHING_TYPES = Matching Types:
-_UI_LABEL_TYPE_NAME = Type Name:
-_UI_LABEL_SPECIFIED_FILE = Specified File
-_UI_LABEL_ENCLOSING_PROJECT = Enclosing Project
-_UI_LABEL_WORKSPACE = Workspace
-_UI_LABEL_CURRENT_RESOURCE = Current Resource
-_UI_LABEL_SEARCH_SCOPE = Search Scope
-_UI_LABEL_NARROW_SEARCH_SCOPE_RESOURCE = Use resource view to narrow search scope
-_UI_LABEL_AVAILABLE_TYPES = Available Types
-
-
-!
-! Combo-box value
-! NOTE TO TRANSLATOR: Do not translate following line
-_UI_DEFAULT_ANONYMOUS = **anonymous**
-
-!
-! Unique, Key and KeyRef window
-!
-_UI_REFERENCE_KEY = Reference key
-_UI_SELECTOR = Selector
-_UI_FIELDS = Fields
-
-_UI_TOOLTIP_SELECTOR_TEXT = Specifies an XPath expression relative to instances of the current element
-_UI_TOOLTIP_FIELD_TEXT = Specifies an XPath expression relative to each element selected by the selector
-
-_UI_ADD_BUTTON = Add>>
-_UI_REMOVE_BUTTON = <<Remove
-
-!
-! Include & Imports
-!
-_UI_LABEL_PREFIX = Prefix:
-_UI_LABEL_NAMESPACE = Namespace:
-
-_UI_SCHEMA_INCLUDE_DESC = Select a schema file so that the definitions in the schema file will be available in the current schema. The target namespace of the included schema must be the same as the target namespace of the current schema.
-_UI_LABEL_SCHEMA_IMPORT_DESC = Select a schema file from a different namespace so that its definitions can be referenced by the current schema. You must associate a prefix with the new namespace for use in the current schema.
-
-_UI_LABEL_SCHEMA_LOCATION = Schema location:
-_UI_BUTTON_SELECT = Select
-_UI_FILEDIALOG_SELECT_XML_SCHEMA = Select XML schema file
-_UI_FILEDIALOG_SELECT_XML_DESC = Select an XML schema file from the Workbench projects
-_UI_FILEDIALOG_SELECT_XML_URL = Select an XML schema file from HTTP
-
-_UI_LABEL_LOADING_XML_SCHEMA = Loading XML Schema
-_UI_LABEL_FINISH_LOADING = Finish Loading
-_UI_LABEL_NO_LOCATION_SPECIFIED = No Location Specified
-
-!
-! XSD Editor
-!
-_UI_TAB_SOURCE = Source
-_UI_TAB_DESIGN = Design
-! Note to translators: Graph is the graphic view of the XML schema
-_UI_TAB_GRAPH = Graph
-_UI_MENU_UNDO = &Undo @Ctrl+Z
-_UI_MENU_REDO = &Redo @Ctrl+Y
-
-!
-! Task List Related Message
-!
-_UI_REF_FILE_ERROR_DESCRIPTION = The errors below were detected when validating the file "{0}" via the file "{1}". In most cases these errors can be detected by validating "{2}" directly. However it is possible that errors will only occur when {2} is validated in the context of {3}.
-_UI_REF_FILE_ERROR_PUSH_HELP = Push the help button below to read more.
-_UI_REF_FILE_ERROR_MESSAGE = Referenced file contains errors ({0}). For more information, right click on the message and select "Show Details..."
-_UI_REF_FILE_SHOW_DETAILS = Show Details...
-
-
-!
-! XSDEditor Menu bar contributor
-!
-_UI_MENU_GENERATE_JAVA = Generate &Java Beans...
-_UI_MENU_GENERATE_DTD = Generate &DTD...
-_UI_MENU_GENERATE_SAMPLE_XML = Generate XM&L...
-_UI_MENU_XSD_EDITOR = &XSD
-_UI_MENU_VALIDATE_XML = &Validate XML Schema
-_UI_MENU_VALIDATE_XML_TOOLTIP = Validate the current state of the XML Schema
-_UI_MENU_GENERATE_JAVA_TOOLTIP = Generate Java beans for the XML Schema
-_UI_MENU_GENERATE_DTD_TOOLTIP = Generate a DTD from the XML Schema
-_UI_MENU_GENERATE_SAMPLE_XML_TOOLTIP = Generate an XML from the XML Schema
-_UI_MENU_RELOAD_DEPENDENCIES_TOOLTIP = Reload Dependencies
-_UI_MENU_RELOAD_DEPENDENCIES = &Reload Dependencies
-
-!
-! Preference Page
-!
-_UI_TEXT_INDENT_LABEL = Indentation
-_UI_TEXT_INDENT_SPACES_LABEL = &Number of spaces:
-_UI_TEXT_XSD_NAMESPACE_PREFIX = XML schema language
-_UI_TEXT_XSD_DEFAULT_PREFIX = XML schema language constructs &prefix:
-_UI_QUALIFY_XSD = &Qualify XML schema language constructs
-_UI_SEPARATE_DESIGN_AND_SOURCE_VIEW = Separate Source, Design and Graph view
-_UI_COMBINED_DESIGN_AND_SOURCE_VIEW = Combined Source or Graph view with Design view
-_UI_LABEL_EDITOR_LAYOUT = Editor Layout
-_UI_PREF_DESIGN_VIEW_LAYOUT = Design View Location
-_UI_PREF_DESIGN_BOTTOM = Below
-_UI_PREF_DESIGN_RIGHT = Right
-_UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE = Default Target Namespace:
-
-!
-! Content Outline View action
-! NOTE TO TRANSLATOR: Do not translate the word(s) following "Add" on each line in
-! this section i.e. Annotation, Documentation, AppInfo These words are XML Schema keywords.
-_UI_ACTION_DELETE = D&elete
-_UI_ACTION_ADD_ANNOTATION = Add &Annotation
-_UI_ACTION_ADD_DOC = Add &Documentation
-_UI_ACTION_ADD_APP_INFO = Add A&ppInfo
-_UI_ACTION_ADD_GLOBAL_ELEMENT = Add Glob&al Element
-_UI_ACTION_ADD_KEY = Add &Key
-_UI_ACTION_ADD_KEY_REF = Add Key Re&f
-_UI_ACTION_ADD_UNIQUE = Add Uni&que
-_UI_ACTION_ADD_GROUP = Add G&roup
-_UI_ADD_GROUP_REF = Add Gr&oup Ref
-_UI_ACTION_ADD_CONTENT_MODEL = Add Content &Model
-_UI_ACTION_ADD_ELEMENT = Add &Element
-_UI_ACTION_ADD_ELEMENT_REF = Add E&lement Ref
-_UI_ACTION_ADD_SIMPLE_TYPE = Add &Simple Type
-_UI_ACTION_ADD_PATTERN = Add &Pattern
-_UI_ACTION_ADD_ENUM = Add En&umeration
-_UI_ACTION_ADD_ENUMS = Add Enu&merations...
-_UI_ACTION_ADD_COMPLEX_TYPE = Add Complex &Type
-_UI_ACTION_ADD_COMPLEX_CONTENT = Add Comple&x Content
-_UI_ACTION_ADD_SIMPLE_CONTENT = Add Simple &Content
-_UI_ACTION_ADD_ATTRIBUTE = Add Attri&bute
-_UI_ACTION_ADD_ATTRIBUTE_GROUP = Add Attr&ibute Group
-_UI_ACTION_ADD_ATTRIBUTE_GROUP_REF = Add A&ttribute Group Ref
-_UI_ACTION_ADD_INCLUDE = Add In&clude
-_UI_ACTION_ADD_IMPORT = Add &Import
-_UI_ACTION_ADD_REDEFINE = Add Re&define
-_UI_ACTION_ADD_NOTATION = Add &Notation
-_UI_ACTION_ADD_ANY_ELEMENT = Add An&y
-_UI_ACTION_ADD_ANY_ATTRIBUTE = Add &Any Attribute
-_UI_ACTION_ADD_GLOBAL_ATTRIBUTE = Add &Global Attribute
-_UI_ACTION_ADD_ATTRIBUTE_REFERENCE = Add Attrib&ute Ref
-_UI_ACTION_ADD_RESTRICTION = Add Re&striction
-_UI_ACTION_ADD_UNION = Add U&nion
-_UI_ACTION_ADD_LIST = Add &List
-_UI_ACTION_DELETE_GROUP_SCOPE = D&elete
-_UI_ACTION_ADD_CHOICE = Add &Choice
-_UI_ACTION_ADD_SEQUENCE = Add Se&quence
-_UI_ACTION_ADD_ALL = Add &All
-_UI_ACTION_ADD_EXTENSION = Add E&xtension
-_UI_ACTION_ADD_SELECTOR = Add &Selector
-_UI_ACTION_ADD_FIELD = Add &Field
-! NOTE TO TRANSLATOR: Translate Add and Node
-_UI_ACTION_ADD_SCHEMA_NODE = Add &Schema Node
-! NOTE TO TRANSLATOR: TRANSLATE Add and Local
-_UI_ACTION_ADD_LOCAL_SIMPLE_TYPE = Add Local &Simple Type
-_UI_ACTION_ADD_LOCAL_COMPLEX_TYPE = Add Local &Complex Type
-_UI_ACTION_BACK_TO_SCHEMA_VIEW = Back To Schema
-_UI_HOVER_BACK_TO_SCHEMA_VIEW = Back to schema
-
-_UI_ACTION_MAKE_ANONYMOUS_TYPE_GLOBAL = Make Anonymous Type Global
-_UI_ACTION_OPEN_SCHEMA = Open Schema
-
-_UI_ACTION_INSERT_BEFORE = Insert Before
-_UI_ACTION_INSERT_AFTER = Insert After
-
-_UI_OUTLINE_SORT = Sort alphabetically
-_UI_OUTLINE_DO_NOT_SORT = Do not sort alphabetically
-
-_UI_OUTLINE_SHOW_COMPLEX_TYPE = Show Complex Types Only
-_UI_OUTLINE_SHOW_SIMPLE_TYPE = Show Simple Types Only
-_UI_OUTLINE_SHOW_ATTRIBUTE_GROUP = Show Attribute Groups Only
-_UI_OUTLINE_SHOW_GROUP = Show Groups Only
-_UI_OUTLINE_SHOW_GLOBAL_ELEMENT = Show Global Elements Only
-_UI_OUTLINE_SHOW_REFERENCES = Show Reference Content
-_UI_OUTLINE_SHOW_INHERITED = Show Inherited Content
-
-_UI_ACTION_SET_MULTIPLICITY = Set Multiplicity
-
-!
-! New XML Schema Wizard
-!
-_UI_WIZARD_CREATE_XSD_MODEL_TITLE = Create XML Schema
-
-! NOTE TO TRANSLATOR: Do not translate following line
-_UI_CREATEXSD = createXSD
-_UI_NEW_XML_SCHEMA_TITLE = New XML Schema
-_UI_CREATE_A_NEW_XML_SCHEMA_DESC = Create a new XML schema.
-
-! NOTE TO TRANSLATOR: Do not translate following line
-_UI_NEW_XML_SCHEMA_FILENAME = NewXMLSchema.xsd
-
-!
-! XSD From RDB Schema Wizard
-!
-_UI_WIZARD_CREATE_XSD_FROM_RDB_TITLE = Create XSD from RDB Table
-
-
-!
-! Regular Expression Wizard
-!
-_UI_REGEX_WIZARD_CREATE_BUTTON = Create Regular Expression...
-_UI_TOOLTIP_REGEX_WIZARD_BUTTON = Launch the Regular Expression Wizard
-_UI_REGEX_WIZARD_TITLE = Regular Expression Wizard
-_UI_REGEX_WIZARD_COMPOSITION_PAGE_TITLE = Compose Regular Expression
-_UI_REGEX_WIZARD_COMPOSITION_PAGE_DESCRIPTION = To add a token, specify its contents and occurrence, then click Add.
-_UI_REGEX_WIZARD_INVALID_REGEX_ERROR_PREFIX = The current regular expression is not valid. Reason:
-_UI_REGEX_WIZARD_INVALID_TOKEN_ERROR_PREFIX = The current token is not valid. Reason:
-_UI_REGEX_WIZARD_INVALID_REGEX_ERROR = The current regular expression is not valid.
-_UI_REGEX_WIZARD_INVALID_TOKEN_ERROR = The current token is not valid.
-_UI_REGEX_WIZARD_INVALID_MIN_ERROR_SUFFIX = Invalid minimum range value. The value must be a positive integer less than the maximum value.
-_UI_REGEX_WIZARD_MISSING_MIN_ERROR_SUFFIX = Invalid minimum range value. A minimum range must be specified if a maximum range is specified.
-_UI_REGEX_WIZARD_INVALID_MAX_ERROR_SUFFIX = Invalid maximum range value. The value must be a positive integer greater than the minimum value.
-_UI_REGEX_WIZARD_INVALID_REPEAT_ERROR_SUFFIX = Invalid repeat value. The value must be a positive integer.
-_UI_REGEX_WIZARD_INVALID_SELECTION_ERROR = Nothing is currently selected. Either make a selection or choose a different token.
-_UI_REGEX_WIZARD_TOKEN_LABEL = Token contents:
-_UI_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX_LABEL = Auto escape
-_UI_REGEX_WIZARD_OCCURENCE_LABEL = Occurrence
-! Instructions for translators: The following label is used in a phrase to identify a range of values.
-! For example: 5 to 10.
-! The values are text fields that are initially blank so the user has to enter in values
-! For example: _______ to ________
-_UI_REGEX_WIZARD_TO_LABEL = to
-_UI_REGEX_WIZARD_ADD_BUTTON_LABEL = Add
-_UI_REGEX_WIZARD_CURRENT_REGEX_LABEL = Current regular expression:
-_UI_TOOLTIP_REGEX_WIZARD_TERMS = Content of new token
-_UI_TOOLTIP_REGEX_WIZARD_AUTO_ESCAPE_CHECKBOX = Insert escape characters to match metacharacter literals (e.g. converts \"*\" to \"\\*\")
-_UI_TOOLTIP_REGEX_WIZARD_ADD_BUTTON = Add this token to the regular expression
-_UI_TOOLTIP_REGEX_WIZARD_CURRENT_REGEX = The current regular expression
-_UI_TOOLTIP_REGEX_WIZARD_REPEAT = The number of times that the token must occur.
-_UI_TOOLTIP_REGEX_WIZARD_MIN = The minimum number of times that the token can occur.
-_UI_TOOLTIP_REGEX_WIZARD_MAX = The maximum number of times that the token can occur.
-_UI_TOOLTIP_REGEX_WIZARD_CARET_LABEL = The location where the new token will be inserted.
-_UI_REGEX_WIZARD_TESTING_PAGE_TITLE = Test Regular Expression
-_UI_REGEX_WIZARD_TESTING_PAGE_DESCRIPTION = To test the regular expression, enter sample text that you wish to match. The success of the match will be indicated above.
-_UI_REGEX_WIZARD_REGEX_LABEL = Regular expression:
-_UI_REGEX_WIZARD_SAMPLE_TEXT = Sample text:
-_UI_REGEX_WIZARD_MATCHES = The text matches the regular expression.
-_UI_REGEX_WIZARD_DOES_NOT_MATCH = The text does not match the regular expression.
-_UI_REGEX_WIZARD_TERM_ANY_CHAR = Any character
-_UI_REGEX_WIZARD_TERM_ALPHANUMERIC_CHAR = Alphanumeric character
-_UI_REGEX_WIZARD_TERM_WHITESPACE = Whitespace
-_UI_REGEX_WIZARD_TERM_DIGIT = Digit
-_UI_REGEX_WIZARD_TERM_UPPER = Upper case
-_UI_REGEX_WIZARD_TERM_LOWER = Lower case
-_UI_REGEX_WIZARD_TERM_SELECTION = Current selection
-_UI_REGEX_WIZARD_QUANTIFIER_SINGLE = Just once
-_UI_REGEX_WIZARD_QUANTIFIER_STAR = Zero or more
-_UI_REGEX_WIZARD_QUANTIFIER_PLUS = One or more
-_UI_REGEX_WIZARD_QUANTIFIER_OPTIONAL = Optional
-_UI_REGEX_WIZARD_QUANTIFIER_REPEAT = Repeat
-_UI_REGEX_WIZARD_QUANTIFIER_RANGE = Range
-
-!
-! Select Include File Wizard
-_UI_LABEL_INCLUDE_URL_FILE = Select schema from:
-_UI_RADIO_URL = HTTP
-_UI_RADIO_FILE = Workbench projects
-_UI_WIZARD_INCLUDE_FILE_TITLE = Include Another Schema
-_UI_WIZARD_INCLUDE_FILE_DESC = Select another schema from workbench projects or from HTTP.
-_UI_LABEL_URL = URL:
-_UI_URL_START_WITH = The URL must start with http://
-_UI_SPECIFY_URL = Please specify a URL
-
-!
-! Enumerations Dialog
-_UI_ENUMERATIONS_DIALOG_TITLE = Add Enumerations
-_UI_LABEL_DELIMITER_CHAR = &Delimiter characters:
-_UI_LABEL_PRESERVE_WHITESPACE = &Preserve leading and trailing whitespace
-
-_UI_ACTION_DELETE_ENUMERATION = Delete Enumeration
-
-!
-! Validate Schema
-!
-_UI_DIALOG_XML_SCHEMA_INVALID_TITLE = Validation Failed
-_UI_DIALOG_XML_SCHEMA_VALID_TITLE = Validation Succeeded
-_UI_DIALOG_XML_SCHEMA_VALID_TEXT = The XML schema file is valid.
-_UI_DIALOG_XML_SCHEMA_VALID_WITH_WARNINGS = The XML schema file is valid however warnings have been issued. See the Problems view for the warning messages.
-_UI_DIALOG_XML_SCHEMA_INVALID_TEXT = The XML schema file is not valid. See the Problems view for the error messages.
-
-!
-! Combo-box choices
-!
-! NOTE TO TRANSLATOR: Do not translate following 10 lines
-_UI_COMBO_QUALIFIED = qualified
-_UI_COMBO_UNQUALIFIED = unqualified
-_UI_COMBO_EXTENSION = extension
-_UI_COMBO_RESTRICTION = restriction
-_UI_COMBO_ALL = all
-_UI_COMBO_TRUE = true
-_UI_COMBO_FALSE = false
-_UI_COMBO_LAX = lax
-_UI_COMBO_SKIP = skip
-_UI_COMBO_STRICT = strict
-
-! Generate DTD - pass as title and description for wizard page
-_UI_GENERATE_DTD_TITLE = Generate DTD
-_UI_GENERATE_DTD_DESCRIPTION = Generate a DTD from the selected XML schema file.
-
-! Generate DDL - pass as title and description for wizard page
-_UI_GENERATE_DDL_TITLE = Generate DDL
-_UI_GENERATE_DDL_DESCRIPTION = Generate DDL from the selected XML schema file.
-
-_UI_XML_SCHEMA_VALIDATOR = XML Schema Validator
-
-! Generation from the Schema model - pre-condition check
-_UI_DIALOG_TITLE_GRAMMAR_ERROR = Invalid Grammar
-_UI_DIALOG_INFO_SCHEMA_INVALID = The schema file contains errors. Open it in the XML Schema editor and validate it for details.
-_UI_DIALOG_TITLE_NO_GLOBAL_ELEMENTS = No Global Elements
-_UI_DIALOG_INFO_NO_GLOBAL_ELEMENTS = The selected schema has no global elements. Global elements are required to generate anything from an XML schema.
-
-! Section title for other attributes
-_UI_SECTION_ADVANCED_ATTRIBUTES = Advanced
-
-! For undo action menus
-! Note to Translators: For the following "Change" phrases,
-! maxOccurs, minOccurs, lang, xpath are keywords so please
-! do no translate them. These are for the undo action menus.
-! For example, if the user makes a change in the name of an
-! element, then the undo action would be Undo Element Name Change
-_UI_NAMESPACE_CHANGE = Namespace Change
-_UI_PROCESSCONTENTS_CHANGE = Process Contents Change
-_UI_MAXOCCURS_CHANGE = maxOccurs Change
-_UI_MINOCCURS_CHANGE = minOccurs Change
-_UI_SOURCE_ATTRIBUTE_CHANGE = Source Change
-_UI_COMMENT_CHANGE = Comment Change
-_UI_PREFIX_CHANGE = Prefix Change
-_UI_ATTRIBUTEGROUP_REF_CHANGE = Attribute Group Reference Change
-_UI_ATTRIBUTEGROUP_NAME_CHANGE = Attribute Group Name Change
-_UI_ATTRIBUTE_FIXED_CHANGE = Attribute Fixed Change
-_UI_ATTRIBUTE_DEFAULT_CHANGE = Attribute Default Change
-_UI_ATTRIBUTE_NAME_CHANGE = Attribute Name Change
-_UI_ATTRIBUTE_VALUE_CHANGE = Attribute Value Change
-_UI_ATTRIBUTE_USE_CHANGE = Attribute Use Change
-_UI_ATTRIBUTE_FORM_CHANGE = Attribute Form Change
-_UI_COMPLEXTYPE_NAME_CHANGE = Complex Type Name Change
-_UI_COMPLEXTYPE_ABSTRACT_CHANGE = Complex Type Abstract Change
-_UI_COMPLEXTYPE_MIXED_CHANGE = Complex Type Mixed Change
-_UI_COMPLEXTYPE_BLOCK_CHANGE = Complex Type Block Change
-_UI_COMPLEXTYPE_FINAL_CHANGE = Complex Type Final Change
-_UI_DOCUMENTATION_SOURCE_CHANGE = Documentation Source Change
-_UI_DOCUMENTATION_LANG_CHANGE = Documentation lang Change
-_UI_DOCUMENTATION_COMMENT_CHANGE = Documentation Comment Change
-_UI_ELEMENT_NAME_CHANGE = Element Name Change
-_UI_ELEMENT_VALUE_CHANGE = Element Value Change
-_UI_ELEMENT_TYPE_CHANGE = Element Type Change
-_UI_ENUM_VALUE_CHANGE = Enum Value Change
-_UI_FIELD_XPATH_CHANGE = Field xpath Change
-_UI_GROUP_REF_CHANGE = Group Reference Change
-_UI_GROUP_SCOPE_CHANGE = Content Model Change
-_UI_GROUP_NAME_CHANGE = Group Name Change
-_UI_IMPORT_CHANGE = Import Change
-_UI_KEY_NAME_CHANGE = Key Name Change
-_UI_KEYREF_NAME_CHANGE = Key Reference Name Change
-! Note to translators
-! For the following item, Refer is the keyref attribute to refer to some other key
-_UI_KEYREF_REFER_CHANGE = Key Reference Refer Change
-_UI_NOTATION_NAME_CHANGE = Notation Name Change
-_UI_NOTATION_PUBLIC_CHANGE = Notation Public Change
-_UI_NOTATION_SYSTEM_CHANGE = Notation System Change
-_UI_PATTERN_VALUE_CHANGE = Pattern Value Change
-_UI_SCHEMA_VERSION_CHANGE = Schema Version Change
-_UI_SCHEMA_LANG_CHANGE = Schema lang Change
-_UI_SELECTOR_XPATH_CHANGE = Selector xpath Change
-_UI_TYPE_CHANGE = Type Change
-_UI_DERIVEDBY_CHANGE = Derivation Change
-_UI_FACET_CHANGE = Facet Change
-_UI_SIMPLETYPE_NAME_CHANGE = SimpleType Name Change
-_UI_UNIQUE_NAME_CHANGE = Unique Name Change
-_UI_SCHEMA_ATTRIBUTEFORMDEFAULT_CHANGE = Attribute Form Default Change
-_UI_SCHEMA_ELEMENTFORMDEFAULT_CHANGE = Element Form Default Change
-_UI_SCHEMA_BLOCKDEFAULT_CHANGE = Block Default Change
-_UI_SCHEMA_FINALDEFAULT_CHANGE = Final Default Change
-_UI_ELEMENT_SUBSTITUTIONGROUP_CHANGE = Substitution Group Change
-_UI_ELEMENT_FORM_CHANGE = Form Change
-_UI_ELEMENT_BLOCK_CHANGE = Block Change
-_UI_ELEMENT_FINAL_CHANGE = Final Change
-_UI_ELEMENT_ABSTRACT_CHANGE = Abstract Change
-_UI_ELEMENT_NILLABLE_CHANGE = Nillable Change
-_UI_TARGETNAMESPACE_CHANGE = Target Namespace Change
-
-! Window Headings for Flat View
-_UI_PAGE_HEADING_ANYATTRIBUTE = Any Attribute
-_UI_PAGE_HEADING_ANYELEMENT = Any Element
-_UI_PAGE_HEADING_APPINFO = AppInfo
-_UI_PAGE_HEADING_ATTRIBUTEGROUP_REF = Attribute Group Reference
-_UI_PAGE_HEADING_ATTRIBUTEGROUP = Attribute Group
-_UI_PAGE_HEADING_ATTRIBUTE_REF = Attribute Reference
-_UI_PAGE_HEADING_ATTRIBUTE = Attribute
-_UI_PAGE_HEADING_COMPLEXTYPE = Complex Type
-_UI_PAGE_HEADING_DOCUMENTATION = Documentation
-_UI_PAGE_HEADING_ELEMENT = Element
-_UI_PAGE_HEADING_ELEMENT_REF = Element Reference
-_UI_PAGE_HEADING_ENUM = Enumeration
-_UI_PAGE_HEADING_FIELD = Field
-_UI_PAGE_HEADING_GROUP_REF = Group Reference
-_UI_PAGE_HEADING_CONTENTMODEL = Content Model
-_UI_PAGE_HEADING_GROUP = Group
-_UI_PAGE_HEADING_IMPORT = Import
-_UI_PAGE_HEADING_INCLUDE = Include
-_UI_PAGE_HEADING_KEYREF = Key Reference
-_UI_PAGE_HEADING_KEY = Key
-_UI_PAGE_HEADING_NOTATION = Notation
-_UI_PAGE_HEADING_PATTERN = Pattern
-_UI_PAGE_HEADING_REDEFINE = Redefine
-_UI_PAGE_HEADING_SCHEMA = Schema
-_UI_PAGE_HEADING_SELECTOR = Selector
-_UI_PAGE_HEADING_LIST = List
-_UI_PAGE_HEADING_UNION = Union
-_UI_PAGE_HEADING_SIMPLECONTENT = Simple Content
-_UI_PAGE_HEADING_COMPLEXCONTENT = Complex Content
-_UI_PAGE_HEADING_RESTRICTION = Restriction
-_UI_PAGE_HEADING_EXTENSION = Extension
-_UI_PAGE_HEADING_SIMPLETYPE = Simple Type
-_UI_PAGE_HEADING_UNIQUE = Unique
-_UI_PAGE_HEADING_REFERENCE = reference
-
-!
-! Graph page
-!
-_UI_GRAPH_SIMPLE_TYPES = Simple Types
-_UI_GRAPH_COMPLEX_TYPES = Complex Types
-_UI_GRAPH_GROUPS = Groups
-_UI_GRAPH_GLOBAL_ATTRIBUTES = Global Attributes
-_UI_GRAPH_GLOBAL_ELEMENTS = Global Elements
-_UI_GRAPH_XSDSCHEMA = Schema
-_UI_GRAPH_XSDSCHEMA_NO_NAMESPACE = (no target namespace specified)
-_UI_GRAPH_XSDCOMPLEXTYPEDEFINITION = XSD Complex Type Definition:
-_UI_GRAPH_XSDMODELGROUP = XSD Model Group
-_UI_GRAPH_XSDPARTICLE = XSD Particle
-_UI_GRAPH_VIEW_NOT_AVAILABLE = View is not available for selected object.
-_UI_GRAPH_UNKNOWN_OBJECT = Unknown object
-
-! Additional Categories
-_UI_GRAPH_TYPES = Types
-_UI_GRAPH_ELEMENTS = Elements
-_UI_GRAPH_ATTRIBUTES = Attributes
-_UI_GRAPH_ATTRIBUTE_GROUPS = Attribute Groups
-_UI_GRAPH_NOTATIONS = Notations
-_UI_GRAPH_IDENTITY_CONSTRAINTS = Identity Constraints
-_UI_GRAPH_ANNOTATIONS = Annotations
-_UI_GRAPH_DIRECTIVES = Directives
-
-! For Union MemberTypes Dialog
-_UI_LABEL_SELECT_MEMBERTYPES = Select from the available types and add to the memberTypes list
-_UI_LABEL_MEMBERTYPES_CHANGE = Member Types Change
-_UI_LABEL_MEMBERTYPES_VALUE = Member Types Value:
-_UI_LABEL_MEMBERTYPES = Member types:
-
-_UI_LABEL_VARIETY_CHANGE = Variety Change
-
-_UI_LABEL_FIXEDORDEFAULT_VALUE = Fixed/Default Value
-
-_UI_LABEL_ITEM_TYPE_CHANGE = Item Type Change
-
-_UI_LABEL_AVAILABLE_TYPES = Available Types
-
-_UI_LABEL_INCLUDE_CHANGE = Include Change
-
-_UI_LABEL_ITEM_TYPE = Item type:
-_UI_LABEL_BASE_TYPE = Base Type
-_UI_LABEL_TYPE = Type
-_UI_LABEL_MODEL_GROUP = Model Group
-
-_UI_LABEL_ABSENT = absent
-
-_UI_WARNING_RESET_ATTRGRP_REF = Reset attribute group reference <{0}>
-_UI_WARNING_REMOVE_ATTRGRP_REF = Remove attribute group reference <{0}>
-_UI_WARNING_RESET_ATTR_REF = Reset attribute reference <{0}>
-_UI_WARNING_REMOVE_ATTR_REF = Remove attribute reference <{0}>
-
-!======================================================================================
-!
-! Here is the list of Error string that have message IDs - make sure they are unique
-
-!
-!======================================================================================
-! These three errors appear in the select include wizard
-! The name of the file will be substituted in
-_UI_DIFFERENT_NAME_SPACE = {0} is in a different namespace
-_UI_SAME_NAME_SPACE = {0} is in the same namespace
-_UI_INCORRECT_XML_SCHEMA = {0} is an invalid XML schema file
-
-_ERROR_SCHEMA_NOT_EXIST = Does not exist.
-_ERROR_LABEL_INVALID_PREFIX = Invalid prefix. A prefix must not be empty or contain any space.
-
-! The name of the file will be substituted in
-_ERROR_SCHEMA_NAME_THE_SAME = {0} is the current schema. A schema cannot include itself. Reset to the last valid schema.
-
-_ERROR_XSD_GENERATION = Error generating XML schema
-_ERROR_NO_CONTAINER = No folder selected
-_ERROR_NO_FILE_NAME = No file name provided
-_ERROR_FILENAME_MUST_END_XSD = The file name must end in .xsd
-
-
-!
-! For schema that has too many errors, an extended message.
-!
-_ERROR_DIALOG_XML_SCHEMA_INVALID_TEXT = The XML schema file is not valid.
-_ERROR_MORE_ERRORS = There are more errors in the schema than are displayed in the Tasks view. Correct the first {0} errors and re-validate the schema file.
-
-! DDL Generation Failed Dialog
-_UI_DIALOG_DDL_GEN_FAILED_TITLE = DDL Generation Failed
-_ERROR_DIALOG_DDL_NOT_GENEREATED = DDL has not been generated
-_UI_DIALOG_DDL_GEN_FAILED_REASON = The selected schema has no global elements
-_UI_DIALOG_DDL_GEN_FAILED_REASON2 = None of the global elements in the schema have a complex type or they reference complex types that cannot be found.
-
-_EXC_OPEN_XSD = Cannot open XML Schema editor
-
-_ERROR_LABEL_PREFIX_EXISTS = Prefix already exists
-
-_ERROR_REMOVE_LOCAL_SIMPLETYPE = Remove local simple type from extension
-
-_WARN_INVALID_TARGET_NAMESPACE = The target namespace is not well-formed
-
-_ERROR_TARGET_NAMESPACE_AND_PREFIX = A target namespace must be associated with a prefix
-
-
-_UI_CONTAINMENT = Containment
-_UI_INHERITANCE = Inheritance
-_UI_SUBSTITUTION_GROUPS = Substitution Groups
-_UI_ANONYMOUS = **anonymous**
-_UI_VALUE = Value
-_UI_ANY_ELEMENT = Any Element
-_UI_SORT = Sort
-
-_UI_ACTION_EDIT_NAMESPACES = Edit Namespaces...
-
-
-_UI_CreateChild_text = {0}
-_UI_CreateChild_text2 = {1} {0}
-_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
-_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
-_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
-
-!======================================================================================
-!
-! Used by org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView
-!
-!======================================================================================
-_UI_LABEL_SOURCE_FILES = Workbench Files
-_UI_LABEL_SELECTED_FILES = Selected Files
-
-_UI_IMPORT_BUTTON = Import Files...
-_UI_IMPORT_BUTTON_TOOL_TIP = Import files from file system
-
-
-!======================================================================================
-!
-! refactoring
-!
-!======================================================================================
-refactoringActionSet.label=Refactor
-refactoringActionSet.description=XSD Editor refactoring actions
-refactoring.menu.label=Refactor
-refactoring.renameAction.label=Re&name...
-context.text.editor.xsd.name=Editing XSD context
-command.xsd.refactor.rename.element.name=Rename XSD element
-command.xsd.refactor.rename.element.description=Rename XSD element
-command.xsd.refactor.makeElementGlobal.element.name=Make local element global
-command.xsd.refactor.makeElementGlobal.element.description=Promotes local element to global level and replaces its references
-command.xsd.refactor.makeTypeGlobal.element.name=Make anonymous type global
-command.xsd.refactor.makeTypeGlobal.element.description=Promotes anonymous type to global level and replaces its references
-command.xsd.refactor.renameTargetNamespace.name=Rename Target Namespace
-command.xsd.refactor.renameTargetNamespace.description=Changes the target namespace of the schema
-xsd.resource.rename.participant.name=Rename XSD Component
-ExtensionsSchemasDescription=This extension point is deprecated, use extensionCategories
-ExtensionCategoriesDescription=Extension point for contributing to the 'built in' categories of extension elements for XML Schema
-XSDEditorExtensionConfiguration=This extension point is deprecated, use internalEditorConfiguration
-InternalEditorConfiguration=Extension point for extending the XML Schema Editor
-
-! Copied from sse
-23concat_EXC_=Resource {0} does not exist.
-32concat_EXC_=Editor could not be open on {0}
-An_error_has_occurred_when1_ERROR_=An error has occurred when initializing the input for the the editor's source page.
-OpenFileFromSource.label=Op&en Selection
-OpenFileFromSource.tooltip=Open an editor on the selected link
-OpenFileFromSource.image=
-OpenFileFromSource.description=Open an editor on the selected link
-
-AddBookmark.label=Add Boo&kmark...
-SelectRuler.label=Select Ruler
-
-_ZERO_OR_MORE = Zero or More
-_ZERO_OR_ONE = Zero or One
-_ONE_OR_MORE = One or More
-
-# For translators, as in structured DOM tree
-_UI_LABEL_STRUCTURED = Structured
-
-_UI_LABEL_MOVE = Move
-_UI_LABEL_RENAME = Rename
-_UI_LABEL_TARGETNAMESPACE_CHANGE = Target Namespace Change
-_INFO_RESET_ATTRIBUTE_GROUP_REFERENCE = Reset attribute group reference
-_INFO_REMOVE_ATTRIBUTE_GROUP_REFERENCE = Remove attribute group reference
-
-Bundle-Vendor.0 = Eclipse.org
-search.declarations.label = Declarations
-search.references.label = References
-
-! extension points
-ExtensionNodeCustomizationsDescription = Extension Node Customizations
-XMLSchemaEditorModes = XML Schema Editor Modes \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java
deleted file mode 100644
index c7eec1f3c2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import java.util.Iterator;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.ColumnData;
-
-public class BoxFigure extends Figure
-{
- protected ColumnData columnData = new ColumnData();
- public HeadingFigure headingFigure;
- Figure contentPane;
-
- public boolean isSelected = false;
-
- public BoxFigure()
- {
- super();
- headingFigure = new HeadingFigure();
- add(headingFigure);
-
- contentPane = new Figure()
- {
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- boolean isFirst = false;
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- Figure figure = (Figure) i.next();
- if (isFirst)
- {
- isFirst = false;
- }
- else
- {
- Rectangle r = figure.getBounds();
- graphics.drawLine(r.x, r.y + 1, r.x + r.width, r.y + 1);
- }
- }
- }
- };
- contentPane.setLayoutManager(new ToolbarLayout());
- add(contentPane);
- headingFigure.setForegroundColor(ColorConstants.black);
- }
-
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- /*
- // Fill for the header section
- //
- Rectangle r = getBounds().getCopy();
- graphics.setBackgroundColor(ColorConstants.darkGray);
- Color gradient1 = ColorConstants.lightGray;
- if (isSelected)
- {
- gradient1 = ColorConstants.lightBlue;
- }
- Color gradient2 = ColorConstants.white;
- graphics.setForegroundColor(gradient1);
- graphics.setBackgroundColor(gradient2);
- graphics.fillGradient(r.x + 1, r.y + 1, r.width - 2, nodeNameLabel.getBounds().height - 1, true);
- nodeNameLabel.paint(graphics);
- */
- }
-
- public IFigure getContentPane()
- {
- return contentPane;
- }
-
- public Label getNameLabel()
- {
- return headingFigure.getLabel();
- }
-
- public HeadingFigure getHeadingFigure()
- {
- return headingFigure;
- }
-
- public ColumnData getColumnData()
- {
- return columnData;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/CompartmentFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/CompartmentFigure.java
deleted file mode 100644
index a019ada90e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/CompartmentFigure.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewerGraphicConstants;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.ICompartmentFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.RowLayout;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-
-public class CompartmentFigure extends Figure implements ICompartmentFigure
-{
- public Label nodeNameLabel;
- protected Figure contentPane;
- protected Figure annotationArea;
- public Figure rowFigure;
-
- public CompartmentFigure()
- {
- super();
-
- rowFigure = new Figure();
- add(rowFigure);
-
- annotationArea = new Figure() {
-
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- try
- {
- graphics.pushState();
- graphics.setForegroundColor(ColorConstants.blue);
- graphics.setFont(DesignViewerGraphicConstants.smallFont);
- List children = getChildren();
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- Figure object = (Figure)i.next();
- traverse(object, graphics);
- }
- }
- finally
- {
- graphics.popState();
- }
- }
-
- private void traverse(Figure figure, Graphics graphics)
- {
- List children = figure.getChildren();
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- Figure object = (Figure)i.next();
-
- if (object instanceof GenericGroupFigure)
- {
- GenericGroupFigure fig = (GenericGroupFigure) object;
- if (fig.hasText())
- graphics.drawText(fig.getText(), fig.getTextCoordinates());
- }
- traverse(object, graphics);
- }
-
- }
-
- };
- ToolbarLayout annotationLayout = new ToolbarLayout(false);
- annotationLayout.setStretchMinorAxis(true);
- annotationArea.setLayoutManager(annotationLayout);
-
- // Need this to show content model structure on the left side of the figure
- rowFigure.add(annotationArea);
-
- contentPane = new Figure()
- {
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
- graphics.pushState();
- try
- {
- boolean isFirst = true;
- Color oldColor = graphics.getForegroundColor();
- graphics.setForegroundColor(ColorConstants.lightGray);
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- Figure figure = (Figure) i.next();
- Rectangle r = figure.getBounds();
-// if (figure instanceof FieldFigure)
-// {
-// Rectangle rChild = ((FieldFigure)figure).getNameFigure().getBounds();
-// graphics.drawLine(rChild.right(), rChild.y, rChild.right(), rChild.bottom());
-// graphics.setForegroundColor(ColorConstants.darkGray);
-// }
- if (isFirst)
- {
- isFirst = false;
-// graphics.drawLine(r.x, r.y, r.x, r.y + r.height);
- }
- else
- {
- graphics.setForegroundColor(ColorConstants.white);
- graphics.setBackgroundColor(ColorConstants.lightGray);
- graphics.fillGradient(r.x, r.y, r.width, 1, false);
-// graphics.drawLine(r.x, r.y, r.x + r.width, r.y);
-// graphics.drawLine(r.x, r.y, r.x, r.y + r.height);
- }
- }
- graphics.setForegroundColor(oldColor);
- }
- finally
- {
- graphics.popState();
- }
- }
- };
- contentPane.setLayoutManager(new ToolbarLayout());
- rowFigure.add(contentPane);
-
- RowLayout rowLayout = new RowLayout();
- rowFigure.setLayoutManager(rowLayout);
- rowLayout.setConstraint(annotationArea, "annotation");
- rowLayout.setConstraint(contentPane, "contentPane");
- }
-
- public IFigure getContentPane()
- {
- return contentPane;
- }
-
- public IFigure getAnnotationPane()
- {
- return annotationArea;
- }
-
- public void editPartAttached(EditPart owner)
- {
- StructureEditPart structureEditPart = null;
- for (EditPart parent = owner.getParent(); parent != null; parent = parent.getParent())
- {
- if (parent instanceof StructureEditPart)
- {
- structureEditPart = (StructureEditPart) parent;
- break;
- }
- }
- RowLayout rowLayout = (RowLayout)rowFigure.getLayoutManager();
- IStructureFigure typeFigure = structureEditPart.getStructureFigure();
- Assert.isTrue(typeFigure instanceof StructureFigure, "Expected object of type StructureFigure");
- rowLayout.setColumnData(((StructureFigure)typeFigure).getColumnData());
- }
-
- public void addSelectionFeedback()
- {
- }
-
- public void removeSelectionFeedback()
- {
- }
-
- public void refreshVisuals(Object model)
- {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java
deleted file mode 100644
index 6141bef3e3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.EditPart;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.StructureEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.layouts.RowLayout;
-
-public class FieldFigure extends Figure implements IFieldFigure
-{
- // TODO: put this color is some common class
- public static final Color cellColor = new Color(null, 224, 233, 246);
-
- // Formatting constraints
- public static final int TOP_MARGIN = 2; // pixels
- public static final int BOTTOM_MARGIN = TOP_MARGIN + 1; // extra pixel for the
- // footer line
- public static final int LEFT_MARGIN = 2;
- public static final int RIGHT_MARGIN = LEFT_MARGIN;
- public static final int RIGHT_SIDE_PADDING = 6;
-
- // States requiring decorators, and their icons
- // protected static final Image errorIcon = ICON_ERROR;
-
- // Labels which handle presentation of name and type
- public Figure rowFigure;
- protected Label nameLabel;
- protected Label nameAnnotationLabel; // for occurrence text, or error icons
- protected Label typeLabel;
- protected Label typeAnnotationLabel; // for occurrence text, or error icons
- protected Label toolTipLabel;
-
- public FieldFigure()
- {
- super();
- setLayoutManager(new ToolbarLayout());
-// setOpaque(true);
- rowFigure = new Figure();
-// rowFigure.setOpaque(true);
- RowLayout rowLayout = new RowLayout();
- rowFigure.setLayoutManager(rowLayout);
-
- add(rowFigure);
-
- nameLabel = new Label();
- nameLabel.setBorder(new MarginBorder(3, 5, 3, 5));
- nameLabel.setLabelAlignment(PositionConstants.LEFT);
- nameLabel.setOpaque(true);
- rowFigure.add(nameLabel);
-
- nameAnnotationLabel = new Label();
- nameAnnotationLabel.setBorder(new MarginBorder(3, 5, 3, 5));
- nameAnnotationLabel.setLabelAlignment(PositionConstants.LEFT);
- nameAnnotationLabel.setOpaque(true);
- rowFigure.add(nameAnnotationLabel);
-
- toolTipLabel = new Label();
-// Don't show tooltip for now. Annoying vertical line shows up. Safe fix.
-// nameLabel.setToolTip(toolTipLabel);
- typeLabel = new Label();
-
- // cs : we need to add some additional padding to the right
- // so that when we edit the field there's room for the combobox's arrow
- // and the type name won't be partially obscured
- //
- typeLabel.setBorder(new MarginBorder(3, 5, 3, 20));
- typeLabel.setLabelAlignment(PositionConstants.LEFT);
- typeLabel.setOpaque(true);
- rowFigure.add(typeLabel);
-
- typeAnnotationLabel = new Label() {
-
- public Dimension getPreferredSize(int wHint, int hHint)
- {
- if (getText() == null || getText().equals(""))
- {
- return new Dimension(0, 0);
- }
- return super.getPreferredSize(wHint, hHint);
- }
- };
- typeAnnotationLabel.setBorder(new MarginBorder(3, 5, 3, 5));
- typeAnnotationLabel.setLabelAlignment(PositionConstants.LEFT);
- typeAnnotationLabel.setOpaque(true);
- rowFigure.add(typeAnnotationLabel);
-// Don't show tooltip for now. Annoying vertical line shows up. Safe fix.
-// typeAnnotationLabel.setToolTip(toolTipLabel);
-
- rowLayout.setConstraint(nameLabel, "name");
- rowLayout.setConstraint(nameAnnotationLabel, "nameAnnotation");
- rowLayout.setConstraint(typeLabel, "type");
- rowLayout.setConstraint(typeAnnotationLabel, "typeAnnotation");
- }
-
- /**
- * @return Returns the "name" string used by this figure.
- */
- public String getName()
- {
- return nameLabel.getText();
- }
-
- /**
- * @return Returns the figure representing the attribute name
- */
- public Label getNameLabel()
- {
- return nameLabel;
- }
-
- /**
- * @return Returns the "type" string used by this figure.
- */
- public String getType()
- {
- return typeLabel.getText();
- }
-
- /**
- * @return Returns the figure representing the attribute's type
- */
- public Label getTypeLabel()
- {
- return typeLabel;
- }
-
- /**
- * @param name
- * Set the "name" string used by this figure.
- */
- public void setName(String name)
- {
- nameLabel.setText(name);
- }
-
- /**
- * @param type
- * Set the "type" string used by this figure.
- */
- public void setType(String type)
- {
- typeLabel.setText(type);
- }
-
- public void setTypeToolTipText(String toolTip)
- {
- setNameToolTipText(toolTip);
- }
-
- public void setNameToolTipText(String toolTip)
- {
- if (toolTip.length() > 0)
- {
- nameLabel.setToolTip(toolTipLabel);
- toolTipLabel.setText(toolTip);
- }
- else
- {
- nameLabel.setToolTip(null);
- }
- }
-
- public void setNameAnnotationLabel(String text)
- {
- nameAnnotationLabel.setText(text);
- }
-
- public void setNameAnnotationLabelIcon(Image icon)
- {
- nameAnnotationLabel.setIcon(icon);
- }
-
- public Label getNameAnnotationLabel()
- {
- return nameAnnotationLabel;
- }
-
- public void setTypeAnnotationLabel(String text)
- {
- typeAnnotationLabel.setText(text);
- }
-
- public void setTypeAnnotationLabelIcon(Image icon)
- {
- typeAnnotationLabel.setIcon(icon);
- }
-
- public Label getTypeAnnotationLabel()
- {
- return typeAnnotationLabel;
- }
-
- public void recomputeLayout()
- {
- RowLayout layout = (RowLayout)rowFigure.getLayoutManager();
- if (layout != null && layout.getColumnData() != null)
- {
- layout.getColumnData().clearColumnWidths();
- }
- }
-
- public void editPartAttached(EditPart owner)
- {
- StructureEditPart structureEditPart = null;
- for (EditPart parent = owner.getParent(); parent != null; parent = parent.getParent())
- {
- if (parent instanceof StructureEditPart)
- {
- structureEditPart = (StructureEditPart) parent;
- break;
- }
- }
- RowLayout rowLayout = (RowLayout)rowFigure.getLayoutManager();
- IStructureFigure typeFigure = structureEditPart.getStructureFigure();
- Assert.isTrue(typeFigure instanceof StructureFigure, "Expected object of type StructureFigure");
- rowLayout.setColumnData(((StructureFigure)typeFigure).getColumnData());
- }
-
- public void addSelectionFeedback()
- {
- rowFigure.setBackgroundColor(cellColor);
- }
-
- public void removeSelectionFeedback()
- {
- rowFigure.setBackgroundColor(getBackgroundColor());
- }
-
- public void refreshVisuals(Object model)
- {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/HeadingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/HeadingFigure.java
deleted file mode 100644
index 6c275d68b3..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/HeadingFigure.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Color;
-
-public class HeadingFigure extends Figure
-{
- public static final Color headerColor = new Color(null, 224, 233, 246);
- Label label;
- Color[] gradientColor = {ColorConstants.white,
- ColorConstants.lightGray,
- ColorConstants.lightBlue,
- ColorConstants.gray};
- boolean isSelected = false;
- boolean isReadOnly = false;
-
- public HeadingFigure()
- {
- label = new Label();
- label.setBorder(new MarginBorder(2));
- ToolbarLayout toolbarLayout = new ToolbarLayout(false);
- toolbarLayout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
- setLayoutManager(toolbarLayout);
- add(label);
- }
-
- public void setGradientColors(Color[] colors)
- {
- this.gradientColor = colors;
- }
-
- public void setSelected(boolean isSelected)
- {
- this.isSelected = isSelected;
- }
-
- public void setIsReadOnly(boolean isReadOnly)
- {
- this.isReadOnly = isReadOnly;
- }
-
- public void paint(Graphics graphics)
- {
- super.paint(graphics);
-
- graphics.pushState();
- try
- {
- // Fill for the header section
- //
- Rectangle r = getBounds().getCopy();
- graphics.setBackgroundColor(ColorConstants.lightGray);
-
- Color gradient1 = isReadOnly ? gradientColor[1] : headerColor;
- if (isSelected && isReadOnly) gradient1 = gradientColor[3];
- else if (isSelected && !isReadOnly) gradient1 = gradientColor[2];
- Color gradient2 = gradientColor[0];
- graphics.setForegroundColor(gradient1);
- graphics.setBackgroundColor(gradient2);
- Rectangle labelBounds = label.getBounds();
- graphics.fillGradient(r.x+1, r.y+1, r.width-2, labelBounds.height - 2, true);
- graphics.setForegroundColor(ColorConstants.darkGray);
- label.paint(graphics);
- }
- finally
- {
- graphics.popState();
- }
- }
-
- public Label getLabel()
- {
- return label;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/RoundedLineBorder.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/RoundedLineBorder.java
deleted file mode 100644
index 93e80f1bee..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/RoundedLineBorder.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.swt.graphics.Color;
-
-public class RoundedLineBorder extends LineBorder
-{
- protected int arcLength;
- protected int lineStyle = Graphics.LINE_SOLID;
-
- public RoundedLineBorder(Color c, int width, int arcLength)
- {
- super(c, width);
- this.arcLength = arcLength;
- }
-
- public RoundedLineBorder(int width, int arcLength)
- {
- super(width);
- this.arcLength = arcLength;
- }
-
- public RoundedLineBorder(Color c, int width, int arcLength, int lineStyle)
- {
- super(c, width);
- this.arcLength = arcLength;
- this.lineStyle = lineStyle;
- }
-
- public RoundedLineBorder(int width, int arcLength, int lineStyle)
- {
- super(width);
- this.arcLength = arcLength;
- this.lineStyle = lineStyle;
- }
-
- public void paint(IFigure figure, Graphics graphics, Insets insets)
- {
- int rlbWidth = getWidth();
- tempRect.setBounds(getPaintRectangle(figure, insets));
- if (rlbWidth%2 == 1)
- {
- tempRect.width--;
- tempRect.height--;
- }
- tempRect.shrink(rlbWidth/2,rlbWidth/2);
- graphics.setLineWidth(rlbWidth);
- graphics.setLineStyle(lineStyle);
- if (getColor() != null)
- graphics.setForegroundColor(getColor());
- graphics.drawRoundRectangle(tempRect, arcLength, arcLength);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/StructureFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/StructureFigure.java
deleted file mode 100644
index 990f64b8ea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/StructureFigure.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-
-
-public class StructureFigure extends BoxFigure implements IStructureFigure
-{
- public void editPartAttached(EditPart owner)
- {
- // nothing to do here :-)
- }
-
- public void addSelectionFeedback()
- {
- LineBorder boxFigureLineBorder = (LineBorder)getBorder();
- boxFigureLineBorder.setWidth(2);
- // TODO (cs) need to fix this
- //boxFigureLineBorder.setColor(getComplexType().isReadOnly() ? ColorConstants.darkGray : ColorConstants.darkBlue);
- getHeadingFigure().setSelected(true);
- repaint();
- }
-
- public void removeSelectionFeedback()
- {
- LineBorder boxFigureLineBorder = (LineBorder)getBorder();
- boxFigureLineBorder.setWidth(1);
- getHeadingFigure().setSelected(false);
- repaint();
- }
-
- public boolean hitTestHeader(Point location)
- {
- IFigure target = getHeadingFigure();
- Rectangle b = target.getBounds().getCopy();
- target.translateToAbsolute(b);
- return b.contains(location);
- }
-
- public void refreshVisuals(Object model)
- {
- IStructure structure = (IStructure)model;
- getNameLabel().setText(structure.getName());
- getHeadingFigure().setIsReadOnly(structure.isReadOnly());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/TypeVizFigureFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/TypeVizFigureFactory.java
deleted file mode 100644
index 08260fb34f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/TypeVizFigureFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.typeviz.design.figures;
-
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.ICompartmentFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IModelGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.design.figures.ModelGroupFigure;
-
-public class TypeVizFigureFactory implements IExtendedFigureFactory
-{
- public IStructureFigure createStructureFigure(Object model)
- {
- StructureFigure figure = new StructureFigure();
- figure.setBorder(new LineBorder(1));
- ToolbarLayout toolbarLayout = new ToolbarLayout();
- toolbarLayout.setStretchMinorAxis(true);
- figure.setLayoutManager(toolbarLayout);
-
- if (model instanceof ITreeElement)
- {
- figure.getNameLabel().setIcon(((ITreeElement)model).getImage());
- }
- //figure.getHeadingFigure().setIsReadOnly(getComplexType().isReadOnly());
- // we should organize ITreeElement and integrate it with the facade
- return figure;
- }
-
- public IFieldFigure createFieldFigure(Object model)
- {
- // TODO Auto-generated method stub
- return new FieldFigure();
- }
-
- public ICompartmentFigure createCompartmentFigure(Object model)
- {
- CompartmentFigure figure = new CompartmentFigure();
- figure.setBorder(new MarginBorder(1));
- ToolbarLayout toolbarLayout = new ToolbarLayout(false);
- toolbarLayout.setStretchMinorAxis(true);
- figure.setLayoutManager(toolbarLayout);
- return figure;
- }
-
- public IModelGroupFigure createModelGroupFigure(Object model)
- {
- // TODO Auto-generated method stub
- return new ModelGroupFigure();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/ColumnData.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/ColumnData.java
deleted file mode 100644
index 58e9dab1ee..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/ColumnData.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.typeviz.design.layouts;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-public class ColumnData
-{
- HashMap map = new HashMap();
-
- class Entry
- {
- int width = 0;
- int weight = 1;
- }
-
- public void clearColumnWidths()
- {
- for (Iterator i = map.values().iterator(); i.hasNext();)
- {
- Entry entry = (Entry)i.next();
- entry.width = 0;
- }
- }
-
- private Entry lookupOrCreateColumnEntry(String identifier)
- {
- Entry entry = (Entry)map.get(identifier);
- if (entry == null)
- {
- entry = new Entry();
- map.put(identifier, entry);
- }
- return entry;
- }
-
- void stretchColumnWidthIfNeeded(String identifier, int width)
- {
- Entry entry = lookupOrCreateColumnEntry(identifier);
- entry.width = Math.max(entry.width, width);
- }
-
- int getColumnWidth(String identifier)
- {
- Entry entry = (Entry)map.get(identifier);
- if (entry != null)
- {
- return entry.width;
- }
- else
- {
- return 0;//hmm should we return -1 ?
- }
- }
-
- int getColumnWeight(String identifier)
- {
- Entry entry = (Entry)map.get(identifier);
- if (entry != null)
- {
- return entry.weight;
- }
- else
- {
- return 0;
- }
- }
-
- public void setColumnWeight(String identifier, int weight)
- {
- Entry entry = lookupOrCreateColumnEntry(identifier);
- entry.weight = weight;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/RowLayout.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/RowLayout.java
deleted file mode 100644
index fc9067779f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/RowLayout.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.typeviz.design.layouts;
-
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-public class RowLayout extends AbstractLayout
-{
- // layout is associated with a parent context
- // any layout manager under the parent context is connected
- // column rows are maintained accross container boundaries
- protected ColumnData columnData;
- protected HashMap figureToContstraintMap = new HashMap();
-
- public RowLayout()
- {
- super();
- }
-
-
- // this method computes the minimum size required to display the figures
- //
- private Dimension calculateChildrenSize(IFigure container, List children, int wHint, int hHint, boolean preferred)
- {
- Dimension childSize;
- IFigure child;
- int height = 0;
- int width = 0;
-
- //IRowFigure figure = (IRowFigure)container;
-
- // for each cell in the row
- //
- for (int i = 0; i < children.size(); i++)
- {
- child = (IFigure) children.get(i);
- String columnIdenifier = (String)getConstraint(child);
-
- // first we compute the child size without regard for columnData
- //
- childSize = child.getPreferredSize(wHint, hHint);// : child.getMinimumSize(wHint, hHint);
-
- // now that the columnData has been populated we can consider if the row needs to be larger
- //
- int effectiveWidth = childSize.width;
- if (columnIdenifier != null)
- {
- columnData.stretchColumnWidthIfNeeded(columnIdenifier, childSize.width);
- effectiveWidth = columnData.getColumnWidth(columnIdenifier);
- }
- height = Math.max(childSize.height, height);
- width += effectiveWidth;
- }
- return new Dimension(width, height);
- }
-
-
-
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
- {
- List children = container.getChildren();
- Dimension prefSize = calculateChildrenSize(container, children, wHint, hHint, true);
- return prefSize;
- }
-
- public void layout(IFigure parent)
- {
- // layout a table with the columns aligned
- //IRowFigure rowFigure = (IRowFigure)parent;
- Rectangle clientArea = parent.getClientArea();
- List children = parent.getChildren();
- Rectangle r = new Rectangle();
- r.x = clientArea.x;
- r.y = clientArea.y;
- r.height = clientArea.height;
-
- int childrenSize = children.size();
- Rectangle[] bounds = new Rectangle[childrenSize];
-
- // for each cell in the row
- //
- int requiredWidth = 0;
- int totalColumnWeight = 0;
- for (int i = 0; i < childrenSize; i++)
- {
- IFigure child = (IFigure) children.get(i);
- //String columnIdenifier = figure.getColumnIdentifier(child);
- // first we compute the child size without regard for columnData
- //
- Dimension childSize = child.getPreferredSize(-1, -1);
-
- int columnWidth = -1;
- //String columnIdentifier = rowFigure.getColumnIdentifier(child);
- String columnIdentifier = (String)getConstraint(child);
- if (columnIdentifier != null)
- {
- //columnData.stretchColumnWidthIfNeeded(columnIdentifier, childSize.width);
- columnWidth = columnData.getColumnWidth(columnIdentifier);
- totalColumnWeight += columnData.getColumnWeight(columnIdentifier);
- }
- r.width = Math.max(childSize.width, columnWidth);
- requiredWidth += r.width;
- bounds[i] = new Rectangle(r);
- r.x += r.width;
- }
- if (totalColumnWeight < 1)
- {
- totalColumnWeight = 1;
- }
- int extraWidth = Math.max(clientArea.width - requiredWidth, 0);
- int extraWidthAllocated = 0;
- for (int i = 0; i < childrenSize; i++)
- {
- IFigure child = (IFigure) children.get(i);
- Rectangle b = bounds[i];
- if (extraWidth > 0)
- {
- String columnIdentifier = (String)getConstraint(child);
- if (columnIdentifier != null)
- {
- int weight = columnData.getColumnWeight(columnIdentifier);
- float fraction = (float)weight / (float)totalColumnWeight;
- int extraWidthForChild = (int)(extraWidth * fraction);
-
- b.width += extraWidthForChild;
- b.x += extraWidthAllocated;
- extraWidthAllocated += extraWidthForChild;
- }
- else
- {
- b.x += extraWidthAllocated;
- }
- }
- child.setBounds(new Rectangle(b));
- }
- }
-
- public ColumnData getColumnData()
- {
- return columnData;
- }
-
- public void setColumnData(ColumnData columnData)
- {
- this.columnData = columnData;
- }
-
- public Object getConstraint(IFigure child)
- {
- return figureToContstraintMap.get(child);
- }
-
- public void setConstraint(IFigure child, Object constraint)
- {
- figureToContstraintMap.put(child, constraint);
- }
-
- public void invalidate()
- {
- //figureToContstraintMap.clear();
- //this.columnData.clearColumnWidths();
- super.invalidate();
-
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java
deleted file mode 100644
index b54c609341..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.actions;
-import java.util.List;
-
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-// issue (cs) can we remove this?
-//
-public class CreateElementAction extends Action
-{
- protected String description;
- protected Element parentNode;
-
- protected ISelectionProvider selectionProvider;
- protected XSDSchema xsdSchema;
-
- protected Object sourceContext;
-
- /**
- * Constructor for CreateElementAction.
- */
- public CreateElementAction()
- {
- super();
- }
- /**
- * Constructor for CreateElementAction.
- * @param text
- */
- public CreateElementAction(String text)
- {
- super(text);
- }
- /**
- * Constructor for CreateElementAction.
- * @param text
- * @param image
- */
- public CreateElementAction(String text, ImageDescriptor image)
- {
- super(text, image);
- }
-
- public void setXSDSchema(XSDSchema xsdSchema)
- {
- this.xsdSchema = xsdSchema;
- }
-
- public void setSelectionProvider(ISelectionProvider selectionProvider)
- {
- this.selectionProvider = selectionProvider;
- }
-
- public void setSourceContext(Object sourceContext)
- {
- this.sourceContext = sourceContext;
- }
-
- /**
- * Gets the parentNode.
- * @return Returns a Element
- */
- public Element getParentNode()
- {
- return parentNode;
- }
-
- /**
- * Sets the parentNode.
- * @param parentNode The parentNode to set
- */
- public void setParentNode(Element parentNode)
- {
- this.parentNode = parentNode;
- }
-
- boolean isGlobal = false;
-
- public void setIsGlobal(boolean isGlobal)
- {
- this.isGlobal = isGlobal;
- }
-
- public boolean getIsGlobal()
- {
- return isGlobal;
- }
-
- protected Node relativeNode;
- protected String elementTag;
- public void setElementTag(String elementTag)
- {
- this.elementTag = elementTag;
- }
-
- public DocumentImpl getDocument()
- {
- return (DocumentImpl) getParentNode().getOwnerDocument();
- }
-
- public void beginRecording(String description)
- {
- getDocument().getModel().beginRecording(this, description);
- }
-
- public void endRecording()
- {
- DocumentImpl doc = getDocument();
-
- doc.getModel().endRecording(this);
- }
-
- public Element createAndAddNewChildElement()
- {
- String prefix = parentNode.getPrefix();
- prefix = (prefix == null) ? "" : (prefix + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- Element childNode = getDocument().createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + elementTag);
- if (getAttributes() != null)
- {
- List attributes = getAttributes();
- for (int i = 0; i < attributes.size(); i++)
- {
- DOMAttribute attr = (DOMAttribute) attributes.get(i);
- childNode.setAttribute(attr.getName(), attr.getValue());
- }
- }
- if (getRelativeNode() == null)
- {
- parentNode.appendChild(childNode);
- }
- else
- {
- parentNode.insertBefore(childNode,getRelativeNode());
- }
-
- if (isGlobal && getRelativeNode() == null)
- {
- Text textNode = getDocument().createTextNode("\n\n"); //$NON-NLS-1$
- parentNode.appendChild(textNode);
- }
- else if (isGlobal && getRelativeNode() != null)
- {
- Text textNode = getDocument().createTextNode("\n\n"); //$NON-NLS-1$
- parentNode.insertBefore(textNode, getRelativeNode());
- }
-
- formatChild(childNode);
-
- return childNode;
- }
-
- protected void formatChild(Element child)
- {
- if (child instanceof IDOMNode)
- {
- IDOMModel model = ((IDOMNode)child).getModel();
- try
- {
- // tell the model that we are about to make a big model change
- model.aboutToChangeModel();
-
- IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
- formatProcessor.formatNode(child);
- }
- finally
- {
- // tell the model that we are done with the big model change
- model.changedModel();
- }
- }
- }
- /*
- * @see IAction#run()
- */
- public void run()
- {
- beginRecording(getDescription());
- final Element child = createAndAddNewChildElement();
- endRecording();
-
- if (selectionProvider != null)
- {
- final XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(child);
-// selectionProvider.setSelection(new StructuredSelection(comp));
-
- Runnable runnable = new Runnable()
- {
- public void run()
- {
- if (comp instanceof XSDAttributeDeclaration)
- {
- if (((XSDAttributeDeclaration)comp).getContainer() instanceof XSDAttributeUse)
- {
- if (comp.getContainer().getContainer() instanceof XSDAttributeGroupDefinition)
- {
- selectionProvider.setSelection(new StructuredSelection(comp.getContainer()));
- }
- else if (comp.getContainer().getContainer() instanceof XSDComplexTypeDefinition)
- {
- if (XSDDOMHelper.inputEquals(child, XSDConstants.ATTRIBUTE_ELEMENT_TAG, true))
- {
- selectionProvider.setSelection(new StructuredSelection(comp.getContainer()));
- }
- else
- {
- selectionProvider.setSelection(new StructuredSelection(comp));
- }
- }
- else
- {
- selectionProvider.setSelection(new StructuredSelection(comp));
- }
- }
- else
- {
- selectionProvider.setSelection(new StructuredSelection(comp));
- }
- }
- else
- {
- selectionProvider.setSelection(new StructuredSelection(comp));
- }
- if (comp instanceof XSDNamedComponent)
- {
- if (sourceContext instanceof AbstractEditPartViewer)
- {
-// AbstractEditPartViewer viewer = (AbstractEditPartViewer)sourceContext;
-
-// Object obj = viewer.getSelectedEditParts().get(0);
-
-// if (obj instanceof GraphicalEditPart)
-// {
-// if (obj instanceof ElementDeclarationEditPart)
-// {
-// XSDElementDeclaration elem = ((ElementDeclarationEditPart)obj).getXSDElementDeclaration();
-// if (!elem.isElementDeclarationReference())
-// {
-// ((ElementDeclarationEditPart)obj).doEditName();
-// }
-// }
-// else if (obj instanceof ModelGroupDefinitionEditPart)
-// {
-// XSDModelGroupDefinition group = ((ModelGroupDefinitionEditPart)obj).getXSDModelGroupDefinition();
-// if (!group.isModelGroupDefinitionReference())
-// {
-// ((ModelGroupDefinitionEditPart)obj).doEditName();
-// }
-// }
-// else if (obj instanceof ComplexTypeDefinitionEditPart)
-// {
-// XSDComplexTypeDefinition ct = ((ComplexTypeDefinitionEditPart)obj).getXSDComplexTypeDefinition();
-// if (ct.getName() != null)
-// {
-// ((ComplexTypeDefinitionEditPart)obj).doEditName();
-// }
-// }
-// else if (obj instanceof TopLevelComponentEditPart)
-// {
-// ((TopLevelComponentEditPart)obj).doEditName();
-// }
-// }
-
- }
- }
- }
- };
- Display.getDefault().timerExec(50,runnable);
- }
- }
-
- /**
- * Gets the relativeNode.
- * @return Returns a Element
- */
- public Node getRelativeNode()
- {
- return relativeNode;
- }
-
- /**
- * Sets the relativeNode.
- * @param relativeNode The relativeNode to set
- */
- public void setRelativeNode(Node relativeNode)
- {
- this.relativeNode = relativeNode;
- }
-
- /**
- * Gets the description.
- * @return Returns a String
- */
- public String getDescription()
- {
- if (description == null)
- {
- return getText();
- }
- return description;
- }
-
- /**
- * Sets the description.
- * @param description The description to set
- */
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- protected List attributes;
- /**
- * Gets the nameAttribute.
- * @return Returns a String
- */
- public List getAttributes()
- {
- return attributes;
- }
-
- /**
- * Sets the attributes.
- * @param attributes The attributes to set
- */
- public void setAttributes(List attributes)
- {
- this.attributes = attributes;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java
deleted file mode 100644
index 6e6c7e5287..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.actions;
-
-// issue (cs) remove this
-/**
- * @version 1.0
- * @author
- */
-public class DOMAttribute
-{
- /**
- * Constructor for DOMAttribute.
- */
- public DOMAttribute()
- {
- super();
- }
-
- /**
- * Constructor for DOMAttribute.
- */
- public DOMAttribute(String name, String value)
- {
- super();
- this.name = name;
- this.value = value;
- }
-
- protected String name, value;
- /**
- * Gets the value.
- * @return Returns a String
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Sets the value.
- * @param value The value to set
- */
- public void setValue(String value)
- {
- this.value = value;
- }
-
- /**
- * Gets the name.
- * @return Returns a String
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the name.
- * @param name The name to set
- */
- public void setName(String name)
- {
- this.name = name;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/IXSDToolbarAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/IXSDToolbarAction.java
deleted file mode 100644
index 52199f65e9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/IXSDToolbarAction.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorPart;
-
-public interface IXSDToolbarAction extends IAction
-{
- public void setEditorPart(IEditorPart editorPart);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveAction.java
deleted file mode 100644
index be4764a439..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveAction.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.w3c.dom.Node;
-
-public class MoveAction extends Action
-{
- protected List selectedNodes;
- protected Node parentNode;
- protected Node previousRefChild, nextRefChild;
- boolean doInsertBefore;
-
- List selectedComponentsList;
- XSDModelGroup parentModelGroup;
- XSDConcreteComponent previousRefComponent, nextRefComponent;
-
- public MoveAction(XSDModelGroup parentComponent, List selectedComponents, XSDConcreteComponent previousRefChildComponent, XSDConcreteComponent nextRefChildComponent)
- {
- this.parentModelGroup = parentComponent;
- this.selectedComponentsList = selectedComponents;
- this.previousRefComponent = previousRefChildComponent;
- this.nextRefComponent = nextRefChildComponent;
-
- selectedNodes = new ArrayList(selectedComponents.size());
- for (Iterator i = selectedComponents.iterator(); i.hasNext();)
- {
- XSDConcreteComponent concreteComponent = (XSDConcreteComponent) i.next();
- selectedNodes.add(concreteComponent.getElement());
- }
- if (parentComponent == null) return;
- parentNode = parentComponent.getElement();
- nextRefChild = nextRefChildComponent != null ? nextRefChildComponent.getElement() : null;
- previousRefChild = previousRefChildComponent != null ? previousRefChildComponent.getElement() : null;
-
- doInsertBefore = (nextRefChild != null);
- if (nextRefComponent != null)
- {
- if (nextRefComponent.getContainer().getContainer() == parentModelGroup)
- {
- doInsertBefore = true;
- }
- }
- if (previousRefComponent != null)
- {
- if (previousRefComponent.getContainer().getContainer() == parentModelGroup)
- {
- doInsertBefore = false;
- }
- }
- }
-
- public boolean canMove()
- {
- boolean result = true;
-
- if (nextRefComponent instanceof XSDAttributeDeclaration || previousRefComponent instanceof XSDAttributeDeclaration || parentModelGroup == null)
- return false;
-
- return result;
- }
-
- /*
- * @see IAction#run()
- */
- public void run()
- {
- try
- {
- for (Iterator i = selectedComponentsList.iterator(); i.hasNext();)
- {
- XSDConcreteComponent concreteComponent = (XSDConcreteComponent) i.next();
-
- if (doInsertBefore)
- {
- if (concreteComponent == nextRefComponent)
- continue;
- }
- else
- {
- if (concreteComponent == previousRefComponent)
- continue;
- }
-
- for (Iterator particles = parentModelGroup.getContents().iterator(); particles.hasNext();)
- {
- XSDParticle particle = (XSDParticle) particles.next();
- XSDParticleContent particleContent = particle.getContent();
- if (particleContent == concreteComponent)
- {
- parentModelGroup.getContents().remove(particle);
- break;
- }
- }
- int index = 0;
- List particles = parentModelGroup.getContents();
- for (Iterator iterator = particles.iterator(); iterator.hasNext();)
- {
- XSDParticle particle = (XSDParticle) iterator.next();
- XSDParticleContent particleContent = particle.getContent();
- if (doInsertBefore)
- {
- if (particleContent == nextRefComponent)
- {
- parentModelGroup.getContents().add(index, concreteComponent.getContainer());
- break;
- }
- }
- else
- {
- if (particleContent == previousRefComponent)
- {
- parentModelGroup.getContents().add(index + 1, concreteComponent.getContainer());
- break;
- }
- }
- index++;
- }
- if (particles.size() == 0)
- {
- parentModelGroup.getContents().add(concreteComponent.getContainer());
- }
-
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveAttributeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveAttributeAction.java
deleted file mode 100644
index 896b84d6cd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveAttributeAction.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.w3c.dom.Node;
-
-// TODO COMMON AND CLEAN UP THIS CODE
-public class MoveAttributeAction extends Action
-{
-
- protected List selectedNodes;
- protected Node parentNode;
- protected Node previousRefChild, nextRefChild;
- boolean doInsertBefore;
-
- List selectedComponentsList;
- XSDConcreteComponent parentComponent;
- XSDConcreteComponent previousRefComponent, nextRefComponent;
-
- public MoveAttributeAction(XSDConcreteComponent parentComponent, List selectedComponents, XSDConcreteComponent previousRefChildComponent, XSDConcreteComponent nextRefChildComponent)
- {
- this.parentComponent = parentComponent;
- this.selectedComponentsList = selectedComponents;
- this.previousRefComponent = previousRefChildComponent;
- this.nextRefComponent = nextRefChildComponent;
-
- selectedNodes = new ArrayList(selectedComponents.size());
- for (Iterator i = selectedComponents.iterator(); i.hasNext();)
- {
- XSDConcreteComponent concreteComponent = (XSDConcreteComponent) i.next();
- selectedNodes.add(concreteComponent.getElement());
- }
- parentNode = parentComponent.getElement();
- nextRefChild = nextRefChildComponent != null ? nextRefChildComponent.getElement() : null;
- previousRefChild = previousRefChildComponent != null ? previousRefChildComponent.getElement() : null;
-
- doInsertBefore = (nextRefChild != null);
-
- if (nextRefComponent != null)
- {
- if (nextRefComponent.getContainer().getContainer() == parentComponent)
- {
- doInsertBefore = true;
- }
- }
- if (previousRefComponent != null)
- {
- if (previousRefComponent.getContainer().getContainer() == parentComponent)
- {
- doInsertBefore = false;
- }
- }
-
- }
-
- public boolean canMove()
- {
- boolean result = true;
-
- if (nextRefComponent instanceof XSDElementDeclaration || previousRefComponent instanceof XSDElementDeclaration)
- return false;
-
- return result;
- }
-
- /*
- * @see IAction#run()
- */
- public void run()
- {
- if (parentComponent instanceof XSDAttributeGroupDefinition)
- {
- moveUnderXSDAttributeGroupDefinition((XSDAttributeGroupDefinition) parentComponent);
- }
- else if (parentComponent instanceof XSDComplexTypeDefinition)
- {
- moveUnderXSDComplexTypeDefinition((XSDComplexTypeDefinition) parentComponent);
- }
- }
-
- protected void moveUnderXSDAttributeGroupDefinition(XSDAttributeGroupDefinition parentModelGroup)
- {
- try
- {
- for (Iterator i = selectedComponentsList.iterator(); i.hasNext();)
- {
- XSDConcreteComponent concreteComponent = (XSDConcreteComponent) i.next();
-
- if (doInsertBefore)
- {
- if (concreteComponent == nextRefComponent)
- continue;
- }
- else
- {
- if (concreteComponent == previousRefComponent)
- continue;
- }
-
- for (Iterator iterator = parentModelGroup.getContents().iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupContent attributeGroupContent = (XSDAttributeGroupContent) iterator.next();
- if (attributeGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeDeclaration attribute = ((XSDAttributeUse) attributeGroupContent).getContent();
- if (attribute == concreteComponent)
- {
- parentModelGroup.getContents().remove(attribute.getContainer());
- break;
- }
- }
- }
- int index = 0;
- List attributeGroupContents = parentModelGroup.getContents();
- for (Iterator iterator = attributeGroupContents.iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupContent attributeGroupContent = (XSDAttributeGroupContent) iterator.next();
- if (attributeGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeDeclaration attribute = ((XSDAttributeUse) attributeGroupContent).getContent();
- if (doInsertBefore)
- {
- if (attribute == nextRefComponent)
- {
- parentModelGroup.getContents().add(index, concreteComponent.getContainer());
- break;
- }
- }
- else
- {
- if (attribute == previousRefComponent)
- {
- parentModelGroup.getContents().add(index + 1, concreteComponent.getContainer());
- break;
- }
- }
- }
- index++;
- }
- if (attributeGroupContents.size() == 0)
- {
- parentModelGroup.getContents().add(concreteComponent.getContainer());
- }
-
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- protected void moveUnderXSDComplexTypeDefinition(XSDComplexTypeDefinition complexType)
- {
- try
- {
- for (Iterator i = selectedComponentsList.iterator(); i.hasNext();)
- {
- XSDConcreteComponent concreteComponent = (XSDConcreteComponent) i.next();
-
- if (doInsertBefore)
- {
- if (concreteComponent == nextRefComponent)
- continue;
- }
- else
- {
- if (concreteComponent == previousRefComponent)
- continue;
- }
-
- for (Iterator iterator = complexType.getAttributeContents().iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupContent attributeGroupContent = (XSDAttributeGroupContent) iterator.next();
- if (attributeGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeDeclaration attribute = ((XSDAttributeUse) attributeGroupContent).getContent();
- if (attribute == concreteComponent)
- {
- complexType.getAttributeContents().remove(attribute.getContainer());
- break;
- }
- }
- }
- int index = 0;
- List attributeGroupContents = complexType.getAttributeContents();
- for (Iterator iterator = attributeGroupContents.iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupContent attributeGroupContent = (XSDAttributeGroupContent) iterator.next();
- if (attributeGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeDeclaration attribute = ((XSDAttributeUse) attributeGroupContent).getContent();
- if (doInsertBefore)
- {
- if (attribute == nextRefComponent)
- {
- complexType.getAttributeContents().add(index, concreteComponent.getContainer());
- break;
- }
- }
- else
- {
- if (attribute == previousRefComponent)
- {
- complexType.getAttributeContents().add(index + 1, concreteComponent.getContainer());
- break;
- }
- }
- }
- index++;
- }
- if (attributeGroupContents.size() == 0)
- {
- complexType.getAttributeContents().add(concreteComponent.getContainer());
- }
-
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
deleted file mode 100644
index 945d4fd37a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.actions;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceInfoManager;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.ui.internal.actions.ReplacePrefixAction;
-import org.eclipse.wst.xml.ui.internal.util.XMLCommonResources;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.nsedit.SchemaPrefixChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.nsedit.TargetNamespaceChangeHandler;
-import org.eclipse.wst.xsd.ui.internal.widgets.XSDEditSchemaInfoDialog;
-import org.eclipse.xsd.XSDForm;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class XSDEditNamespacesAction extends Action {
- private Element element;
- private String resourceLocation;
- private XSDSchema xsdSchema;
- private DOMNamespaceInfoManager namespaceInfoManager = new DOMNamespaceInfoManager();
-
- public XSDEditNamespacesAction(String label, Element element, Node node) {
- super();
- setText(label);
-
- this.element = element;
- ///////////////////// This needs to be changed....
- this.resourceLocation = "dummy";
- }
-
- public XSDEditNamespacesAction(String label, Element element, Node node, XSDSchema schema) {
- this (label, element, node);
- xsdSchema = schema;
- }
-
- public void run() {
- if (element != null)
- {
- Shell shell = XMLCommonResources.getInstance().getWorkbench().getActiveWorkbenchWindow().getShell();
- String targetNamespace = null;
- if (xsdSchema != null) {
- targetNamespace = xsdSchema.getTargetNamespace();
- }
- XSDEditSchemaInfoDialog dialog = new XSDEditSchemaInfoDialog(shell, new Path(resourceLocation), targetNamespace);
-
- List namespaceInfoList = namespaceInfoManager.getNamespaceInfoList(element);
- List oldNamespaceInfoList = NamespaceInfo.cloneNamespaceInfoList(namespaceInfoList);
-
- // here we store a copy of the old info for each NamespaceInfo
- // this info will be used in createPrefixMapping() to figure out how to update the document
- // in response to these changes
- for (Iterator i = namespaceInfoList.iterator(); i.hasNext(); )
- {
- NamespaceInfo info = (NamespaceInfo)i.next();
- NamespaceInfo oldCopy = new NamespaceInfo(info);
- info.setProperty("oldCopy", oldCopy); //$NON-NLS-1$
- }
-
- String currentElementFormQualified = "";
- String currentAttributeFormQualified = "";
-
- boolean hasElementForm = element.hasAttribute(XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE);
- if (hasElementForm) currentElementFormQualified = element.getAttribute(XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE);
-
- boolean hasAttributeForm = element.hasAttribute(XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE);
- if (hasAttributeForm) currentAttributeFormQualified = element.getAttribute(XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE);
-
- dialog.setNamespaceInfoList(namespaceInfoList);
- dialog.create();
- dialog.getShell().setSize(500, 400);
- dialog.getShell().setText(XMLCommonResources.getInstance().getString("_UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE")); //$NON-NLS-1$
- dialog.setIsElementQualified(currentElementFormQualified);
- dialog.setIsAttributeQualified(currentAttributeFormQualified);
- dialog.setBlockOnOpen(true);
- dialog.open();
- String xsdPrefix = ""; //$NON-NLS-1$
-
- if (dialog.getReturnCode() == Window.OK)
- {
- Element xsdSchemaElement = xsdSchema.getElement();
- DocumentImpl doc = (DocumentImpl) xsdSchemaElement.getOwnerDocument();
-
- List newInfoList = dialog.getNamespaceInfoList();
-
- // see if we need to rename any prefixes
- Map prefixMapping = createPrefixMapping(oldNamespaceInfoList, namespaceInfoList);
-
- Map map2 = new Hashtable();
- for (Iterator iter = newInfoList.iterator(); iter.hasNext(); )
- {
- NamespaceInfo ni = (NamespaceInfo)iter.next();
- String pref = ni.prefix;
- String uri = ni.uri;
- if (pref == null) pref = ""; //$NON-NLS-1$
- if (uri == null) uri = ""; //$NON-NLS-1$
- if (XSDConstants.isSchemaForSchemaNamespace(uri))
- {
- xsdPrefix = pref;
- }
- map2.put(pref, uri);
- }
-
- if (map2.size() > 0)
- {
- try {
-
- doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_NAMESPACE_CHANGE"));
-
- if (xsdPrefix != null && xsdPrefix.length() == 0)
- {
- xsdSchema.setSchemaForSchemaQNamePrefix(null);
- }
- else
- {
- xsdSchema.setSchemaForSchemaQNamePrefix(xsdPrefix);
- }
-
- xsdSchema.setTargetNamespace(dialog.getTargetNamespace());
- xsdSchema.update();
-
- SchemaPrefixChangeHandler spch = new SchemaPrefixChangeHandler(xsdSchema, xsdPrefix);
- spch.resolve();
- xsdSchema.update();
-
- xsdSchema.setIncrementalUpdate(false);
- namespaceInfoManager.removeNamespaceInfo(element);
- namespaceInfoManager.addNamespaceInfo(element, newInfoList, false);
- xsdSchema.setIncrementalUpdate(true);
-
- // don't need these any more?
- ReplacePrefixAction replacePrefixAction = new ReplacePrefixAction(null, element, prefixMapping);
- replacePrefixAction.run();
-
- TargetNamespaceChangeHandler targetNamespaceChangeHandler = new TargetNamespaceChangeHandler(xsdSchema, targetNamespace, dialog.getTargetNamespace());
- targetNamespaceChangeHandler.resolve();
- }
- catch (Exception e)
- {
-// e.printStackTrace();
- }
- finally
- {
- xsdSchema.update();
- doc.getModel().endRecording(this);
- }
- }
-
- String attributeFormQualified = dialog.getAttributeFormQualified();
- String elementFormQualified = dialog.getElementFormQualified();
-
- boolean elementFormChanged = true;
- boolean attributeFormChanged = true;
- if (elementFormQualified.equals(currentElementFormQualified))
- {
- elementFormChanged = false;
- }
- if (attributeFormQualified.equals(currentAttributeFormQualified))
- {
- attributeFormChanged = false;
- }
- if (elementFormChanged)
- {
- doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_SCHEMA_ELEMENTFORMDEFAULT_CHANGE"));
- if (elementFormQualified.equals(XSDForm.QUALIFIED_LITERAL.getName()))
- {
- xsdSchema.setElementFormDefault(XSDForm.QUALIFIED_LITERAL);
- }
- else if (elementFormQualified.equals(XSDForm.UNQUALIFIED_LITERAL.getName()))
- {
- xsdSchema.setElementFormDefault(XSDForm.UNQUALIFIED_LITERAL);
- }
- else
- {
- // Model should allow us to remove the attribute
- xsdSchema.getElement().removeAttribute(XSDConstants.ELEMENTFORMDEFAULT_ATTRIBUTE);
- }
- doc.getModel().endRecording(this);
- }
- if (attributeFormChanged)
- {
- doc.getModel().beginRecording(this, XSDEditorPlugin.getXSDString("_UI_SCHEMA_ATTRIBUTEFORMDEFAULT_CHANGE"));
- if (attributeFormQualified.equals(XSDForm.QUALIFIED_LITERAL.getName()))
- {
- xsdSchema.setAttributeFormDefault(XSDForm.QUALIFIED_LITERAL);
- }
- else if (attributeFormQualified.equals(XSDForm.UNQUALIFIED_LITERAL.getName()))
- {
- xsdSchema.setAttributeFormDefault(XSDForm.UNQUALIFIED_LITERAL);
- }
- else
- {
- // Model should allow us to remove the attribute
- xsdSchema.getElement().removeAttribute(XSDConstants.ATTRIBUTEFORMDEFAULT_ATTRIBUTE);
- }
-
- doc.getModel().endRecording(this);
- }
- }
-
- }
- }
-
- protected Map createPrefixMapping(List oldList, List newList)
- {
- Map map = new Hashtable();
-
- Hashtable oldURIToPrefixTable = new Hashtable();
- for (Iterator i = oldList.iterator(); i.hasNext(); )
- {
- NamespaceInfo oldInfo = (NamespaceInfo)i.next();
- oldURIToPrefixTable.put(oldInfo.uri, oldInfo);
- }
-
- for (Iterator i = newList.iterator(); i.hasNext(); )
- {
- NamespaceInfo newInfo = (NamespaceInfo)i.next();
- NamespaceInfo oldInfo = (NamespaceInfo)oldURIToPrefixTable.get(newInfo.uri != null ? newInfo.uri : ""); //$NON-NLS-1$
-
-
- // if oldInfo is non null ... there's a matching URI in the old set
- // we can use its prefix to detemine out mapping
- //
- // if oldInfo is null ... we use the 'oldCopy' we stashed away
- // assuming that the user changed the URI and the prefix
- if (oldInfo == null)
- {
- oldInfo = (NamespaceInfo)newInfo.getProperty("oldCopy"); //$NON-NLS-1$
- }
-
- if (oldInfo != null)
- {
- String newPrefix = newInfo.prefix != null ? newInfo.prefix : ""; //$NON-NLS-1$
- String oldPrefix = oldInfo.prefix != null ? oldInfo.prefix : ""; //$NON-NLS-1$
- if (!oldPrefix.equals(newPrefix))
- {
- map.put(oldPrefix, newPrefix);
- }
- }
- }
- return map;
- }
-
-// private void updateAllNodes(Element element, String prefix)
-// {
-// element.setPrefix(prefix);
-// NodeList list = element.getChildNodes();
-// if (list != null)
-// {
-// for (int i=0; i < list.getLength(); i++)
-// {
-// Node child = list.item(i);
-// if (child != null && child instanceof Element)
-// {
-// child.setPrefix(prefix);
-// if (child.hasChildNodes())
-// {
-// updateAllNodes((Element)child, prefix);
-// }
-// }
-// }
-// }
-// }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java
deleted file mode 100644
index ebb4f42244..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IModelProxy;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDComplexTypeDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSchemaDirectiveAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSimpleTypeDefinitionAction;
-import org.eclipse.xsd.XSDSchema;
-
-public class CategoryAdapter extends XSDBaseAdapter implements IModelProxy, IActionProvider, IADTObjectListener
-{
- protected String text;
- protected Image image;
- protected Object parent;
- protected int groupType;
- Collection children, allChildren; // children from current schema, children from current schema and includes
- XSDSchema xsdSchema;
-
- public CategoryAdapter(String label, Image image, Collection children, XSDSchema xsdSchema, int groupType)
- {
- this.text = label;
- this.image = image;
- this.parent = xsdSchema;
- this.xsdSchema = xsdSchema;
- this.target = xsdSchema;
- this.children = children;
- this.groupType = groupType;
- }
-
- public final static int ATTRIBUTES = 1;
- public final static int ELEMENTS = 2;
- public final static int TYPES = 3;
- public final static int GROUPS = 5;
- public final static int DIRECTIVES = 6;
- public final static int NOTATIONS = 7;
- public final static int ATTRIBUTE_GROUPS = 8;
- public final static int IDENTITY_CONSTRAINTS = 9;
- public final static int ANNOTATIONS = 10;
-
- public XSDSchema getXSDSchema()
- {
- return xsdSchema;
- }
-
- public int getGroupType()
- {
- return groupType;
- }
-
- public Image getImage()
- {
- return image;
- }
-
- public String getText()
- {
- return text;
- }
-
- public ITreeElement[] getChildren()
- {
- return (ITreeElement[]) children.toArray(new ITreeElement[0]);
- }
-
- public ITreeElement[] getAllChildren()
- {
- return (ITreeElement[]) allChildren.toArray(new ITreeElement[0]);
- }
-
- public void setChildren(Collection list)
- {
- children = list;
- }
-
- public void setAllChildren(Collection list)
- {
- allChildren = list;
- }
-
- public Object getParent(Object element)
- {
- return xsdSchema;
- }
-
- public boolean hasChildren(Object element)
- {
- return true;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
-
- }
-
- public String[] getActions(Object object)
- {
- Collection actionIDs = new ArrayList();
-
- switch (groupType)
- {
- case TYPES : {
- actionIDs.add(AddXSDComplexTypeDefinitionAction.ID);
- actionIDs.add(AddXSDSimpleTypeDefinitionAction.ID);
- break;
- }
- case ELEMENTS : {
- actionIDs.add(AddXSDElementAction.ID);
- break;
- }
- case GROUPS : {
- actionIDs.add(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITION_ID);
- break;
- }
- case ATTRIBUTES : {
- actionIDs.add(AddXSDAttributeDeclarationAction.ID);
- actionIDs.add(AddXSDAttributeGroupDefinitionAction.ID);
- break;
- }
- case ATTRIBUTE_GROUPS : {
- actionIDs.add(AddXSDAttributeGroupDefinitionAction.ID);
- break;
- }
- case DIRECTIVES : {
- actionIDs.add(AddXSDSchemaDirectiveAction.INCLUDE_ID);
- actionIDs.add(AddXSDSchemaDirectiveAction.IMPORT_ID);
- actionIDs.add(AddXSDSchemaDirectiveAction.REDEFINE_ID);
- break;
- }
- }
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(ShowPropertiesViewAction.ID);
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (getText().equals(property))
- notifyListeners(this, property);
- }
-
- public List getTypes()
- {
- return null;
- }
-
- public IModel getModel()
- {
- return (IModel)XSDAdapterFactory.getInstance().adapt(xsdSchema);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java
deleted file mode 100644
index ef9b510790..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDSwitch;
-
-public class XSDAdapterFactory extends AdapterFactoryImpl
-{
- protected static XSDAdapterFactory instance;
-
- public static XSDAdapterFactory getInstance()
- {
- if (instance == null)
- {
- // first use the one defined by the configuration
- instance = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getAdapterFactory();
- // if there isn't one, then use the default
- if (instance == null)
- instance = new XSDAdapterFactory();
- }
- return instance;
- }
-
- public Adapter createAdapter(Notifier target)
- {
- XSDSwitch xsdSwitch = new XSDSwitch()
- {
- public Object caseXSDSchemaDirective(XSDSchemaDirective object)
- {
- return new XSDSchemaDirectiveAdapter();
- }
-
- public Object caseXSDWildcard(XSDWildcard object)
- {
- return new XSDWildcardAdapter();
- }
-
- public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object)
- {
- return new XSDAttributeGroupDefinitionAdapter();
- }
-
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
- {
- return new XSDModelGroupDefinitionAdapter();
- }
-
- public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object)
- {
- return new XSDAttributeDeclarationAdapter();
- }
-
- public Object caseXSDAttributeUse(XSDAttributeUse object)
- {
- return new XSDAttributeUseAdapter();
- }
-
- public Object caseXSDParticle(XSDParticle object)
- {
- return new XSDParticleAdapter();
- }
-
- public Object caseXSDElementDeclaration(XSDElementDeclaration object)
- {
- return new XSDElementDeclarationAdapter();
- }
-
- public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object)
- {
- // TODO Auto-generated method stub
- return new XSDSimpleTypeDefinitionAdapter();
- }
-
- public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object)
- {
- // we don't like exposing the 'anyType' type as a visible complex type
- // so we adapt it in a specialized way so that it's treated as simple type
- // that way it doesn't show up as a reference from a field
- //
- if ("anyType".equals(object.getName())) //$NON-NLS-1$
- {
- return new XSDAnyTypeDefinitionAdapter();
- }
- else
- {
- return new XSDComplexTypeDefinitionAdapter();
- }
- }
-
- public Object caseXSDModelGroup(XSDModelGroup object)
- {
- return new XSDModelGroupAdapter();
- }
-
- public Object caseXSDSchema(XSDSchema object)
- {
- return new XSDSchemaAdapter();
- }
- };
- Object o = xsdSwitch.doSwitch((EObject) target);
- Adapter result = null;
- if (o instanceof Adapter)
- {
- result = (Adapter) o;
- }
- else
- {
-// Thread.dumpStack();
- }
- return result;
- }
-
- public Adapter adapt(Notifier target)
- {
- return adapt(target, this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java
deleted file mode 100644
index ee440b4ade..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-public class XSDAnyTypeDefinitionAdapter extends XSDTypeDefinitionAdapter
-{
- public boolean isComplexType()
- {
- return false;
- }
-
- public boolean isFocusAllowed()
- {
- return false;
- }
-
- public String[] getActions(Object object)
- {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java
deleted file mode 100644
index c4200ef61a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDAttributeDeclarationAdapter extends XSDBaseAttributeAdapter implements IActionProvider
-{
- protected XSDAttributeDeclaration getXSDAttributeDeclaration()
- {
- return (XSDAttributeDeclaration)target;
- }
-
- protected XSDAttributeDeclaration getResolvedXSDAttributeDeclaration()
- {
- return getXSDAttributeDeclaration().getResolvedAttributeDeclaration();
- }
-
- public boolean isGlobal()
- {
- return getXSDAttributeDeclaration().eContainer() instanceof XSDSchema;
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeDeclaration().getSchema());
- return (IModel)adapter;
- }
-
- public boolean isFocusAllowed()
- {
- return isGlobal();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java
deleted file mode 100644
index 81e8e8ed72..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyAttributeAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDAttributeGroupDefinitionAdapter extends XSDBaseAdapter implements IStructure, IActionProvider, IGraphElement
-{
- public static final Image ATTRIBUTE_GROUP_REF_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroupRef.gif");
- public static final Image ATTRIBUTE_GROUP_REF_DISABLED_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroupRefdis.gif");
- public static final Image ATTRIBUTE_GROUP_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroup.gif");
- public static final Image ATTRIBUTE_GROUP_DISABLED_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeGroupdis.gif");
-
- public XSDAttributeGroupDefinitionAdapter()
- {
- super();
- }
-
- public XSDAttributeGroupDefinition getXSDAttributeGroupDefinition()
- {
- return (XSDAttributeGroupDefinition) target;
- }
-
- public Image getImage()
- {
- XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition) target;
- if (xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference())
- {
- return isReadOnly() ? ATTRIBUTE_GROUP_REF_DISABLED_ICON_IMAGE : ATTRIBUTE_GROUP_REF_ICON_IMAGE;
- }
- else
- {
- return isReadOnly() ? ATTRIBUTE_GROUP_DISABLED_ICON_IMAGE : ATTRIBUTE_GROUP_ICON_IMAGE;
- }
- }
-
- public String getText()
- {
- XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition) target;
- String result = xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference() ? xsdAttributeGroupDefinition.getQName() : xsdAttributeGroupDefinition.getName();
- return result == null ? Messages._UI_LABEL_ABSENT : result;
- }
-
- public ITreeElement[] getChildren()
- {
- XSDAttributeGroupDefinition xsdAttributeGroup = (XSDAttributeGroupDefinition) target;
- List list = new ArrayList();
- list.addAll(xsdAttributeGroup.getContents());
- XSDWildcard wildcard = xsdAttributeGroup.getAttributeWildcardContent();
- if (wildcard != null)
- {
- list.add(wildcard);
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
- list.add(AddXSDAttributeDeclarationAction.ID);
- list.add(AddXSDAnyAttributeAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
- return (String [])list.toArray(new String[0]);
- }
-
- public Command getAddNewFieldCommand(String fieldKind)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand("", getXSDAttributeGroupDefinition()); //$NON-NLS-1$
- }
-
- public List getFields()
- {
- // TODO (cs) ... review this
- ITreeElement[] chidlren = getChildren();
- return Arrays.asList(chidlren);
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeGroupDefinition().getSchema());
- return (IModel)adapter;
- }
-
- public String getName()
- {
- // TODO (cs) ... review this
- return getText();
- }
-
- public boolean isFocusAllowed()
- {
- XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition) target;
- if (xsdAttributeGroupDefinition.isAttributeGroupDefinitionReference())
- {
- return false;
- }
- return true;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeUseAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeUseAdapter.java
deleted file mode 100644
index 8759688d43..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeUseAdapter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-
-public class XSDAttributeUseAdapter extends XSDBaseAttributeAdapter implements IActionProvider
-{
- protected XSDAttributeDeclaration getXSDAttributeDeclaration()
- {
- return getXSDAttributeUse().getAttributeDeclaration();
- }
-
- protected XSDAttributeDeclaration getResolvedXSDAttributeDeclaration()
- {
- return getXSDAttributeDeclaration().getResolvedAttributeDeclaration();
- }
-
- protected XSDAttributeUse getXSDAttributeUse()
- {
- return (XSDAttributeUse)target;
- }
-
- public XSDAttributeUseAdapter()
- {
- super();
- }
-
- public String getText()
- {
- return getTextForAttributeUse(getXSDAttributeUse(), true);
- }
-
- public String getTextForAttributeUse(XSDAttributeUse attributeUse, boolean showType)
- {
- XSDAttributeDeclaration ad = attributeUse.getAttributeDeclaration();
-
- StringBuffer result = new StringBuffer();
- result.append(getTextForAttribute(ad, showType));
- /*
- if (xsdAttributeUse.isSetConstraint())
- {
- if (result.length() != 0)
- {
- result.append(" ");
- }
- result.append('<');
- result.append(xsdAttributeUse.getConstraint());
- result.append("=\"");
- result.append(xsdAttributeUse.getLexicalValue());
- result.append("\">");
- }
- */
- return result.toString();
- }
-
- public boolean isGlobal()
- {
- return false;
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeDeclaration().getSchema());
- return (IModel)adapter;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java
deleted file mode 100644
index 1f4a3b7e0f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Element;
-
-public class XSDBaseAdapter extends AdapterImpl implements IADTObject, ITreeElement
-{
- protected List listenerList = new ArrayList();
-
- public boolean isAdapterForType(Object type)
- {
- return type == XSDAdapterFactory.getInstance();
- }
-
- public void populateAdapterList(List notifierList, List adapterList)
- {
- for (Iterator i = notifierList.iterator(); i.hasNext(); )
- {
- Object obj = i.next();
- if (obj instanceof XSDConcreteComponent)
- {
- XSDConcreteComponent component = (XSDConcreteComponent)obj;
- adapterList.add(XSDAdapterFactory.getInstance().adapt(component));
- }
- else
- {
- adapterList.add(obj);
- }
- }
- }
-
- public void registerListener(IADTObjectListener listener)
- {
- if (!listenerList.contains(listener))
- {
- listenerList.add(listener);
- }
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
- listenerList.remove(listener);
- }
-
- public void notifyChanged(Notification msg)
- {
- super.notifyChanged(msg);
- notifyListeners(this, null);
- }
-
- protected void notifyListeners(Object changedObject, String property)
- {
- List clonedListenerList = new ArrayList();
- clonedListenerList.addAll(listenerList);
- for (Iterator i = clonedListenerList.iterator(); i.hasNext(); )
- {
- IADTObjectListener listener = (IADTObjectListener)i.next();
- listener.propertyChanged(this, property);
- }
- }
-
- public ITreeElement[] getChildren()
- {
- return null;
- }
-
- public Image getImage()
- {
- return null;
- }
-
- public String getText()
- {
- return ""; //$NON-NLS-1$
- }
-
- public ITreeElement getParent()
- {
- return null;
- }
-
- public boolean hasChildren()
- {
- if (getChildren() != null)
- {
- return getChildren().length > 0;
- }
- return false;
- }
-
-
- /**
- * Implements IField getContainerType. Get parent Complex Type containing the field
- * @return IComplexType
- */
- public IComplexType getContainerType()
- {
- XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent) target;
- XSDConcreteComponent parent = null;
- XSDComplexTypeDefinition ct = null;
- for (parent = xsdConcreteComponent.getContainer(); parent != null; )
- {
- if (parent instanceof XSDComplexTypeDefinition)
- {
- ct = (XSDComplexTypeDefinition)parent;
- break;
- }
- parent = parent.getContainer();
- }
- if (ct != null)
- {
- return (IComplexType)XSDAdapterFactory.getInstance().adapt(ct);
- }
- return null;
- }
-
- public boolean isReadOnly()
- {
- XSDSchema xsdSchema = null;
- try
- {
- IEditorPart editorPart = null;
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null)
- {
- IWorkbenchPage page = window.getActivePage();
- if (page != null)
- {
- editorPart = page.getActiveEditor();
- }
- }
- if (target instanceof XSDConcreteComponent)
- {
- xsdSchema = ((XSDConcreteComponent)target).getSchema();
- }
- if (editorPart == null)
- {
- return fallBackCheckIsReadOnly();
- }
-
- XSDSchema editorSchema = (XSDSchema)editorPart.getAdapter(XSDSchema.class);
- if (xsdSchema != null && xsdSchema == editorSchema)
- {
- return false;
- }
- else
- {
- return fallBackCheckIsReadOnly();
- }
- }
- catch(Exception e)
- {
-
- }
- return true;
- }
-
- private boolean fallBackCheckIsReadOnly()
- {
- Element element = ((XSDConcreteComponent)target).getElement();
- if (element instanceof IDOMNode
- || element instanceof ElementImpl)
- {
- return false;
- }
- return true;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java
deleted file mode 100644
index 8243945761..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-// a base adapter for reuse by an AttributeUse and AttributeDeclaration
-//
-public abstract class XSDBaseAttributeAdapter extends XSDBaseAdapter implements IField, IGraphElement
-{
- protected abstract XSDAttributeDeclaration getXSDAttributeDeclaration();
- protected abstract XSDAttributeDeclaration getResolvedXSDAttributeDeclaration();
-
- public XSDBaseAttributeAdapter()
- {
- super();
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
- list.add(AddXSDAttributeDeclarationAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- //list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
- list.add(DeleteAction.ID);
-
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
- return (String[]) list.toArray(new String[0]);
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand("", getXSDAttributeDeclaration()); //$NON-NLS-1$
- }
-
- public String getKind()
- {
- return "attribute"; //$NON-NLS-1$
- }
-
- public int getMaxOccurs()
- {
- // TODO Auto-generated method stub
- return -3;
- }
-
- public int getMinOccurs()
- {
- // TODO Auto-generated method stub
- return -3;
- }
-
- public String getName()
- {
- XSDAttributeDeclaration resolvedAttributeDeclaration = getResolvedXSDAttributeDeclaration();
- String name = resolvedAttributeDeclaration.getName();
- return (name == null) ? "" : name; //$NON-NLS-1$
- }
-
- public IType getType()
- {
- XSDTypeDefinition td = getResolvedXSDAttributeDeclaration().getTypeDefinition();
- return (td != null) ? (IType) XSDAdapterFactory.getInstance().adapt(td) : null;
- }
-
- public String getTypeName()
- {
- XSDTypeDefinition td = getResolvedXSDAttributeDeclaration().getTypeDefinition();
- return (td != null) ? td.getName() : Messages._UI_NO_TYPE_DEFINED;
- }
-
- public String getTypeNameQualifier()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMaxOccursCommand(int maxOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMinOccursCommand(int minOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateNameCommand(String name)
- {
- return new UpdateNameCommand(Messages._UI_ACTION_UPDATE_NAME, getResolvedXSDAttributeDeclaration(), name);
- }
-
- public Command getUpdateTypeNameCommand(String typeName, String quailifier)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement#getImage()
- */
- public Image getImage()
- {
- XSDAttributeDeclaration xsdAttributeDeclaration = getXSDAttributeDeclaration(); // don't want the resolved attribute
- if (xsdAttributeDeclaration.isAttributeDeclarationReference())
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributeRefdis.gif");
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDAttributeRef.gif"); //$NON-NLS-1$
- }
- else
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAttributedis.gif");
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif"); //$NON-NLS-1$
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement#getText()
- */
- public String getText()
- {
- return getTextForAttribute(getResolvedXSDAttributeDeclaration(), true);
- }
-
- public String getTextForAttribute(XSDAttributeDeclaration ad, boolean showType)
- {
- ad = ad.getResolvedAttributeDeclaration();
- String name = ad.getName();
- StringBuffer result = new StringBuffer();
- if (name == null)
- {
- result.append(" " + Messages._UI_LABEL_ABSENT + " "); //$NON-NLS-1$ //$NON-NLS-2$
- }
- else
- {
- result.append(name);
- }
- if (ad.getAnonymousTypeDefinition() == null && ad.getTypeDefinition() != null)
- {
- result.append(" : "); //$NON-NLS-1$
- // result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration));
- result.append(ad.getTypeDefinition().getName());
- }
- return result.toString();
- }
-
- public boolean isGlobal()
- {
- return false;
- }
-
- public boolean isReference()
- {
- return false;
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDAttributeDeclaration().getSchema());
- return (IModel)adapter;
- }
-
- public boolean isFocusAllowed()
- {
- return false;
- }
-}
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDChildUtility.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDChildUtility.java
deleted file mode 100644
index 191110cd66..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDChildUtility.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDSwitch;
-
-
-public class XSDChildUtility
-{
- static public List getModelChildren(Object model)
- {
- XSDChildVisitor visitor = new XSDChildVisitor(model);
- visitor.visitXSDObject(model);
- return visitor.list;
- }
-
- static public List getImmediateDerivedTypes(XSDComplexTypeDefinition complexType)
- {
- ArrayList typesDerivedFrom = new ArrayList();
-
- // A handy convenience method quickly gets all
- // typeDefinitions within our schema; note that
- // whether or not this returns types in included,
- // imported, or redefined schemas is subject to change
- List typedefs = complexType.getSchema().getTypeDefinitions();
-
- for (Iterator iter = typedefs.iterator(); iter.hasNext(); )
- {
- XSDTypeDefinition typedef = (XSDTypeDefinition)iter.next();
- // Walk the baseTypes from this typedef seeing if any
- // of them match the requested one
- if (complexType.equals(typedef.getBaseType()))
- {
- // We found it, return the original one and continue
- typesDerivedFrom.add(typedef);
- }
- }
- return typesDerivedFrom;
- }
- // TODO... use the XSDVisitor defined in xsdeditor.util instead
- //
- public static class XSDChildVisitor extends XSDVisitor
- {
- Object root;
- List list = new ArrayList();
-
- public XSDChildVisitor(Object root)
- {
- this.root = root;
- }
-
- public void visitXSDModelGroup(XSDModelGroup xsdModelGroup)
- {
- if (xsdModelGroup != root)
- {
- list.add(xsdModelGroup);
- }
- else
- {
- super.visitXSDModelGroup(xsdModelGroup);
- }
- }
-
- public void visitXSDModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition)
- {
- if (xsdModelGroupDefinition != root)
- {
- list.add(xsdModelGroupDefinition);
- }
- else
- {
- super.visitXSDModelGroupDefinition(xsdModelGroupDefinition);
- }
- }
-
- public void visitXSDElementDeclaration(XSDElementDeclaration xsdElementDeclaration)
- {
- if (xsdElementDeclaration != root)
- {
- list.add(xsdElementDeclaration);
-
- }
- else
- {
- super.visitXSDElementDeclaration(xsdElementDeclaration);
- }
- }
-
- public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition)
- {
- if (xsdComplexTypeDefinition != root)
- {
- if (xsdComplexTypeDefinition.getName() != null || getModelChildren(xsdComplexTypeDefinition).size() > 0)
- {
- list.add(xsdComplexTypeDefinition);
- }
- }
- else
- {
- super.visitXSDComplexTypeDefinition(xsdComplexTypeDefinition);
- }
- }
-
- public void visitXSDWildcard(XSDWildcard xsdWildCard)
- {
- if (xsdWildCard != root)
- {
- list.add(xsdWildCard);
- }
- else
- {
- super.visitXSDWildcard(xsdWildCard);
- }
- }
- }
-
-
- public static class XSDVisitor
- {
- int indent = 0;
-
- public void visitXSDObject(Object object)
- {
- if (object == null)
- return;
-
- XSDSwitch theSwitch = new XSDSwitch()
- {
- public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object)
- {
- visitXSDComplexTypeDefinition(object);
- return null;
- }
-
- public Object caseXSDAttributeUse(XSDAttributeUse object)
- {
- visitXSDAttributeUse(object);
- return null;
- }
-
- public Object caseXSDElementDeclaration(XSDElementDeclaration object)
- {
- visitXSDElementDeclaration(object);
- return null;
- }
-
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object)
- {
- visitXSDModelGroupDefinition(object);
- return super.caseXSDModelGroupDefinition(object);
- }
-
- public Object caseXSDModelGroup(XSDModelGroup object)
- {
- visitXSDModelGroup(object);
- return super.caseXSDModelGroup(object);
- }
-
- public Object caseXSDParticle(XSDParticle object)
- {
- visitXSDParticle(object);
- return null;
- }
-
- public Object caseXSDSchema(XSDSchema object)
- {
- visitXSDSchema(object);
- return null;
- }
-
- public Object caseXSDWildcard(XSDWildcard object)
- {
- visitXSDWildcard(object);
- return null;
- }
- };
- theSwitch.doSwitch((EObject)object);
- }
-
- public void visitXSDAttributeUse(XSDAttributeUse xsdAttributeUse)
- {
-// printIndented("@" + xsdAttributeUse.getAttributeDeclaration().getName());
- }
-
- public void visitXSDSchema(XSDSchema xsdSchema)
- {
- indent += 2;
- for (Iterator iterator = xsdSchema.getElementDeclarations().iterator(); iterator.hasNext(); )
- {
- visitXSDObject(iterator.next());
- }
- indent -= 2;
- }
-
- public void visitXSDElementDeclaration(XSDElementDeclaration xsdElementDeclaration)
- {
- indent += 2;
- XSDTypeDefinition td = xsdElementDeclaration.getTypeDefinition();
- if (td == null)
- {
- td = xsdElementDeclaration.getAnonymousTypeDefinition();
- }
- visitXSDObject(td);
- indent -= 2;
- }
-
- public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition)
- {
- indent += 2;
- for (Iterator i = xsdComplexTypeDefinition.getAttributeUses().iterator(); i.hasNext(); )
- {
- visitXSDObject(i.next());
- }
- visitXSDObject(xsdComplexTypeDefinition.getContent());
- indent -= 2;
- }
-
- public void visitXSDModelGroup(XSDModelGroup xsdModelGroup)
- {
- indent += 2;
- for (Iterator iterator = xsdModelGroup.getContents().iterator(); iterator.hasNext(); )
- {
- visitXSDObject(iterator.next());
- }
- indent -= 2;
- }
-
- public void visitXSDModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition)
- {
- indent += 2;
- visitXSDObject(xsdModelGroupDefinition.getResolvedModelGroupDefinition().getModelGroup());
- indent -= 2;
- }
-
- public void visitXSDParticle(XSDParticle xsdParticle)
- {
- indent += 2;
- if (xsdParticle.getContent() != null)
- visitXSDObject(xsdParticle.getContent());
- indent -= 2;
- }
-
- public void visitXSDWildcard(XSDWildcard object)
- {
-
- }
-
- public void printIndented(String string)
- {
- //String spaces = "";
- //for (int i = 0; i < indent; i++)
- //{
- // spaces += " ";
- //}
-
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java
deleted file mode 100644
index 451c5d30dd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyAttributeAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.SpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDComplexTypeDefinitionAdapter extends XSDTypeDefinitionAdapter implements IComplexType, IADTObjectListener
-{
- protected List fields = null;
- protected List otherThingsToListenTo = null;
-
- public XSDComplexTypeDefinition getXSDComplexTypeDefinition()
- {
- return (XSDComplexTypeDefinition) target;
- }
-
- public IType getSuperType()
- {
- XSDTypeDefinition td = getXSDTypeDefinition().getBaseType();
-
- // test to filter out the 'anyType' type ... don't want to see that
- //
- if (td != null && !td.getName().equals("anyType")) //$NON-NLS-1$
- {
- return (IType) XSDAdapterFactory.getInstance().adapt(td);
- }
- return null;
- }
-
- protected void clearFields()
- {
- if (otherThingsToListenTo != null)
- {
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IADTObject)
- {
- IADTObject adtObject = (IADTObject) adapter;
- adtObject.unregisterListener(this);
- }
- }
- }
- fields = null;
- otherThingsToListenTo = null;
- }
-
- public List getFields()
- {
- if (fields == null)
- {
- fields = new ArrayList();
- otherThingsToListenTo = new ArrayList();
-
- XSDVisitorForFields visitor = new XSDVisitorForFieldsWithSpaceFillers();
- visitor.visitComplexTypeDefinition(getXSDComplexTypeDefinition());
- populateAdapterList(visitor.concreteComponentList, fields);
- populateAdapterList(visitor.thingsWeNeedToListenTo, otherThingsToListenTo);
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IADTObject)
- {
- IADTObject adtObject = (IADTObject) adapter;
- adtObject.registerListener(this);
- }
- }
- }
- return fields;
- }
-
- class XSDVisitorForFieldsWithSpaceFillers extends XSDVisitorForFields
- {
- public XSDVisitorForFieldsWithSpaceFillers()
- {
- super();
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext();)
- {
- Object o = it.next();
- if (o instanceof XSDAttributeUse)
- {
- XSDAttributeUse attributeUse = (XSDAttributeUse) o;
- concreteComponentList.add(attributeUse.getAttributeDeclaration());
- thingsWeNeedToListenTo.add(attributeUse.getAttributeDeclaration());
- }
- else if (o instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) o;
- thingsWeNeedToListenTo.add(attrGroup);
- if (attrGroup.isAttributeGroupDefinitionReference())
- {
- attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
- if (attrGroup.getContents().size() == 0)
- {
- concreteComponentList.add(new SpaceFiller("attribute")); //$NON-NLS-1$
- }
- visitAttributeGroupDefinition(attrGroup);
- }
- }
- }
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- int numOfChildren = modelGroup.getContents().size();
- if (numOfChildren == 0)
- {
- concreteComponentList.add(new SpaceFiller("element")); //$NON-NLS-1$
- }
- super.visitModelGroup(modelGroup);
- }
- }
-
- public List getModelGroups()
- {
- List groups = new ArrayList();
- groups.addAll(XSDChildUtility.getModelChildren(getXSDComplexTypeDefinition()));
- return groups;
- }
-
- public List getAttributeGroupContent()
- {
- EList attrContent = getXSDComplexTypeDefinition().getAttributeContents();
- List attrUses = new ArrayList();
- List list = new ArrayList();
-
- for (Iterator it = attrContent.iterator(); it.hasNext();)
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) it.next();
-
- if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) attrGroupContent;
- list.add(XSDAdapterFactory.getInstance().adapt(attributeGroupDefinition));
- getAttributeUses(attributeGroupDefinition, attrUses);
- }
- else
- {
- attrUses.add(attrGroupContent);
- list.add(new TargetConnectionSpaceFiller(this));
- }
- }
- return list;
- }
-
- public boolean isComplexType()
- {
- return true;
- }
-
- public void notifyChanged(Notification msg)
- {
- clearFields();
- super.notifyChanged(msg);
- }
-
- public Command getUpdateNameCommand(String newName)
- {
- return new UpdateNameCommand(Messages._UI_ACTION_UPDATE_NAME, getXSDComplexTypeDefinition(), newName);
- }
-
- public Command getAddNewFieldCommand(String fieldKind)
- {
- return new AddXSDElementCommand(Messages._UI_ACTION_ADD_FIELD, getXSDComplexTypeDefinition());
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand("", getXSDComplexTypeDefinition()); //$NON-NLS-1$
- }
-
- protected class AddNewFieldCommand extends Command
- {
- protected String defaultName;
- protected String fieldKind;
-
- AddNewFieldCommand(String defaultName, String fieldKind)
- {
- this.defaultName = defaultName;
- this.fieldKind = fieldKind;
- }
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- Object schema = editorPart.getAdapter(XSDSchema.class);
-
- list.add(AddXSDElementAction.ID);
- list.add(AddXSDElementAction.REF_ID);
- list.add(AddXSDAttributeDeclarationAction.ID);
- list.add(AddXSDAttributeDeclarationAction.REF_ID);
- list.add(AddXSDAttributeGroupDefinitionAction.REF_ID);
- list.add(AddXSDAnyAttributeAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(AddXSDModelGroupAction.SEQUENCE_ID);
- list.add(AddXSDModelGroupAction.CHOICE_ID);
-
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(DeleteAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- if (getXSDComplexTypeDefinition().getSchema() == schema)
- {
- if (getXSDComplexTypeDefinition().getContainer() == schema)
- {
- list.add(SetInputToGraphView.ID);
- }
- }
- else
- {
- list.add(OpenInNewEditor.ID);
- }
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
- String[] result = new String[list.size()];
- list.toArray(result);
- return result;
- }
-
- public void propertyChanged(Object object, String property)
- {
- clearFields();
- notifyListeners(this, null);
- }
-
- class BogusAction extends Action
- {
- BogusAction(String name)
- {
- super(name);
- }
-
- public void run()
- {
- // TODO Auto-generated method stub
- super.run();
- }
- }
-
- public ITreeElement[] getChildren()
- {
- XSDComplexTypeDefinition xsdComplexTypeDefinition = getXSDComplexTypeDefinition();
- List list = new ArrayList();
- // Add attributes
- for (Iterator i = xsdComplexTypeDefinition.getAttributeContents().iterator(); i.hasNext();)
- {
- Object obj = i.next();
- if (obj instanceof XSDAttributeUse)
- {
- list.add(obj);
- }
- else if (obj instanceof XSDAttributeGroupDefinition)
- {
- getAttributeUses((XSDAttributeGroupDefinition) obj, list);
- }
- }
- // get immediate XSD Model Group of this complex type
- if (xsdComplexTypeDefinition.getContent() != null)
- {
- XSDComplexTypeContent xsdComplexTypeContent = xsdComplexTypeDefinition.getContent();
- if (xsdComplexTypeContent instanceof XSDParticle)
- {
- XSDParticleContent particleContent = ((XSDParticle) xsdComplexTypeContent).getContent();
- if (particleContent instanceof XSDModelGroup)
- {
- list.add(particleContent);
- }
- }
- }
- // get inherited XSD Model Group of this complex type
- boolean showInheritedContent = XSDEditorPlugin.getPlugin().getShowInheritedContent();
- if (showInheritedContent)
- {
- XSDTypeDefinition typeDef = xsdComplexTypeDefinition.getBaseTypeDefinition();
- if (typeDef instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition baseCT = (XSDComplexTypeDefinition) typeDef;
- if (baseCT.getTargetNamespace() != null && !baseCT.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
- {
- if (baseCT.getContent() != null)
- {
- XSDComplexTypeContent xsdComplexTypeContent = baseCT.getContent();
- if (xsdComplexTypeContent instanceof XSDParticle)
- {
- XSDParticleContent particleContent = ((XSDParticle) xsdComplexTypeContent).getContent();
- if (particleContent instanceof XSDModelGroup)
- {
- list.add(particleContent);
- }
- }
- }
- }
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
- }
-
- public Image getImage()
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDComplexTypedis.gif"); //$NON-NLS-1$
- }
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDComplexType.gif"); //$NON-NLS-1$
- }
-
- public String getText()
- {
- XSDComplexTypeDefinition xsdComplexTypeDefinition = (XSDComplexTypeDefinition) target;
-
- StringBuffer result = new StringBuffer();
-
- result.append(xsdComplexTypeDefinition.getName() == null ? "local type" : xsdComplexTypeDefinition.getName()); //$NON-NLS-1$
-
- XSDTypeDefinition baseTypeDefinition = xsdComplexTypeDefinition.getBaseTypeDefinition();
- if (baseTypeDefinition != null && baseTypeDefinition != xsdComplexTypeDefinition.getContent() && baseTypeDefinition.getName() != null && !XSDConstants.isURType(baseTypeDefinition))
- {
- result.append(" : "); //$NON-NLS-1$
- result.append(baseTypeDefinition.getQName(xsdComplexTypeDefinition));
- }
-
- return result.toString();
- }
-
- public void getAttributeUses(XSDAttributeGroupDefinition attributeGroupDefinition, List list)
- {
- Iterator i = attributeGroupDefinition.getResolvedAttributeGroupDefinition().getContents().iterator();
-
- while (i.hasNext())
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) i.next();
-
- if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- getAttributeUses((XSDAttributeGroupDefinition) attrGroupContent, list);
- }
- else
- {
- list.add(XSDAdapterFactory.getInstance().adapt(attrGroupContent));
- }
- }
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDComplexTypeDefinition().getSchema());
- return (IModel)adapter;
- }
-
- public boolean isFocusAllowed()
- {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java
deleted file mode 100644
index b89e77bc6c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.IAnnotationProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicityAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetTypeAction;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNameCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDElementDeclarationAdapter extends XSDParticleAdapter implements IField, IActionProvider, IAnnotationProvider, IGraphElement
-{
- protected XSDElementDeclaration getXSDElementDeclaration()
- {
- return (XSDElementDeclaration) target;
- }
-
- public String getName()
- {
- String name = getXSDElementDeclaration().getResolvedElementDeclaration().getName();
- return (name == null) ? "" : name; //$NON-NLS-1$
- }
-
- public String getTypeName()
- {
- IType type = getType();
- if (type != null)
- {
- return type.getName();
- }
- return null;
- }
-
- public String getTypeNameQualifier()
- {
- return getXSDElementDeclaration().getTypeDefinition().getTargetNamespace();
- }
-
- public IType getType()
- {
- XSDTypeDefinition td = getXSDElementDeclaration().getResolvedElementDeclaration().getTypeDefinition();
- //if (td != null &&
- // td.getTargetNamespace() != null && td.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) return null;
- return (td != null) ? (IType) XSDAdapterFactory.getInstance().adapt(td) : null;
- }
-
- public Image getImage()
- {
- XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) target;
-
- if (!xsdElementDeclaration.isElementDeclarationReference())
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDElementdis.gif");
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"); //$NON-NLS-1$
- }
- else
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDElementRefdis.gif");
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDElementRef.gif"); //$NON-NLS-1$
- }
- }
-
- public String getText()
- {
- XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) target;
- XSDElementDeclaration resolvedElementDeclaration = xsdElementDeclaration.getResolvedElementDeclaration();
- //String name = xsdElementDeclaration != resolvedElementDeclaration ? xsdElementDeclaration.getQName() : xsdElementDeclaration.getName();
- String name = resolvedElementDeclaration.getName();
-
- StringBuffer result = new StringBuffer();
- if (name == null)
- {
- result.append(Messages._UI_LABEL_ABSENT);
- }
- else
- {
- result.append(name);
- }
-
- if (!xsdElementDeclaration.isGlobal())
- {
- Element element = xsdElementDeclaration.getElement();
- boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
- boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-
- if (hasMinOccurs || hasMaxOccurs)
- {
- result.append(" ["); //$NON-NLS-1$
- if (hasMinOccurs)
- {
- int min = ((XSDParticle) xsdElementDeclaration.getContainer()).getMinOccurs();
- if (min == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(min));
- }
- }
- else
- // print default
- {
- int min = ((XSDParticle) xsdElementDeclaration.getContainer()).getMinOccurs();
- result.append(String.valueOf(min));
- }
- if (hasMaxOccurs)
- {
- int max = ((XSDParticle) xsdElementDeclaration.getContainer()).getMaxOccurs();
- result.append(".."); //$NON-NLS-1$
- if (max == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(max));
- }
- }
- else
- // print default
- {
- result.append(".."); //$NON-NLS-1$
- int max = ((XSDParticle) xsdElementDeclaration.getContainer()).getMaxOccurs();
- result.append(String.valueOf(max));
-
- }
- result.append("]"); //$NON-NLS-1$
- }
- }
-
- if (resolvedElementDeclaration.getAnonymousTypeDefinition() == null && resolvedElementDeclaration.getTypeDefinition() != null)
- {
- result.append(" : "); //$NON-NLS-1$
- // result.append(resolvedElementDeclaration.getTypeDefinition().getQName(xsdElementDeclaration));
- result.append(resolvedElementDeclaration.getTypeDefinition().getName());
- }
-
- return result.toString();
-
- }
-
- public ITreeElement[] getChildren()
- {
- XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) target;
- List list = new ArrayList();
- XSDTypeDefinition type = null;
- if (xsdElementDeclaration.isElementDeclarationReference())
- {
- type = xsdElementDeclaration.getResolvedElementDeclaration().getTypeDefinition();
- }
- else
- {
- type = xsdElementDeclaration.getAnonymousTypeDefinition();
- if (type == null)
- {
- type = xsdElementDeclaration.getTypeDefinition();
- }
- }
-
- if (type instanceof XSDComplexTypeDefinition && type.getTargetNamespace() != null && !type.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
- {
- XSDComplexTypeDefinition ctType = (XSDComplexTypeDefinition) type;
- if (ctType != null)
- {
- if (xsdElementDeclaration.isGlobal())
- list.add(ctType);
- }
- }
-
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
-
- }
-
- public String getKind()
- {
- return "element"; //$NON-NLS-1$
- }
-
- public boolean isGlobal()
- {
- return getXSDElementDeclaration().eContainer() instanceof XSDSchema;
- }
-
- public boolean isReference()
- {
- return ((XSDElementDeclaration) target).isElementDeclarationReference();
- }
-
- public Command getUpdateMaxOccursCommand(int maxOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMinOccursCommand(int minOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateNameCommand(String name)
- {
- return new UpdateNameCommand(Messages._UI_ACTION_UPDATE_NAME, getXSDElementDeclaration().getResolvedElementDeclaration(), name);
- }
-
- public Command getUpdateTypeNameCommand(String typeName, String quailifier)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getDeleteCommand()
- {
- // TODO Auto-generated method stub
- return new DeleteCommand("", getXSDElementDeclaration()); //$NON-NLS-1$
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
- if (!isGlobal())
- list.add(AddXSDElementAction.ID);
-
- list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_TYPE);
- list.add(SetTypeAction.SET_NEW_TYPE_ID);
- list.add(SetTypeAction.SELECT_EXISTING_TYPE_ID);
- list.add(BaseSelectionAction.SUBMENU_END_ID);
-
- list.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_MULTIPLICITY);
- list.add(SetMultiplicityAction.REQUIRED_ID);
- list.add(SetMultiplicityAction.ZERO_OR_ONE_ID);
- list.add(SetMultiplicityAction.ZERO_OR_MORE_ID);
- list.add(SetMultiplicityAction.ONE_OR_MORE_ID);
- list.add(BaseSelectionAction.SUBMENU_END_ID);
-
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(DeleteAction.ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
- return (String [])list.toArray(new String[0]);
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDElementDeclaration().getSchema());
- return (IModel)adapter;
- }
-
- public boolean isFocusAllowed()
- {
- return isGlobal();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEmptyFieldAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEmptyFieldAdapter.java
deleted file mode 100644
index 7e9b8fc997..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEmptyFieldAdapter.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-
-/**
- * @deprecated not used
- */
-public class XSDEmptyFieldAdapter extends XSDBaseAdapter implements IField
-{
- String kind;
- public XSDEmptyFieldAdapter()
- {
- super();
- }
-
- public String getKind()
- {
- return kind;
- }
-
- public void setKind(String kind)
- {
- this.kind = kind;
- }
-
- public String getName()
- {
- return null;
- }
-
- public String getTypeName()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTypeNameQualifier()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IType getType()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int getMinOccurs()
- {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public int getMaxOccurs()
- {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public boolean isGlobal()
- {
- return false;
- }
-
- public Command getUpdateMinOccursCommand(int minOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMaxOccursCommand(int maxOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateTypeNameCommand(String typeName, String quailifier)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateNameCommand(String name)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getDeleteCommand()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IModel getModel()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isReference()
- {
- // TODO Auto-generated method stub
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java
deleted file mode 100644
index 09102c98a4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicityAction;
-import org.eclipse.wst.xsd.ui.internal.design.figures.ModelGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDModelGroupAdapter extends XSDParticleAdapter implements IActionProvider
-{
- XSDModelGroup getXSDModelGroup()
- {
- return (XSDModelGroup) target;
- }
-
- public XSDModelGroupAdapter()
- {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement#getImage()
- */
- public Image getImage()
- {
- XSDModelGroup xsdModelGroup = getXSDModelGroup();
- if (XSDCompositor.CHOICE_LITERAL == xsdModelGroup.getCompositor())
- {
- return ModelGroupFigure.CHOICE_ICON_IMAGE;
- }
- else if (XSDCompositor.ALL_LITERAL == xsdModelGroup.getCompositor())
- {
- return ModelGroupFigure.ALL_ICON_IMAGE;
- }
- else
- {
- return ModelGroupFigure.SEQUENCE_ICON_IMAGE;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement#getText()
- */
- public String getText()
- {
- XSDModelGroup xsdModelGroup = getXSDModelGroup();
-
- StringBuffer result = new StringBuffer();
- String name = xsdModelGroup.getCompositor().getName();
- if (name != null)
- {
- result.append(name);
- }
-
- Element element = xsdModelGroup.getElement();
-
- if (element != null)
- {
- boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
- boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-
- if (hasMinOccurs || hasMaxOccurs)
- {
- result.append(" ["); //$NON-NLS-1$
- if (hasMinOccurs)
- {
- int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs();
- if (min == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(min));
- }
- }
- else
- // print default
- {
- int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs();
- result.append(String.valueOf(min));
- }
- if (hasMaxOccurs)
- {
- int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs();
- result.append(".."); //$NON-NLS-1$
- if (max == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(max));
- }
- }
- else
- // print default
- {
- result.append(".."); //$NON-NLS-1$
- int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs();
- result.append(String.valueOf(max));
- }
- result.append("]"); //$NON-NLS-1$
- }
- }
- return result.toString();
- }
-
- public ITreeElement[] getChildren()
- {
- XSDModelGroup xsdModelGroup = getXSDModelGroup();
- List list = new ArrayList();
- for (Iterator i = xsdModelGroup.getContents().iterator(); i.hasNext(); )
- {
- Object object = i.next();
- XSDParticleContent particle = ((XSDParticle)object).getContent();
- if (particle instanceof XSDElementDeclaration)
- {
- list.add(particle);
- }
- else if (particle instanceof XSDWildcard)
- {
- list.add(particle);
- }
- else if (particle instanceof XSDModelGroup)
- {
- list.add(particle);
- }
- else if (particle instanceof XSDModelGroupDefinition)
- {
- //list.add(((XSDModelGroupDefinition)particle).getResolvedModelGroupDefinition());
- list.add(particle);
- }
- }
-
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return (ITreeElement []) adapterList.toArray(new ITreeElement[0]);
- }
-
- public Object getParent(Object object)
- {
- XSDModelGroup element = (XSDModelGroup) object;
- return element.getContainer();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider#getActions(java.lang.Object)
- */
- public String[] getActions(Object object)
- {
- Collection actionIDs = new ArrayList();
- actionIDs.add(AddXSDElementAction.ID);
- actionIDs.add(AddXSDElementAction.REF_ID);
- actionIDs.add(AddXSDAnyElementAction.ID);
- // Add Element Ref
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(AddXSDModelGroupAction.SEQUENCE_ID);
- actionIDs.add(AddXSDModelGroupAction.CHOICE_ID);
- actionIDs.add(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITIONREF_ID);
-// actionIDs.add(AddFieldAction.ID);
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- // Add Any
-
- actionIDs.add(BaseSelectionAction.SUBMENU_START_ID + Messages._UI_ACTION_SET_MULTIPLICITY);
- actionIDs.add(SetMultiplicityAction.REQUIRED_ID);
- actionIDs.add(SetMultiplicityAction.ZERO_OR_ONE_ID);
- actionIDs.add(SetMultiplicityAction.ZERO_OR_MORE_ID);
- actionIDs.add(SetMultiplicityAction.ONE_OR_MORE_ID);
- actionIDs.add(BaseSelectionAction.SUBMENU_END_ID);
-
- if (!(getParent(target) instanceof XSDModelGroupDefinition))
- {
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
- }
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(ShowPropertiesViewAction.ID);
-
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public int getMaxOccurs()
- {
- return getMaxOccurs(getXSDModelGroup());
- }
-
- public int getMinOccurs()
- {
- return getMinOccurs(getXSDModelGroup());
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java
deleted file mode 100644
index 672303d8ea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class XSDModelGroupDefinitionAdapter extends XSDBaseAdapter implements IStructure, IActionProvider, IGraphElement, IADTObjectListener
-{
- public static final Image MODEL_GROUP_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDGroup.gif"); //$NON-NLS-1$
- public static final Image MODEL_GROUP_DISABLED_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDGroupdis.gif"); //$NON-NLS-1$
- public static final Image MODEL_GROUP_REF_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDGroupRef.gif"); //$NON-NLS-1$
- public static final Image MODEL_GROUP_REF_DISABLED_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDGroupRefdis.gif"); //$NON-NLS-1$
-
- protected List fields = null;
- protected List otherThingsToListenTo = null;
-
- public XSDModelGroupDefinitionAdapter()
- {
- super();
- }
-
- public XSDModelGroupDefinition getXSDModelGroupDefinition()
- {
- return (XSDModelGroupDefinition) target;
- }
-
- public Image getImage()
- {
- XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
-
- if (xsdModelGroupDefinition.isModelGroupDefinitionReference())
- {
- if (isReadOnly())
- {
- return MODEL_GROUP_REF_DISABLED_ICON;
- }
- return MODEL_GROUP_REF_ICON;
- }
- else
- {
- if (isReadOnly())
- {
- return MODEL_GROUP_DISABLED_ICON;
- }
- return MODEL_GROUP_ICON;
- }
- }
-
- public String getText()
- {
- XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
- String result = xsdModelGroupDefinition.isModelGroupDefinitionReference() ? xsdModelGroupDefinition.getQName() : xsdModelGroupDefinition.getName();
- return result == null ? Messages._UI_LABEL_ABSENT : result;
- }
-
- public ITreeElement[] getChildren()
- {
- List list = new ArrayList();
- XSDModelGroup xsdModelGroup = ((XSDModelGroupDefinition) target).getResolvedModelGroupDefinition().getModelGroup();
- if (xsdModelGroup != null)
- list.add(xsdModelGroup);
-
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider#getActions(java.lang.Object)
- */
- public String[] getActions(Object object)
- {
- Collection list = new ArrayList();
-
- if (!getXSDModelGroupDefinition().isModelGroupDefinitionReference())
- {
- list.add(AddXSDElementAction.ID);
- list.add(AddXSDElementAction.REF_ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(AddXSDModelGroupAction.SEQUENCE_ID);
- list.add(AddXSDModelGroupAction.CHOICE_ID);
- }
-
- list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
- return (String [])list.toArray(new String[0]);
- }
-
- public Command getAddNewFieldCommand(String fieldKind)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getDeleteCommand()
- {
- return new DeleteCommand("", getXSDModelGroupDefinition()); //$NON-NLS-1$
- }
-
- // TODO Common this up with XSDComplexType's. See also getFields
- protected void clearFields()
- {
- if (otherThingsToListenTo != null)
- {
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IADTObject)
- {
- IADTObject adtObject = (IADTObject) adapter;
- adtObject.unregisterListener(this);
- }
- }
- }
- fields = null;
- otherThingsToListenTo = null;
- }
-
- public List getFields()
- {
- List fields = new ArrayList();
- otherThingsToListenTo = new ArrayList();
- XSDVisitorForFields visitor = new XSDVisitorForFields();
- visitor.visitModelGroupDefinition(getXSDModelGroupDefinition());
- populateAdapterList(visitor.concreteComponentList, fields);
-
- // TODO (cs) common a base class for a structure thingee
- //
- populateAdapterList(visitor.thingsWeNeedToListenTo, otherThingsToListenTo);
- for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext();)
- {
- Adapter adapter = (Adapter) i.next();
- if (adapter instanceof IADTObject)
- {
- IADTObject adtObject = (IADTObject) adapter;
- adtObject.registerListener(this);
- }
- }
- return fields;
- }
-
- public IModel getModel()
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(getXSDModelGroupDefinition().getSchema());
- return (IModel)adapter;
- }
- public String getName()
- {
- return getText();
- }
-
- public boolean isFocusAllowed()
- {
- XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition) target;
- if (xsdModelGroupDefinition.isModelGroupDefinitionReference())
- {
- return false;
- }
- return true;
- }
-
- public void propertyChanged(Object object, String property)
- {
- clearFields();
- notifyListeners(this, null);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDParticleAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDParticleAdapter.java
deleted file mode 100644
index a26649ce7a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDParticleAdapter.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import org.eclipse.wst.xsd.ui.internal.adt.design.IAnnotationProvider;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-
-public class XSDParticleAdapter extends XSDBaseAdapter implements IAnnotationProvider
-{
- public XSDParticleAdapter()
- {
- super();
- }
-
- public int getMaxOccurs()
- {
- return getMaxOccurs((XSDConcreteComponent) target);
- }
-
- public int getMinOccurs()
- {
- return getMinOccurs((XSDConcreteComponent) target);
- }
-
- public static int getMinOccurs(XSDConcreteComponent component)
- {
- int minOccur = -2;
- if (component != null)
- {
- Object o = component.getContainer();
- if (o instanceof XSDParticle)
- {
- if (((XSDParticle) o).isSetMinOccurs())
- {
- try
- {
- minOccur = ((XSDParticle) o).getMinOccurs();
- }
- catch (Exception e)
- {
- }
- }
- }
- }
- return minOccur;
- }
-
- public static int getMaxOccurs(XSDConcreteComponent component)
- {
- int maxOccur = -2;
- if (component != null)
- {
- Object o = component.getContainer();
- if (o instanceof XSDParticle)
- {
- if (((XSDParticle) o).isSetMaxOccurs())
- {
- try
- {
- maxOccur = ((XSDParticle) o).getMaxOccurs();
- }
- catch (Exception e)
- {
- }
- }
- }
- }
- return maxOccur;
- }
-
- public String getNameAnnotationString()
- {
- return buildAnnotationString(true);
- }
-
- public String getNameAnnotationToolTipString()
- {
- return buildAnnotationString(false);
- }
-
- public String getTypeAnnotationString()
- {
- return null;
- }
-
- public String getTypeAnnotationToolTipString()
- {
- return null;
- }
-
- protected String buildAnnotationString(boolean isForLabel)
- {
- String occurenceDescription = ""; //$NON-NLS-1$
- String toolTipDescription = ""; //$NON-NLS-1$
- // TODO: set int values as defined constants
- // -2 means the user didn't specify (so the default is 1)
- int minOccurs = getMinOccurs();
- int maxOccurs = getMaxOccurs();
-
- // This is for the attribute field case, which has no
- // occurrence attributes
- if (minOccurs == -3 && maxOccurs == -3)
- {
- occurenceDescription = ""; //$NON-NLS-1$
- }
- else if (minOccurs == 0 && (maxOccurs == -2 || maxOccurs == 1))
- {
- occurenceDescription = "[0..1]"; //$NON-NLS-1$
- toolTipDescription = Messages._UI_LABEL_OPTIONAL;
- }
- else if (minOccurs == 0 && maxOccurs == -1)
- {
- occurenceDescription = "[0..*]"; //$NON-NLS-1$
- toolTipDescription = Messages._UI_LABEL_ZERO_OR_MORE;
- }
- else if ((minOccurs == 1 && maxOccurs == -1) || (minOccurs == -2 && maxOccurs == -1))
- {
- occurenceDescription = "[1..*]"; //$NON-NLS-1$
- toolTipDescription = Messages._UI_LABEL_ONE_OR_MORE;
- }
- else if ((minOccurs == 1 && maxOccurs == 1) || (minOccurs == -2 && maxOccurs == 1) || (minOccurs == 1 && maxOccurs == -2))
- {
- occurenceDescription = "[1..1]"; //$NON-NLS-1$
- toolTipDescription = Messages._UI_LABEL_REQUIRED;
- }
- else if (minOccurs == -2 && maxOccurs == -2)
- {
- occurenceDescription = ""; //$NON-NLS-1$
- // none specified, so don't have any toolTip description
- }
- else
- {
- if (maxOccurs == -2)
- maxOccurs = 1;
- String maxSymbol = maxOccurs == -1 ? "*" : "" + maxOccurs; //$NON-NLS-1$ //$NON-NLS-2$
- String minSymbol = minOccurs == -2 ? "1" : "" + minOccurs; //$NON-NLS-1$ //$NON-NLS-2$
- occurenceDescription = "[" + minSymbol + ".." + maxSymbol + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- toolTipDescription = Messages._UI_LABEL_ARRAY;
- }
-
- if (isForLabel)
- {
- return occurenceDescription;
- }
- else
- {
- return toolTipDescription;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java
deleted file mode 100644
index 5d316de0bd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.NotificationImpl;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDComplexTypeDefinitionAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDPackage;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSchemaAdapter extends XSDBaseAdapter implements IActionProvider, IModel, IADTObjectListener
-{
- protected List types = null;
- protected List children, allChildren;
-
- protected CategoryAdapter fDirectivesCategory;
- protected CategoryAdapter fElementsCategory;
- protected CategoryAdapter fAttributesCategory;
- protected CategoryAdapter fTypesCategory;
- protected CategoryAdapter fGroupsCategory;
-
- /**
- * Create all the category adapters
- *
- * @param xsdSchema
- */
- protected void createCategoryAdapters(XSDSchema xsdSchema)
- {
- List directivesList = getDirectives(xsdSchema);
- List elementsList = getGlobalElements(xsdSchema);
- List attributesList = getAttributeList(xsdSchema);
- List groups = getGroups(xsdSchema);
- List types = getComplexTypes(xsdSchema);
- types.addAll(getSimpleTypes(xsdSchema));
-
- fDirectivesCategory = new CategoryAdapter(Messages._UI_GRAPH_DIRECTIVES, XSDEditorPlugin.getDefault().getIconImage("obj16/directivesheader"), directivesList, xsdSchema, CategoryAdapter.DIRECTIVES); //$NON-NLS-1$
- fDirectivesCategory.setAllChildren(directivesList);
- registerListener(fDirectivesCategory);
-
- fElementsCategory = new CategoryAdapter(Messages._UI_GRAPH_ELEMENTS, XSDEditorPlugin.getDefault().getIconImage("obj16/elementsheader"), elementsList, xsdSchema, CategoryAdapter.ELEMENTS); //$NON-NLS-1$
- fElementsCategory.setAllChildren(getGlobalElements(xsdSchema, true));
- registerListener(fElementsCategory);
-
- fAttributesCategory = new CategoryAdapter(Messages._UI_GRAPH_ATTRIBUTES, XSDEditorPlugin.getDefault().getIconImage("obj16/attributesheader"), attributesList, xsdSchema, CategoryAdapter.ATTRIBUTES); //$NON-NLS-1$
- fAttributesCategory.setAllChildren(attributesList);
- registerListener(fAttributesCategory);
-
- fTypesCategory = new CategoryAdapter(Messages._UI_GRAPH_TYPES, XSDEditorPlugin.getDefault().getIconImage("obj16/typesheader"), types, xsdSchema, CategoryAdapter.TYPES); //$NON-NLS-1$
- fTypesCategory.setAllChildren(getTypes(xsdSchema, true));
- registerListener(fTypesCategory);
-
- fGroupsCategory = new CategoryAdapter(Messages._UI_GRAPH_GROUPS, XSDEditorPlugin.getDefault().getIconImage("obj16/groupsheader"), groups, xsdSchema, CategoryAdapter.GROUPS); //$NON-NLS-1$
- fGroupsCategory.setAllChildren(groups);
- registerListener(fGroupsCategory);
- }
-
- public List getTypes()
- {
- if (types == null)
- {
- types = new ArrayList();
- XSDSchema schema = (XSDSchema) target;
- List concreteComponentList = new ArrayList();
- for (Iterator i = schema.getContents().iterator(); i.hasNext();)
- {
- XSDConcreteComponent component = (XSDConcreteComponent) i.next();
- if (component instanceof XSDTypeDefinition)
- {
- concreteComponentList.add(component);
- }
- }
- populateAdapterList(concreteComponentList, types);
- }
- return types;
- }
-
- protected boolean isSameNamespace(String ns1, String ns2)
- {
- if (ns1 == null) ns1 = "";
- if (ns2 == null) ns2 = "";
-
- if (ns1.equals(ns2))
- {
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement#getChildren()
- */
- public ITreeElement[] getChildren()
- {
- XSDSchema xsdSchema = (XSDSchema) getTarget();
-
- children = new ArrayList();
-
- // just set categoryadapters' children if category adapters are
- // already created
- if (fDirectivesCategory != null)
- {
- List directivesList = getDirectives(xsdSchema);
- List elementsList = getGlobalElements(xsdSchema);
- List attributesList = getAttributeList(xsdSchema);
- List groups = getGroups(xsdSchema);
- List types = getComplexTypes(xsdSchema);
- types.addAll(getSimpleTypes(xsdSchema));
-
- fDirectivesCategory.setChildren(directivesList);
- fDirectivesCategory.setAllChildren(directivesList);
- fElementsCategory.setChildren(elementsList);
- fElementsCategory.setAllChildren(getGlobalElements(xsdSchema, true));
- fAttributesCategory.setChildren(attributesList);
- fAttributesCategory.setAllChildren(getAttributeList(xsdSchema, true));
- fTypesCategory.setChildren(types);
- fTypesCategory.setAllChildren(getTypes(xsdSchema, true));
- fGroupsCategory.setChildren(groups);
- fGroupsCategory.setAllChildren(getGroups(xsdSchema, true));
- }
- else
- {
- createCategoryAdapters(xsdSchema);
- }
-
- children.add(fDirectivesCategory);
- children.add(fElementsCategory);
- children.add(fAttributesCategory);
- children.add(fTypesCategory);
- children.add(fGroupsCategory);
-
- return (ITreeElement[]) children.toArray(new ITreeElement[0]);
- }
-
- public void notifyChanged(final Notification msg)
- {
- class CategoryNotification extends NotificationImpl
- {
- protected Object category;
-
- public CategoryNotification(Object category)
- {
- super(msg.getEventType(), msg.getOldValue(), msg.getNewValue(), msg.getPosition());
- this.category = category;
- }
-
- public Object getNotifier()
- {
- return category;
- }
-
- public Object getFeature()
- {
- return msg.getFeature();
- }
- }
-
- if (children == null)
- {
- getChildren();
- }
-
- Object newValue = msg.getNewValue();
- if (newValue instanceof XSDInclude || newValue instanceof XSDImport || newValue instanceof XSDRedefine ||
- (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_Contents() && msg.getOldValue() instanceof XSDSchemaDirective)) // handle the case for delete directive
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.DIRECTIVES);
- Assert.isTrue(adapter != null);
- XSDSchema xsdSchema = adapter.getXSDSchema();
- adapter.setChildren(getDirectives(xsdSchema));
- adapter.setAllChildren(getDirectives(xsdSchema));
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_ElementDeclarations())
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.ELEMENTS);
- Assert.isTrue(adapter != null);
- XSDSchema xsdSchema = adapter.getXSDSchema();
- adapter.setChildren(getGlobalElements(xsdSchema));
- adapter.setAllChildren(getGlobalElements(xsdSchema, true));
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_AttributeDeclarations() ||
- msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_AttributeGroupDefinitions())
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.ATTRIBUTES);
- Assert.isTrue(adapter != null);
- XSDSchema xsdSchema = adapter.getXSDSchema();
- adapter.setChildren(getAttributeList(xsdSchema));
- adapter.setAllChildren(getAttributeList(xsdSchema, true));
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_TypeDefinitions())
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.TYPES);
- Assert.isTrue(adapter != null);
- XSDSchema xsdSchema = adapter.getXSDSchema();
- List types = getComplexTypes(xsdSchema);
- types.addAll(getSimpleTypes(xsdSchema));
-
- adapter.setChildren(types);
- adapter.setAllChildren(getTypes(xsdSchema, true));
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_ModelGroupDefinitions())
- {
- CategoryAdapter adapter = getCategory(CategoryAdapter.GROUPS);
- Assert.isTrue(adapter != null);
- XSDSchema xsdSchema = adapter.getXSDSchema();
- adapter.setChildren(getGroups(xsdSchema));
- adapter.setAllChildren(getGroups(xsdSchema, true));
- notifyListeners(new CategoryNotification(adapter), adapter.getText());
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_Annotations())
- {
- return;
- }
- else if (msg.getFeature() == XSDPackage.eINSTANCE.getXSDSchema_SchemaLocation())
- {
- notifyListeners(msg, null);
- return;
- }
-
- types = null;
- getTypes();
-
- super.notifyChanged(msg);
- }
-
- public void updateCategories()
- {
- // TODO: revisit this
- getChildren();
- }
-
- public CategoryAdapter getCategory(int category)
- {
- if (children == null) updateCategories(); // init categories
- int length = children.size();
- CategoryAdapter adapter = null;
- for (int i = 0; i < length; i++)
- {
- adapter = (CategoryAdapter) children.get(i);
- if (adapter.getGroupType() == category)
- {
- break;
- }
- }
- return adapter;
- }
-
- protected List getDirectives(XSDSchema schema)
- {
- List list = new ArrayList();
- for (Iterator i = schema.getContents().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof XSDSchemaDirective)
- {
- list.add(o);
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-
- protected List getGlobalElements(XSDSchema schema, boolean showFromIncludes)
- {
- List elements = schema.getElementDeclarations();
- List list = new ArrayList();
- for (Iterator i = elements.iterator(); i.hasNext();)
- {
- XSDElementDeclaration elem = (XSDElementDeclaration) i.next();
- if (isSameNamespace(elem.getTargetNamespace(),schema.getTargetNamespace()) && (elem.getRootContainer() == schema || showFromIncludes))
- {
- list.add(elem);
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-
- protected List getGlobalElements(XSDSchema schema)
- {
- return getGlobalElements(schema, false);
- }
-
- /**
- * @param schema
- * @return
- */
- protected List getComplexTypes(XSDSchema schema, boolean showFromIncludes)
- {
- List allTypes = schema.getTypeDefinitions();
- List list = new ArrayList();
- for (Iterator i = allTypes.iterator(); i.hasNext();)
- {
- XSDTypeDefinition td = (XSDTypeDefinition) i.next();
- if (td instanceof XSDComplexTypeDefinition)
- {
- XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) td;
- if (isSameNamespace(ct.getTargetNamespace(),schema.getTargetNamespace()) && (ct.getRootContainer() == schema || showFromIncludes))
- {
- list.add(ct);
- }
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-
- protected List getComplexTypes(XSDSchema schema)
- {
- return getComplexTypes(schema, false);
- }
-
- protected List getTypes(XSDSchema schema, boolean showFromIncludes)
- {
- List list = getComplexTypes(schema, showFromIncludes);
- list.addAll(getSimpleTypes(schema, showFromIncludes));
- return list;
- }
-
- protected List getAttributeGroupList(XSDSchema xsdSchema, boolean showFromIncludes)
- {
- List attributeGroupList = new ArrayList();
- for (Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator(); i.hasNext();)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) i.next();
- if (isSameNamespace(attrGroup.getTargetNamespace(), xsdSchema.getTargetNamespace()) && (attrGroup.getRootContainer() == xsdSchema || showFromIncludes))
- {
- attributeGroupList.add(attrGroup);
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(attributeGroupList, adapterList);
- return adapterList;
- }
-
- protected List getAttributeGroupList(XSDSchema xsdSchema)
- {
- return getAttributeGroupList(xsdSchema, false);
- }
-
- protected List getAttributeList(XSDSchema xsdSchema, boolean showFromIncludes)
- {
- List attributesList = new ArrayList();
- for (Iterator iter = xsdSchema.getAttributeDeclarations().iterator(); iter.hasNext();)
- {
- Object o = iter.next();
- if (o instanceof XSDAttributeDeclaration)
- {
- XSDAttributeDeclaration attr = (XSDAttributeDeclaration) o;
- if (attr != null)
- {
- if (attr.getTargetNamespace() != null)
- {
- if (!(attr.getTargetNamespace().equals(XSDConstants.SCHEMA_INSTANCE_URI_2001)))
- {
- if (isSameNamespace(attr.getTargetNamespace(), xsdSchema.getTargetNamespace()) && (attr.getRootContainer() == xsdSchema || showFromIncludes))
- {
- attributesList.add(attr);
- }
- }
- }
- else
- {
- if (isSameNamespace(attr.getTargetNamespace(), xsdSchema.getTargetNamespace()) && (attr.getRootContainer() == xsdSchema || showFromIncludes))
- {
- attributesList.add(attr);
- }
- }
- }
- }
- }
-
- attributesList.addAll(getAttributeGroupList(xsdSchema, showFromIncludes));
-
- List adapterList = new ArrayList();
- populateAdapterList(attributesList, adapterList);
- return adapterList;
- }
-
- protected List getAttributeList(XSDSchema xsdSchema)
- {
- return getAttributeList(xsdSchema, false);
- }
-
- protected List getSimpleTypes(XSDSchema schema, boolean showFromIncludes)
- {
- List allTypes = schema.getTypeDefinitions();
- List list = new ArrayList();
- for (Iterator i = allTypes.iterator(); i.hasNext();)
- {
- XSDTypeDefinition td = (XSDTypeDefinition) i.next();
- if (td instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) td;
- if (isSameNamespace(st.getTargetNamespace(),schema.getTargetNamespace()) && (st.getRootContainer() == schema || showFromIncludes))
- {
- list.add(st);
- }
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-
- protected List getSimpleTypes(XSDSchema schema)
- {
- return getSimpleTypes(schema, false);
- }
-
- protected List getGroups(XSDSchema schema, boolean showFromIncludes)
- {
- List groups = schema.getModelGroupDefinitions();
- List list = new ArrayList();
- for (Iterator i = groups.iterator(); i.hasNext();)
- {
- XSDModelGroupDefinition group = (XSDModelGroupDefinition) i.next();
- if (isSameNamespace(group.getTargetNamespace(),schema.getTargetNamespace()) && (group.getRootContainer() == schema || showFromIncludes))
- {
- list.add(group);
- }
- }
- List adapterList = new ArrayList();
- populateAdapterList(list, adapterList);
- return adapterList;
- }
-
- protected List getGroups(XSDSchema schema)
- {
- return getGroups(schema, false);
- }
-
- public String[] getActions(Object object)
- {
- Collection actionIDs = new ArrayList();
- actionIDs.add(AddXSDElementAction.ID);
- actionIDs.add(AddXSDComplexTypeDefinitionAction.ID);
-
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(ShowPropertiesViewAction.ID);
- return (String [])actionIDs.toArray(new String[0]);
- }
-
- public void propertyChanged(Object object, String property)
- {
- notifyListeners(object, property);
- }
-
- public Image getImage()
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDFile.gif"); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
deleted file mode 100644
index f162c49e12..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSimpleTypeDefinitionAdapter extends XSDTypeDefinitionAdapter
-{
- public Image getImage()
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/simpletypedis_obj.gif"); //$NON-NLS-1$
- }
- return XSDEditorPlugin.getPlugin().getIcon("obj16/simpletype_obj.gif"); //$NON-NLS-1$
- }
-
- public String getDisplayName()
- {
- XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
- return (xsdSimpleTypeDefinition.getName() == null ? Messages._UI_LABEL_LOCAL_TYPE : xsdSimpleTypeDefinition.getName());
- }
-
- public String getText()
- {
- return getText(true);
- }
-
- public String getText(boolean showType)
- {
- XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
-
- StringBuffer result = new StringBuffer();
-
- result.append(xsdSimpleTypeDefinition.getName() == null ? Messages._UI_LABEL_LOCAL_TYPE : xsdSimpleTypeDefinition.getName());
-
- if (showType)
- {
- XSDSimpleTypeDefinition baseTypeDefinition = xsdSimpleTypeDefinition.getBaseTypeDefinition();
- if (baseTypeDefinition != null && XSDVariety.ATOMIC_LITERAL == xsdSimpleTypeDefinition.getVariety())
- {
- if (baseTypeDefinition.getName() != null && !xsdSimpleTypeDefinition.getContents().contains(baseTypeDefinition) && !XSDConstants.isAnySimpleType(baseTypeDefinition))
- {
- result.append(" : "); //$NON-NLS-1$
- result.append(baseTypeDefinition.getQName(xsdSimpleTypeDefinition));
- }
- }
- else
- {
- XSDSimpleTypeDefinition itemTypeDefinition = xsdSimpleTypeDefinition.getItemTypeDefinition();
- if (itemTypeDefinition != null)
- {
- if (itemTypeDefinition.getName() != null)
- {
- result.append(" : "); //$NON-NLS-1$
- result.append(itemTypeDefinition.getQName(xsdSimpleTypeDefinition));
- }
- }
- else
- {
- List memberTypeDefinitions = xsdSimpleTypeDefinition.getMemberTypeDefinitions();
- if (!memberTypeDefinitions.isEmpty())
- {
- boolean first = true;
- for (Iterator members = memberTypeDefinitions.iterator(); members.hasNext();)
- {
- XSDSimpleTypeDefinition memberTypeDefinition = (XSDSimpleTypeDefinition) members.next();
- if (memberTypeDefinition.getName() != null)
- {
- if (first)
- {
- result.append(" : "); //$NON-NLS-1$
- first = false;
- }
- else
- {
- result.append(" | "); //$NON-NLS-1$
- }
- result.append(memberTypeDefinition.getQName(xsdSimpleTypeDefinition));
- }
- else
- {
- break;
- }
- }
- }
- else if (result.length() == 0)
- {
- result.append(Messages._UI_LABEL_ABSENT);
- }
- }
- }
- }
-
- return result.toString();
- }
-
- public boolean hasChildren()
- {
- return false;
- }
-
- public boolean isComplexType()
- {
- return false;
- }
-
- public boolean isFocusAllowed()
- {
- XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
- if (XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace()))
- {
- return false;
- }
- if (xsdSimpleTypeDefinition.getName() == null)
- {
- return false;
- }
- return true;
- }
-
- public String[] getActions(Object object)
- {
- List list = new ArrayList();
- list.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
- list.add(BaseSelectionAction.SEPARATOR_ID);
- list.add(ShowPropertiesViewAction.ID);
-
- return (String [])list.toArray(new String[0]);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java
deleted file mode 100644
index 1ea41b8d9a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-public abstract class XSDTypeDefinitionAdapter extends XSDBaseAdapter implements IType, IActionProvider, IGraphElement
-{
- public XSDTypeDefinition getXSDTypeDefinition()
- {
- return (XSDTypeDefinition)target;
- }
-
- public String getName()
- {
- if (getXSDTypeDefinition().eContainer() instanceof XSDSchema)
- {
- return getXSDTypeDefinition().getName();
- }
- else
- {
- EObject o = getXSDTypeDefinition().eContainer();
- if (o instanceof XSDNamedComponent)
- {
- XSDNamedComponent ed = (XSDNamedComponent)o;
- return "(" + ed.getName() + "Type)"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return null;
- }
-
- public String getQualifier()
- {
- return getXSDTypeDefinition().getTargetNamespace();
- }
-
- public IType getSuperType()
- {
- XSDTypeDefinition td = getXSDTypeDefinition().getBaseType();
- return td != null ? (IType)XSDAdapterFactory.getInstance().adapt(td) : null;
- }
-
- public Command getUpdateNameCommand(String newName)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isComplexType()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java
deleted file mode 100644
index 82541fee81..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.Iterator;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitor
-{
- public XSDVisitor()
- {
- }
-
- protected XSDSchema schema;
-
- public void visitSchema(XSDSchema schema)
- {
- this.schema = schema;
- for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
- {
- XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
- visitAttributeDeclaration(attr);
- }
- for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
- {
- XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
- visitTypeDefinition(type);
- }
- for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
- {
- XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
- visitElementDeclaration(element);
- }
- for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
- {
- XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
- visitIdentityConstraintDefinition(identityConstraint);
- }
- for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
- visitModelGroupDefinition(modelGroup);
- }
- for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
- visitAttributeGroupDefinition(attributeGroup);
- }
- for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
- {
- XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
- visitNotationDeclaration(element);
- }
-
- }
-
- public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
- {
- }
-
- public void visitTypeDefinition(XSDTypeDefinition type)
- {
- if (type instanceof XSDSimpleTypeDefinition)
- {
- visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
- }
- else if (type instanceof XSDComplexTypeDefinition)
- {
- visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
- }
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- if (element.isElementDeclarationReference())
- {
- visitElementDeclaration(element.getResolvedElementDeclaration());
- }
- else if (element.getAnonymousTypeDefinition() != null)
- {
- visitTypeDefinition(element.getAnonymousTypeDefinition());
- }
- }
-
- public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
- {
- }
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
- {
- if (!modelGroupDef.isModelGroupDefinitionReference())
- {
- if (modelGroupDef.getModelGroup() != null)
- {
- visitModelGroup(modelGroupDef.getModelGroup());
- }
- }
- else
- {
- XSDModelGroup modelGroup = modelGroupDef.getResolvedModelGroupDefinition().getModelGroup();
- if (modelGroup != null)
- {
- visitModelGroup(modelGroup);
- }
- }
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o instanceof XSDAttributeUse)
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)o;
- visitAttributeDeclaration(attrUse.getContent());
- }
- else if (o instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o;
- visitAttributeGroupDefinition(attrGroup.getResolvedAttributeGroupDefinition());
- }
- }
- }
-
- public void visitNotationDeclaration(XSDNotationDeclaration notation)
- {
- }
-
- public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
- {
- }
-
- public void visitComplexTypeContent(XSDSimpleTypeDefinition content)
- {
-
- }
-
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- if (type.getContent() != null)
- {
- XSDComplexTypeContent complexContent = type.getContent();
- if (complexContent instanceof XSDSimpleTypeDefinition)
- {
- visitComplexTypeContent((XSDSimpleTypeDefinition)complexContent);
- }
- else if (complexContent instanceof XSDParticle)
- {
- visitParticle((XSDParticle) complexContent);
- }
- }
- }
-
- public void visitParticle(XSDParticle particle)
- {
- visitParticleContent(particle.getContent());
- }
-
- public void visitParticleContent(XSDParticleContent particleContent)
- {
- if (particleContent instanceof XSDModelGroupDefinition)
- {
- visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
- }
- else if (particleContent instanceof XSDModelGroup)
- {
- visitModelGroup((XSDModelGroup)particleContent);
- }
- else if (particleContent instanceof XSDElementDeclaration)
- {
- visitElementDeclaration((XSDElementDeclaration)particleContent);
- }
- else if (particleContent instanceof XSDWildcard)
- {
- visitWildcard((XSDWildcard)particleContent);
- }
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- if (modelGroup.getContents() != null)
- {
- for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
- {
- XSDParticle particle = (XSDParticle) iterator.next();
- visitParticle(particle);
- }
- }
- }
-
- public void visitWildcard(XSDWildcard wildcard)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java
deleted file mode 100644
index 081788de7f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitorForFields extends XSDVisitor
-{
- public XSDVisitorForFields()
- {
- }
-
- public List concreteComponentList = new ArrayList();
- public List thingsWeNeedToListenTo = new ArrayList();
-
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- if (type.getAttributeContents() != null)
- {
- for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next();
- if (attrGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent;
-
- visitAttributeDeclaration(attrUse.getContent());
-
-// if (attrUse.getAttributeDeclaration() != attrUse.getContent())
-// {
-// visitAttributeDeclaration(attrUse.getContent());
-// }
-// else
-// {
-// thingsWeNeedToListenTo.add(attrUse.getAttributeDeclaration());
-// concreteComponentList.add(attrUse.getAttributeDeclaration());
-// }
- }
- else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)attrGroupContent;
- thingsWeNeedToListenTo.add(attrGroup);
- if (attrGroup.isAttributeGroupDefinitionReference())
- {
- attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
- visitAttributeGroupDefinition(attrGroup);
- }
- }
- }
- }
- if (type.getAttributeWildcard() != null)
- {
- thingsWeNeedToListenTo.add(type.getAttributeWildcard());
- concreteComponentList.add(type.getAttributeWildcard());
- }
- super.visitComplexTypeDefinition(type);
- }
-
- public void visitComplexTypeContent(XSDSimpleTypeDefinition content)
- {
- thingsWeNeedToListenTo.add(content);
-
- super.visitComplexTypeContent(content);
- }
-
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
- {
- if (modelGroupDef.isModelGroupDefinitionReference())
- {
- // if it's a reference we need to listen to the reference incase it changes
- thingsWeNeedToListenTo.add(modelGroupDef);
- }
- // listen to definition incase it changes
- XSDModelGroupDefinition resolvedModelGroupDef = modelGroupDef.getResolvedModelGroupDefinition();
- thingsWeNeedToListenTo.add(resolvedModelGroupDef);
- super.visitModelGroupDefinition(modelGroupDef);
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- super.visitModelGroup(modelGroup);
- thingsWeNeedToListenTo.add(modelGroup);
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o instanceof XSDAttributeUse)
- {
- XSDAttributeUse attributeUse = (XSDAttributeUse)o;
- concreteComponentList.add(attributeUse.getAttributeDeclaration());
- thingsWeNeedToListenTo.add(attributeUse.getAttributeDeclaration());
- }
- else if (o instanceof XSDAttributeGroupDefinition)
- {
- XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o;
- thingsWeNeedToListenTo.add(attrGroup);
- if (attrGroup.isAttributeGroupDefinitionReference())
- {
- attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
- visitAttributeGroupDefinition(attrGroup);
- }
- }
- }
- }
-
- public void visitParticle(XSDParticle particle)
- {
- thingsWeNeedToListenTo.add(particle);
- super.visitParticle(particle);
- }
-
- public void visitWildcard(XSDWildcard wildcard)
- {
- concreteComponentList.add(wildcard);
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- if (element.isElementDeclarationReference())
- {
- thingsWeNeedToListenTo.add(element);
- thingsWeNeedToListenTo.add(element.getResolvedElementDeclaration());
- // now, add the reference as a field
- concreteComponentList.add(element);
- }
- else
- {
- concreteComponentList.add(element.getResolvedElementDeclaration());
- // note... we intentionally ommit the call to super.visitElementDeclaration()
- // since we don't want to delve down deeper than the element
- }
- }
-
- public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
- {
- if (attr.isAttributeDeclarationReference())
- {
- thingsWeNeedToListenTo.add(attr);
- thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration());
- concreteComponentList.add(attr);
- }
- else
- {
- concreteComponentList.add(attr.getResolvedAttributeDeclaration());
- thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration());
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java
deleted file mode 100644
index c94e915c68..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adapters;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDWildcard;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class XSDWildcardAdapter extends XSDParticleAdapter implements IField, IActionProvider
-{
-// public static final Image ANYELEMENT_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAny.gif"); //$NON-NLS-1$
-// public static final Image ANYELEMENT_DISABLED_ICON = XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAny.gif"); //$NON-NLS-1$
-
- public XSDWildcardAdapter()
- {
-
- }
-
- public Image getImage()
- {
- XSDWildcard xsdWildcard = (XSDWildcard) target;
-
- if (xsdWildcard.eContainer() instanceof XSDParticle)
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAnydis.gif"); //$NON-NLS-1$
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDAny.gif"); //$NON-NLS-1$
- }
- else
- {
- if (isReadOnly())
- {
- return XSDEditorPlugin.getPlugin().getIcon("obj16/XSDAnyAttributedis.gif"); //$NON-NLS-1$
- }
- return XSDEditorPlugin.getXSDImage("icons/XSDAnyAttribute.gif"); //$NON-NLS-1$
- }
- }
-
- public String getText()
- {
- XSDWildcard xsdWildcard = (XSDWildcard) target;
-
- StringBuffer result = new StringBuffer();
- Element element = xsdWildcard.getElement();
-
- if (element != null)
- {
- result.append(element.getNodeName());
- boolean hasMinOccurs = element.hasAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
- boolean hasMaxOccurs = element.hasAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
-
- if (hasMinOccurs || hasMaxOccurs)
- {
- result.append(" ["); //$NON-NLS-1$
- if (hasMinOccurs)
- {
-
- int min = ((XSDParticle) xsdWildcard.getContainer()).getMinOccurs();
- if (min == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(min));
- }
- }
- else
- // print default
- {
- int min = ((XSDParticle) xsdWildcard.getContainer()).getMinOccurs();
- result.append(String.valueOf(min));
- }
- if (hasMaxOccurs)
- {
- int max = ((XSDParticle) xsdWildcard.getContainer()).getMaxOccurs();
- result.append(".."); //$NON-NLS-1$
- if (max == XSDParticle.UNBOUNDED)
- {
- result.append("*"); //$NON-NLS-1$
- }
- else
- {
- result.append(String.valueOf(max));
- }
- }
- else
- // print default
- {
- result.append(".."); //$NON-NLS-1$
- int max = ((XSDParticle) xsdWildcard.getContainer()).getMaxOccurs();
- result.append(String.valueOf(max));
- }
- result.append("]"); //$NON-NLS-1$
- }
- }
- return result.toString();
-
- }
-
- public boolean hasChildren()
- {
- return false;
- }
-
- public Object getParent(Object object)
- {
- XSDWildcard xsdWildcard = (XSDWildcard) target;
- return xsdWildcard.getContainer();
- }
-
- public Command getDeleteCommand()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getKind()
- {
- XSDWildcard xsdWildcard = (XSDWildcard) target;
- if (xsdWildcard.eContainer() instanceof XSDParticle)
- {
- return "element"; //$NON-NLS-1$
- }
- return "attribute";
- }
-
- public IModel getModel()
- {
- return null;
- }
-
- public String getName()
- {
- XSDWildcard xsdWildcard = (XSDWildcard) target;
- if (xsdWildcard.eContainer() instanceof XSDParticle)
- {
- return "any"; //$NON-NLS-1$
- }
- return "anyAttribute"; //$NON-NLS-1$
- }
-
- public IType getType()
- {
- return null;
- }
-
- public String getTypeName()
- {
- return ""; //$NON-NLS-1$
- }
-
- public String getTypeNameQualifier()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMaxOccursCommand(int maxOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMinOccursCommand(int minOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateNameCommand(String name)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateTypeNameCommand(String typeName, String quailifier)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isGlobal()
- {
- return false;
- }
-
- public boolean isReference()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public String[] getActions(Object object)
- {
- Collection actionIDs = new ArrayList();
- actionIDs.add(DeleteXSDConcreteComponentAction.DELETE_XSD_COMPONENT_ID);
- actionIDs.add(BaseSelectionAction.SEPARATOR_ID);
- actionIDs.add(ShowPropertiesViewAction.ID);
- return (String [])actionIDs.toArray(new String[0]);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/DragAndDropCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/DragAndDropCommand.java
deleted file mode 100644
index 28f1f76d40..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/DragAndDropCommand.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
-import org.eclipse.wst.xsd.ui.internal.actions.MoveAction;
-import org.eclipse.wst.xsd.ui.internal.actions.MoveAttributeAction;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAttributeAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ComplexTypeEditPart;
-import org.eclipse.wst.xsd.ui.internal.common.commands.BaseCommand;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.AttributeGroupDefinitionEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.ConnectableEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.ModelGroupDefinitionReferenceEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.ModelGroupEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.TargetConnectionSpacingFigureEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDAttributesForAnnotationEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDBaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.XSDGroupsForAnnotationEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDModelGroup;
-
-// TODO : clean and common up code
-public class DragAndDropCommand extends BaseCommand
-{
- protected EditPartViewer viewer;
- protected ChangeBoundsRequest request;
- protected BaseFieldEditPart previousChildRefEditPart, nextChildRefEditPart;
- public ModelGroupEditPart parentEditPart;
- protected AttributeGroupDefinitionEditPart parentAttributeGroupEditPart;
- protected XSDConcreteComponent parentComponent;
- public Point location;
- protected MoveAction action;
- protected MoveAttributeAction moveAttributeAction;
- protected boolean canExecute, isElementToDrag;
- EditPart target;
- XSDBaseFieldEditPart selected;
- List modelGroupsList = new ArrayList();
- List targetSpacesList = new ArrayList();
- List attributeGroupsList = new ArrayList();
- XSDConcreteComponent previousRefComponent = null, nextRefComponent = null;
- ComplexTypeEditPart complexTypeEditPart;
-
- public DragAndDropCommand(EditPartViewer viewer, ChangeBoundsRequest request)
- {
- this.viewer = viewer;
- this.request = request;
- setup();
- }
-
- protected void setup()
- {
- location = request.getLocation();
- target = viewer.findObjectAt(location);
-
- if (viewer instanceof ScrollingGraphicalViewer)
- {
- ScrollingGraphicalViewer sgv = (ScrollingGraphicalViewer)viewer;
- Point p = ((FigureCanvas)sgv.getControl()).getViewport().getViewLocation();
- location.y += p.y;
- location.x += p.x;
- }
- List list = request.getEditParts();
- canExecute = false;
- // allow drag and drop of only one selected object
- if (list.size() == 1 && target instanceof BaseFieldEditPart)
- {
- List editPartsList = request.getEditParts();
- List concreteComponentList = new ArrayList(editPartsList.size());
- for (Iterator i = editPartsList.iterator(); i.hasNext(); )
- {
- EditPart editPart = (EditPart)i.next();
- concreteComponentList.add(((XSDBaseAdapter)editPart.getModel()).getTarget());
- }
-
- Object itemToDrag = list.get(0);
- if (itemToDrag instanceof XSDBaseFieldEditPart)
- {
- selected = (XSDBaseFieldEditPart) itemToDrag;
- if (selected.getModel() instanceof XSDElementDeclarationAdapter)
- {
- isElementToDrag = true;
- }
- else if (selected.getModel() instanceof XSDBaseAttributeAdapter)
- {
- isElementToDrag = false;
- }
- else
- {
- return;
- }
-
- if (!isElementToDrag)
- {
- XSDAttributeGroupDefinition attributeGroup = null;
- attributeGroupsList.clear();
- targetSpacesList.clear();
- parentAttributeGroupEditPart = null;
- calculateAttributeGroupList();
- EditPart compartment = target.getParent();
-
- parentEditPart = null;
- if (compartment != null)
- {
- List l = compartment.getChildren();
- Rectangle rectangle = new Rectangle(0, 0, 0, 0);
- int index = 0;
- BaseFieldEditPart childGraphNodeEditPart = null;
- for (Iterator i = l.iterator(); i.hasNext(); )
- {
- EditPart child = (EditPart)i.next();
- if (child instanceof BaseFieldEditPart)
- {
- previousChildRefEditPart = childGraphNodeEditPart;
- childGraphNodeEditPart = (BaseFieldEditPart)child;
- rectangle = childGraphNodeEditPart.getFigure().getBounds();
-
- if (location.y < (rectangle.getCenter().y))
- {
- nextChildRefEditPart = childGraphNodeEditPart;
- TargetConnectionSpacingFigureEditPart tSpace = (TargetConnectionSpacingFigureEditPart)targetSpacesList.get(index);
- if (tSpace.getParent() instanceof AttributeGroupDefinitionEditPart)
- {
- parentAttributeGroupEditPart = (AttributeGroupDefinitionEditPart)tSpace.getParent();
- attributeGroup = parentAttributeGroupEditPart.getXSDAttributeGroupDefinition().getResolvedAttributeGroupDefinition();
- parentComponent = attributeGroup;
- }
- else if (tSpace.getParent() instanceof XSDAttributesForAnnotationEditPart)
- {
- parentComponent = (XSDConcreteComponent)((XSDBaseAdapter)complexTypeEditPart.getModel()).getTarget();
- }
- break;
- }
- }
- else
- {
- // This is the annotation edit part
- }
- index ++;
- }
- }
- calculatePreviousAndNextEditParts();
- moveAttributeAction = new MoveAttributeAction(parentComponent, concreteComponentList, previousRefComponent, nextRefComponent);
- canExecute = moveAttributeAction.canMove();
- }
- else if (isElementToDrag)
- {
- XSDModelGroup targetModelGroup = null;
- modelGroupsList.clear();
- targetSpacesList.clear();
- calculateModelGroupList();
-
- List modelGroups = new ArrayList(modelGroupsList.size());
- for (Iterator i = modelGroupsList.iterator(); i.hasNext(); )
- {
- ModelGroupEditPart editPart = (ModelGroupEditPart)i.next();
- modelGroups.add(editPart.getXSDModelGroup());
- }
-
- EditPart compartment = target.getParent();
- parentEditPart = null;
- if (compartment != null)
- {
- List l = compartment.getChildren();
- Rectangle rectangle = new Rectangle(0, 0, 0, 0);
- int index = 0;
- BaseFieldEditPart childGraphNodeEditPart = null;
- for (Iterator i = l.iterator(); i.hasNext(); )
- {
- EditPart child = (EditPart)i.next();
- if (child instanceof BaseFieldEditPart)
- {
- previousChildRefEditPart = childGraphNodeEditPart;
- childGraphNodeEditPart = (BaseFieldEditPart)child;
- rectangle = childGraphNodeEditPart.getFigure().getBounds();
-
- if (location.y < (rectangle.getCenter().y))
- {
- nextChildRefEditPart = childGraphNodeEditPart;
- TargetConnectionSpacingFigureEditPart tSpace = (TargetConnectionSpacingFigureEditPart)targetSpacesList.get(index);
- parentEditPart = (ModelGroupEditPart)tSpace.getParent();
- targetModelGroup = parentEditPart.getXSDModelGroup();
- break;
- }
- }
- else
- {
- // This is the annotation edit part
- }
- index ++;
- }
- }
- calculatePreviousAndNextEditParts();
- action = new MoveAction(targetModelGroup, concreteComponentList, previousRefComponent, nextRefComponent);
- canExecute = action.canMove();
- }
- }
- }
- }
-
- protected void calculatePreviousAndNextEditParts()
- {
- if (nextChildRefEditPart != null)
- {
- if (nextChildRefEditPart.getModel() instanceof XSDBaseAdapter)
- {
- nextRefComponent = (XSDConcreteComponent)((XSDBaseAdapter)nextChildRefEditPart.getModel()).getTarget();
- }
- }
- if (previousChildRefEditPart != null)
- {
- if (previousChildRefEditPart.getModel() instanceof XSDBaseAdapter)
- {
- previousRefComponent = (XSDConcreteComponent)((XSDBaseAdapter)previousChildRefEditPart.getModel()).getTarget();
- }
- }
-
- }
-
- protected void calculateAttributeGroupList()
- {
- EditPart editPart = target;
- while (editPart != null)
- {
- if (editPart instanceof ComplexTypeEditPart)
- {
- complexTypeEditPart = (ComplexTypeEditPart)editPart;
- List list = editPart.getChildren();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Object child = i.next();
- if (child instanceof CompartmentEditPart)
- {
- List compartmentList = ((CompartmentEditPart)child).getChildren();
- for (Iterator it = compartmentList.iterator(); it.hasNext(); )
- {
- Object obj = it.next();
- if (obj instanceof XSDAttributesForAnnotationEditPart)
- {
- XSDAttributesForAnnotationEditPart groups = (XSDAttributesForAnnotationEditPart)obj;
- List groupList = groups.getChildren();
- for (Iterator iter = groupList.iterator(); iter.hasNext(); )
- {
- Object groupChild = iter.next();
- if (groupChild instanceof TargetConnectionSpacingFigureEditPart)
- {
- targetSpacesList.add(groupChild);
- }
- else if (groupChild instanceof AttributeGroupDefinitionEditPart)
- {
- AttributeGroupDefinitionEditPart attributeGroupEditPart = (AttributeGroupDefinitionEditPart)groupChild;
- attributeGroupsList.add(attributeGroupEditPart);
- attributeGroupsList.addAll(getAttributeGroupEditParts(attributeGroupEditPart));
- }
- }
- }
- }
- }
- }
- }
- editPart = editPart.getParent();
- }
-
- }
-
- protected void calculateModelGroupList()
- {
- EditPart editPart = target;
- while (editPart != null)
- {
- if (editPart instanceof ModelGroupEditPart)
- {
- ModelGroupEditPart modelGroupEditPart = (ModelGroupEditPart)editPart;
- modelGroupsList.addAll(getModelGroupEditParts(modelGroupEditPart));
- }
- else if (editPart instanceof ComplexTypeEditPart ||
- editPart instanceof ModelGroupDefinitionReferenceEditPart)
- {
- List list = editPart.getChildren();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Object child = i.next();
- if (child instanceof CompartmentEditPart)
- {
- List compartmentList = ((CompartmentEditPart)child).getChildren();
- for (Iterator it = compartmentList.iterator(); it.hasNext(); )
- {
- Object obj = it.next();
- if (obj instanceof XSDGroupsForAnnotationEditPart)
- {
- XSDGroupsForAnnotationEditPart groups = (XSDGroupsForAnnotationEditPart)obj;
- List groupList = groups.getChildren();
- for (Iterator iter = groupList.iterator(); iter.hasNext(); )
- {
- Object groupChild = iter.next();
- if (groupChild instanceof ModelGroupEditPart)
- {
- ModelGroupEditPart modelGroupEditPart = (ModelGroupEditPart)groupChild;
- modelGroupsList.add(modelGroupEditPart);
- modelGroupsList.addAll(getModelGroupEditParts(modelGroupEditPart));
- }
- }
- }
- }
- }
- }
- }
- editPart = editPart.getParent();
- }
- }
-
- protected List getAttributeGroupEditParts(AttributeGroupDefinitionEditPart attributeGroupEditPart)
- {
- List groupList = new ArrayList();
- List list = attributeGroupEditPart.getChildren();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Object object = i.next();
- if (object instanceof TargetConnectionSpacingFigureEditPart)
- {
- targetSpacesList.add(object);
- }
- else if (object instanceof AttributeGroupDefinitionEditPart)
- {
- AttributeGroupDefinitionEditPart groupRef = (AttributeGroupDefinitionEditPart)object;
- List groupRefChildren = groupRef.getChildren();
- for (Iterator it = groupRefChildren.iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o instanceof TargetConnectionSpacingFigureEditPart)
- {
- targetSpacesList.add(o);
- }
- else if (o instanceof AttributeGroupDefinitionEditPart)
- {
- AttributeGroupDefinitionEditPart aGroup = (AttributeGroupDefinitionEditPart)o;
- groupList.add(aGroup);
- groupList.addAll(getAttributeGroupEditParts(aGroup));
- }
- }
- }
- }
- return groupList;
- }
-
-
- protected List getModelGroupEditParts(ModelGroupEditPart modelGroupEditPart)
- {
- List modelGroupList = new ArrayList();
- List list = modelGroupEditPart.getChildren();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- Object object = i.next();
- if (object instanceof TargetConnectionSpacingFigureEditPart)
- {
- targetSpacesList.add(object);
- }
- else if (object instanceof ModelGroupDefinitionReferenceEditPart)
- {
- ModelGroupDefinitionReferenceEditPart groupRef = (ModelGroupDefinitionReferenceEditPart)object;
- List groupRefChildren = groupRef.getChildren();
- for (Iterator it = groupRefChildren.iterator(); it.hasNext(); )
- {
- Object o = it.next();
- if (o instanceof ModelGroupEditPart)
- {
- ModelGroupEditPart aGroup = (ModelGroupEditPart)o;
- modelGroupList.add(aGroup);
- modelGroupList.addAll(getModelGroupEditParts(aGroup));
- }
- }
- }
- else if (object instanceof ModelGroupEditPart)
- {
- ModelGroupEditPart aGroup = (ModelGroupEditPart)object;
- modelGroupList.add(aGroup);
- modelGroupList.addAll(getModelGroupEditParts(aGroup));
- }
- }
- return modelGroupList;
- }
-
-
- public void execute()
- {
- if (canExecute)
- {
- if (isElementToDrag)
- action.run();
- else
- moveAttributeAction.run();
- }
- }
-
- public void redo()
- {
-
- }
-
- public void undo()
- {
- }
-
- public boolean canExecute()
- {
- return canExecute;
- }
-
- public PointList getConnectionPoints(Rectangle draggedFigureBounds)
- {
- PointList pointList = null;
- if (isElementToDrag)
- {
- if (parentEditPart != null && nextChildRefEditPart != null)
- {
- pointList = getConnectionPoints(parentEditPart, nextChildRefEditPart, draggedFigureBounds);
- }
- }
- else
- {
- if (parentAttributeGroupEditPart!= null && nextChildRefEditPart != null)
- {
- pointList = getConnectionPoints(parentAttributeGroupEditPart, nextChildRefEditPart, draggedFigureBounds);
- }
- }
- return pointList != null ? pointList : new PointList();
- }
-
- // This method supports the preview connection line function related to drag and drop
- //
- public PointList getConnectionPoints(ConnectableEditPart parentEditPart, BaseFieldEditPart childRefEditPart, Rectangle draggedFigureBounds)
- {
- PointList pointList = new PointList();
- int[] data = new int[1];
- Point a = getConnectionPoint(parentEditPart, childRefEditPart, data);
- if (a != null)
- {
- int draggedFigureBoundsY = draggedFigureBounds.y + draggedFigureBounds.height/2;
-
- pointList.addPoint(a);
-
- if (data[0] == 0) // insert between 2 items
- {
- int x = a.x + (draggedFigureBounds.x - a.x)/2;
- pointList.addPoint(new Point(x, a.y));
- pointList.addPoint(new Point(x, draggedFigureBoundsY));
- pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
- }
- else // insert at first or last position
- {
- pointList.addPoint(new Point(a.x, draggedFigureBoundsY));
- pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
- }
- }
- return pointList;
- }
-
- // This method supports the preview connection line function related to drag and drop
- //
- protected Point getConnectionPoint(ConnectableEditPart parentEditPart, BaseFieldEditPart childRefEditPart, int[] data)
- {
- Point point = null;
- List childList = parentEditPart.getChildren();
-
- if (parentEditPart.getFigure() instanceof GenericGroupFigure && childList.size() > 0)
- {
- point = new Point();
-
- Rectangle r = getConnectedEditPartConnectionBounds(parentEditPart);
- point.x = r.x + r.width;
- point.y = r.y + r.height/2;
- }
- return point;
- }
-
- protected Rectangle getConnectedEditPartConnectionBounds(ConnectableEditPart editPart)
- {
- return ((GenericGroupFigure)editPart.getFigure()).getIconFigure().getBounds();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java
deleted file mode 100644
index 5fe3da1f1c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-
-public class AttributeGroupDefinitionEditPart extends ConnectableEditPart
-{
- public AttributeGroupDefinitionEditPart()
- {
- super();
- }
-
- public XSDAttributeGroupDefinition getXSDAttributeGroupDefinition()
- {
- if (getModel() instanceof XSDAttributeGroupDefinitionAdapter)
- {
- XSDAttributeGroupDefinitionAdapter adapter = (XSDAttributeGroupDefinitionAdapter) getModel();
- return (XSDAttributeGroupDefinition) adapter.getTarget();
- }
-// else if (getModel() instanceof XSDAttributeGroupDefinition)
-// {
-// return (XSDAttributeGroupDefinition) getModel();
-// }
- return null;
-
- }
-
- protected IFigure createFigure()
- {
- GenericGroupFigure figure = new GenericGroupFigure();
- XSDAttributeGroupDefinitionAdapter adapter = (XSDAttributeGroupDefinitionAdapter) getModel();
- figure.getIconFigure().image = adapter.getImage();
- return figure;
- }
-
- protected List getModelChildren()
- {
- List list = new ArrayList();
-
- XSDAttributeGroupDefinitionAdapter adapter = (XSDAttributeGroupDefinitionAdapter)getModel();
- XSDAttributeGroupDefinition attributeGroupDefinition = adapter.getXSDAttributeGroupDefinition();
- Iterator i = attributeGroupDefinition.getResolvedAttributeGroupDefinition().getContents().iterator();
-
- while (i.hasNext())
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) i.next();
-
- if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- list.add(XSDAdapterFactory.getInstance().adapt(attrGroupContent));
- }
- else
- {
- list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)getModel()));
- }
- }
-
- if (list.isEmpty())
- {
- list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)getModel()));
- }
-
- return list;
- }
-
-
- public ReferenceConnection createConnectionFigure(BaseEditPart child)
- {
- ReferenceConnection connectionFigure = new ReferenceConnection();
-
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(((GenericGroupFigure)getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
-
- if (child instanceof AttributeGroupDefinitionEditPart)
- {
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((AttributeGroupDefinitionEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
- }
- else if (child instanceof TargetConnectionSpacingFigureEditPart)
- {
-// TargetConnectionSpacingFigureEditPart elem = (TargetConnectionSpacingFigureEditPart) child;
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((TargetConnectionSpacingFigureEditPart) child).getFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
- }
-
- connectionFigure.setHighlight(false);
- return connectionFigure;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java
deleted file mode 100644
index e90a976d1e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ScrollPane;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.ViewportLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.EditPartNavigationHandlerUtil;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.RoundedLineBorder;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.ContainerLayout;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout;
-
-public class CategoryEditPart extends BaseEditPart
-{
- protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
- // CategoryFigure figure;
- Figure outerPane;
- HeadingFigure headingFigure;
- protected ScrollPane scrollpane;
-
- public int getType()
- {
- return ((CategoryAdapter) getModel()).getGroupType();
- }
-
- protected IFigure createFigure()
- {
- // figure = new CategoryFigure(getType());
- outerPane = new Figure();
- outerPane.setBorder(new RoundedLineBorder(1, 6));
-
- headingFigure = new HeadingFigure();
- outerPane.add(headingFigure);
- headingFigure.getLabel().setText(((CategoryAdapter) getModel()).getText());
- headingFigure.getLabel().setIcon(((CategoryAdapter) getModel()).getImage());
-
- int minHeight = 250;
- switch (getType())
- {
- case CategoryAdapter.DIRECTIVES:
- {
- minHeight = 80;
- break;
- }
- case CategoryAdapter.ATTRIBUTES:
- case CategoryAdapter.GROUPS:
- {
- minHeight = 100;
- break;
- }
- }
-
- final int theMinHeight = minHeight;
- FillLayout outerLayout = new FillLayout()
- {
- protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
- {
- Dimension d = super.calculatePreferredSize(parent, width, height);
- d.union(new Dimension(250, theMinHeight));
- return d;
- }
- };
- outerPane.setLayoutManager(outerLayout);
-
- RectangleFigure line = new RectangleFigure()
- {
- public Dimension getPreferredSize(int wHint, int hHint)
- {
- Dimension d = super.getPreferredSize(wHint, hHint);
- d.width += 20;
- d.height = 1;
- return d;
- }
- };
- ToolbarLayout lineLayout = new ToolbarLayout(false);
- lineLayout.setVertical(true);
- lineLayout.setStretchMinorAxis(true);
- line.setLayoutManager(lineLayout);
- outerPane.add(line);
-
- scrollpane = new ScrollPane();
- scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC); // ScrollPane.ALWAYS);
- outerPane.add(scrollpane);
-
- Figure pane = new Figure();
- pane.setBorder(new MarginBorder(5, 8, 5, 8));
- ContainerLayout layout = new ContainerLayout();
- layout.setHorizontal(false);
- layout.setSpacing(0);
- pane.setLayoutManager(layout);
-
- Viewport viewport = new Viewport();
- viewport.setContentsTracksHeight(true);
- ViewportLayout viewportLayout = new ViewportLayout()
- {
- protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
- {
- Dimension d = super.calculatePreferredSize(parent, width, height);
- d.height = Math.min(d.height, theMinHeight - 25); // getViewer().getControl().getBounds().height);
- d.width = Math.min(d.width, 300);
- return d;
- }
- };
- viewport.setLayoutManager(viewportLayout);
-
- scrollpane.setViewport(viewport);
- scrollpane.setContents(pane);
-
- return outerPane;
- }
-
- public void refreshVisuals()
- {
- super.refreshVisuals();
-
- RoundedLineBorder border = (RoundedLineBorder) outerPane.getBorder();
- border.setWidth(isSelected ? 2 : 1);
- headingFigure.setSelected(isSelected);
- outerPane.repaint();
-
- headingFigure.getLabel().setText(((CategoryAdapter) getModel()).getText());
- }
-
- public IFigure getContentPane()
- {
- return scrollpane.getContents();
- }
-
- public Label getNameLabel()
- {
- return headingFigure.getLabel();
- }
-
- public HeadingFigure getHeadingFigure()
- {
- return headingFigure;
- }
-
- protected EditPart createChild(Object model)
- {
- EditPart editPart = new TopLevelComponentEditPart();
- editPart.setModel(model);
- editPart.setParent(this);
- return editPart;
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- EditPart result = null;
- if (editPart instanceof TopLevelComponentEditPart)
- {
- if (direction == PositionConstants.SOUTH)
- {
- result = EditPartNavigationHandlerUtil.getNextSibling(editPart);
- }
- else if (direction == PositionConstants.NORTH)
- {
- result = EditPartNavigationHandlerUtil.getPrevSibling(editPart);
- }
- if (result != null)
- {
- scrollTo((AbstractGraphicalEditPart)editPart);
- }
- }
- else
- {
- result = ((BaseEditPart)getParent()).doGetRelativeEditPart(editPart, direction);
- }
- return result;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- // cs : oddly arrowing up and down true items in the list is not handled nicely
- // by the canned GEF GraphicalViewerKeyHandler so this navigation policy is need to fix that
- selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);
- }
-
- protected List getModelChildren()
- {
- CategoryAdapter adapter = (CategoryAdapter) getModel();
- List children = new ArrayList(Arrays.asList(adapter.getAllChildren()));
- return children;
- }
-
- public void scrollTo(AbstractGraphicalEditPart topLevel)
- {
- Rectangle topLevelBounds = topLevel.getFigure().getBounds();
- Rectangle categoryBounds = figure.getBounds();
- int scrollValue = scrollpane.getVerticalScrollBar().getValue();
- int location = topLevelBounds.y + scrollValue - categoryBounds.y;
- scrollpane.scrollVerticalTo(location - categoryBounds.height / 2);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ConnectableEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ConnectableEditPart.java
deleted file mode 100644
index 67e7a4989d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ConnectableEditPart.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.design.figures.CenteredIconFigure;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public abstract class ConnectableEditPart extends BaseEditPart
-{
- protected ArrayList connectionFigures = new ArrayList();
-
- public IExtendedFigureFactory getExtendedFigureFactory()
- {
- EditPartFactory factory = getViewer().getEditPartFactory();
- Assert.isTrue(factory instanceof IExtendedFigureFactory, "EditPartFactory must be an instanceof of IExtendedFigureFactory"); //$NON-NLS-1$
- return (IExtendedFigureFactory)factory;
- }
-
- public ConnectableEditPart()
- {
- super();
- }
-
- protected IFigure createFigure()
- {
- GenericGroupFigure figure = new GenericGroupFigure();
- return figure;
- }
-
- public XSDConcreteComponent getXSDConcreteComponent()
- {
- return (XSDConcreteComponent)((XSDBaseAdapter)getModel()).getTarget();
- }
-
- public List getConnectionFigures()
- {
- return connectionFigures;
- }
-
- public abstract ReferenceConnection createConnectionFigure(BaseEditPart child);
-
- public void activate()
- {
- super.activate();
- activateConnection();
- }
-
- protected void activateConnection()
- {
- if (connectionFigures == null)
- {
- connectionFigures = new ArrayList();
- }
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- Object o = i.next();
- if (o instanceof BaseEditPart)
- {
- BaseEditPart g = (BaseEditPart) o;
- ReferenceConnection figure = createConnectionFigure(g);
- connectionFigures.add(figure);
- figure.setPoints(figure.getPoints());
-
- getLayer(LayerConstants.CONNECTION_LAYER).add(figure);
- }
- }
- }
-
- public void deactivate()
- {
- super.deactivate();
- deactivateConnection();
- }
-
- protected void deactivateConnection()
- {
- // if we have a connection, remove it
- ReferenceConnection connectionFigure;
- if (connectionFigures != null && !connectionFigures.isEmpty())
- {
- for (Iterator i = connectionFigures.iterator(); i.hasNext();)
- {
- connectionFigure = (ReferenceConnection) i.next();
-
- if (getLayer(LayerConstants.CONNECTION_LAYER).getChildren().contains(connectionFigure))
- {
- getLayer(LayerConstants.CONNECTION_LAYER).remove(connectionFigure);
- }
- }
- connectionFigures = null;
- }
- }
-
- public void refresh()
- {
- super.refresh();
- refreshConnection();
- }
-
- protected void refreshConnection()
- {
- if (!isActive())
- return;
-
- if (connectionFigures == null || connectionFigures.isEmpty())
- {
- activateConnection();
- }
- else
- {
- deactivateConnection();
- activateConnection();
- }
- }
-
- public void addFeedback()
- {
- ReferenceConnection connectionFigure;
- if (connectionFigures != null && !connectionFigures.isEmpty())
- {
- for (Iterator i = connectionFigures.iterator(); i.hasNext();)
- {
- connectionFigure = (ReferenceConnection) i.next();
- connectionFigure.setHighlight(true);
- }
- }
- GenericGroupFigure figure = (GenericGroupFigure)getFigure();
- figure.getIconFigure().setMode(CenteredIconFigure.SELECTED);
- figure.getIconFigure().refresh();
- }
-
- public void removeFeedback()
- {
- ReferenceConnection connectionFigure;
- if (connectionFigures != null && !connectionFigures.isEmpty())
- {
- for (Iterator i = connectionFigures.iterator(); i.hasNext();)
- {
- connectionFigure = (ReferenceConnection) i.next();
- connectionFigure.setHighlight(false);
- }
- }
- GenericGroupFigure figure = (GenericGroupFigure)getFigure();
- figure.getIconFigure().setMode(CenteredIconFigure.NORMAL);
- figure.getIconFigure().refresh();
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- GenericGroupFigure figure = (GenericGroupFigure)getFigure();
- figure.getIconFigure().refresh();
- }
-
- protected void createEditPolicies()
- {
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
- }
-
- protected void addChildVisual(EditPart childEditPart, int index)
- {
- IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
- getContentPane().add(child, index);
- }
-
- protected void removeChildVisual(EditPart childEditPart)
- {
- IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
- getContentPane().remove(child);
- }
-
- public IFigure getContentPane()
- {
- return ((GenericGroupFigure)getFigure()).getContentFigure();
- }
-
- public Figure getTargetFigure()
- {
- return ((GenericGroupFigure)getFigure()).getTargetFigure();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java
deleted file mode 100644
index 0f639764ad..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor;
-import org.eclipse.wst.xsd.ui.internal.design.figures.GenericGroupFigure;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class ModelGroupDefinitionReferenceEditPart extends ConnectableEditPart
-{
- GenericGroupFigure figure;
-
- public ModelGroupDefinitionReferenceEditPart()
- {
- super();
- }
-
- protected IFigure createFigure()
- {
- figure = new GenericGroupFigure();
- return figure;
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- XSDModelGroupDefinitionAdapter adapter = (XSDModelGroupDefinitionAdapter)getModel();
- figure.getIconFigure().image = adapter.getImage();
- }
-
- protected List getModelChildren()
- {
- List list = new ArrayList();
-
- XSDModelGroupDefinitionAdapter adapter = (XSDModelGroupDefinitionAdapter)getModel();
- XSDModelGroup xsdModelGroup = ((XSDModelGroupDefinition) adapter.getTarget()).getResolvedModelGroupDefinition().getModelGroup();
- if (xsdModelGroup != null)
- list.add(XSDAdapterFactory.getInstance().adapt(xsdModelGroup));
- return list;
- }
-
- public ReferenceConnection createConnectionFigure(BaseEditPart child)
- {
- ReferenceConnection connectionFigure = new ReferenceConnection();
-
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(((GenericGroupFigure)getFigure()).getIconFigure(), CenteredConnectionAnchor.RIGHT, 0, 0));
-
- if (child instanceof ModelGroupEditPart)
- {
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(((ModelGroupEditPart) child).getTargetFigure(), CenteredConnectionAnchor.LEFT, 0, 0));
- }
- connectionFigure.setHighlight(false);
- return connectionFigure;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java
deleted file mode 100644
index 4ecafc5cdb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionRouter;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.swt.graphics.Color;
-
-public class ReferenceConnection extends PolylineConnection
-{
- protected boolean highlight = false;
-
- protected static final Color activeConnection = ColorConstants.black;
- public static final Color inactiveConnection = new Color(null, 198, 195, 198);
-
- public ReferenceConnection()
- {
- super();
- setConnectionRouter(new XSDModelGroupRouter());
- }
-
- public void setConnectionRouter(ConnectionRouter cr)
- {
- if (cr != null && getConnectionRouter() != null && !(getConnectionRouter() instanceof XSDModelGroupRouter))
- super.setConnectionRouter(cr);
- }
-
- public boolean isHighlighted()
- {
- return highlight;
- }
-
- public void setHighlight(boolean highlight)
- {
- this.highlight = highlight;
- setForegroundColor(highlight ? activeConnection : inactiveConnection);
- setOpaque(highlight);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/SpaceFillerForFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/SpaceFillerForFieldEditPart.java
deleted file mode 100644
index e8db41c964..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/SpaceFillerForFieldEditPart.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class SpaceFillerForFieldEditPart extends BaseFieldEditPart
-{
- Label space;
- public SpaceFillerForFieldEditPart()
- {
- super();
- }
-
- protected IFigure createFigure()
- {
- space = new Label(""); //$NON-NLS-1$
- space.setIcon(XSDEditorPlugin.getXSDImage("icons/Dot.gif")); //$NON-NLS-1$
- space.setBorder(new MarginBorder(3, 0, 3, 0));
- return space;
- }
-
- protected void refreshVisuals()
- {
- }
-
- protected void createEditPolicies()
- {
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java
deleted file mode 100644
index 954c386c5a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.design.figures.SpacingFigure;
-
-public class TargetConnectionSpacingFigureEditPart extends BaseEditPart
-{
- public TargetConnectionSpacingFigureEditPart()
- {
- super();
- }
-
- SpacingFigure figure;
-
- protected IFigure createFigure()
- {
- figure = new SpacingFigure();
- return figure;
- }
-
- public IFigure getConnectionFigure()
- {
- return figure;
- }
-
- protected void createEditPolicies()
- {
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDAttributesForAnnotationEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDAttributesForAnnotationEditPart.java
deleted file mode 100644
index a882ffd592..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDAttributesForAnnotationEditPart.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Annotation;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-
-public class XSDAttributesForAnnotationEditPart extends BaseEditPart
-{
- IComplexType complexType;
- public XSDAttributesForAnnotationEditPart()
- {
- super();
- }
-
- protected IFigure createFigure()
- {
- Figure fig = new Figure();
- fig.setLayoutManager(new ToolbarLayout());
- return fig;
- }
-
- protected void createEditPolicies()
- {
-
- }
-
- protected List getModelChildren()
- {
- IStructure structure = ((Annotation)getModel()).getOwner();
- if (structure instanceof IComplexType)
- {
- complexType = (IComplexType)structure;
- if (complexType instanceof XSDComplexTypeDefinitionAdapter)
- {
- XSDComplexTypeDefinitionAdapter adapter = (XSDComplexTypeDefinitionAdapter) complexType;
- return adapter.getAttributeGroupContent();
- }
- }
- return Collections.EMPTY_LIST;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java
deleted file mode 100644
index 5901f40f1c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.IAnnotationProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.DragAndDropEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.SelectionHandlesEditPolicyImpl;
-
-public class XSDBaseFieldEditPart extends BaseFieldEditPart
-{
-
- public XSDBaseFieldEditPart()
- {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
- */
- protected void refreshVisuals()
- {
- IFieldFigure figure = getFieldFigure();
- IField field = (IField) getModel();
-
- figure.getNameLabel().setText(field.getName());
- figure.getTypeLabel().setText(field.getTypeName());
- figure.refreshVisuals(getModel());
- if (field.isReadOnly())
- figure.setForegroundColor(ColorConstants.darkGray);
- else
- figure.setForegroundColor(ColorConstants.black);
-
- String occurrenceDescription = ""; //$NON-NLS-1$
- if (field instanceof IAnnotationProvider)
- {
- occurrenceDescription = ((IAnnotationProvider)field).getNameAnnotationString();
- }
- refreshIcon();
- figure.getNameAnnotationLabel().setText(occurrenceDescription);
-
- figure.recomputeLayout();
-
-
- if (getRoot() != null)
- ((GraphicalEditPart)getRoot()).getFigure().invalidateTree();
- }
-
- protected void refreshIcon()
- {
- IFieldFigure figure = getFieldFigure();
- // our model implements ITreeElement
- if (getModel() instanceof ITreeElement)
- {
- figure.getNameLabel().setIcon(((ITreeElement)getModel()).getImage());
- }
- }
-
- public void addNotify()
- {
- super.addNotify();
- getFieldFigure().editPartAttached(this);
- }
-
- protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy = new SelectionHandlesEditPolicyImpl();
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, selectionHandlesEditPolicy);
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DragAndDropEditPolicy(getViewer(), selectionHandlesEditPolicy));
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDEditPartFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDEditPartFactory.java
deleted file mode 100644
index e4c1e271f2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDEditPartFactory.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAttributeGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ADTEditPartFactory;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ColumnEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CompartmentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Annotation;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.ICompartmentFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.TypeVizFigureFactory;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.SpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.model.TargetConnectionSpaceFiller;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IModelGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class XSDEditPartFactory extends ADTEditPartFactory implements IExtendedFigureFactory
-{
- protected IExtendedFigureFactory delegate;
-
- public XSDEditPartFactory()
- {
- delegate = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getFigureFactory();
- if (delegate == null)
- delegate = new TypeVizFigureFactory();
- }
-
- public XSDEditPartFactory(IExtendedFigureFactory figureFactory)
- {
- delegate = figureFactory;
- }
-
-
- public EditPart doCreateEditPart(EditPart context, Object model)
- {
- EditPart child = null;
- // Override edit part where desired
-
- if (model instanceof IField)
- {
- if (model instanceof SpaceFiller)
- {
- child = new SpaceFillerForFieldEditPart();
- }
- else if (context instanceof CompartmentEditPart)
- {
- child = new XSDBaseFieldEditPart();
- }
- }
- else if (model instanceof XSDSchemaAdapter)
- {
- child = new XSDSchemaEditPart();
- }
- else if (model instanceof CategoryAdapter)
- {
- child = new CategoryEditPart();
- }
- else if (model instanceof XSDSimpleTypeDefinitionAdapter)
- {
- child = new XSDSimpleTypeEditPart();
- }
- else if (model instanceof XSDModelGroupAdapter)
- {
- child = new ModelGroupEditPart();
- }
- else if (model instanceof Annotation)
- {
- Annotation annotation = (Annotation) model;
- String kind = annotation.getCompartment().getKind();
- if (kind.equals("element")) //$NON-NLS-1$
- {
- child = new XSDGroupsForAnnotationEditPart();
- }
- else if (kind.equals("attribute")) //$NON-NLS-1$
- {
- child = new XSDAttributesForAnnotationEditPart();
- }
- }
- else if (!(context instanceof ColumnEditPart))
- {
- if (model instanceof TargetConnectionSpaceFiller)
- {
- child = new TargetConnectionSpacingFigureEditPart();
- }
- else if (model instanceof XSDModelGroupDefinitionAdapter)
- {
- child = new ModelGroupDefinitionReferenceEditPart();
- }
- else if (model instanceof XSDAttributeGroupDefinitionAdapter)
- {
- child = new AttributeGroupDefinitionEditPart();
- }
- }
- // if we don't have a specialzied XSD edit part to create
- // then we simply call the super class to create a generic ADT edit part
- //
- if (child == null)
- {
- child = super.doCreateEditPart(context, model);
- }
-
- // if at this this point we have not created an edit part we simply
- // create a placeholder edit part to provide the most robust behaviour possible
- //
- if (child == null)
- {
- // TODO (cs) log an error message here, since we shouldn't really get here
- child = new SpaceFillerForFieldEditPart();
- }
- return child;
- }
-
- public ICompartmentFigure createCompartmentFigure(Object model)
- {
- return delegate.createCompartmentFigure(model);
- }
-
- public IStructureFigure createStructureFigure(Object model)
- {
- return delegate.createStructureFigure(model);
- }
-
- public IFieldFigure createFieldFigure(Object model)
- {
- return delegate.createFieldFigure(model);
- }
-
- public IModelGroupFigure createModelGroupFigure(Object model)
- {
- return delegate.createModelGroupFigure(model);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDGroupsForAnnotationEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDGroupsForAnnotationEditPart.java
deleted file mode 100644
index 3abe794aea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDGroupsForAnnotationEditPart.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDModelGroupDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Annotation;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class XSDGroupsForAnnotationEditPart extends BaseEditPart
-{
- IComplexType complexType;
- public XSDGroupsForAnnotationEditPart()
- {
- super();
- }
-
- protected IFigure createFigure()
- {
- Figure fig = new Figure();
- fig.setLayoutManager(new ToolbarLayout());
- return fig;
- }
-
- protected void createEditPolicies()
- {
-
- }
-
- protected List getModelChildren()
- {
- List xsdModelGroupList = new ArrayList();
- List adapterList = new ArrayList();
-
- IStructure structure = ((Annotation)getModel()).getOwner();
- if (structure instanceof IComplexType)
- {
- complexType = (IComplexType)structure;
- if (complexType instanceof XSDComplexTypeDefinitionAdapter)
- {
- XSDComplexTypeDefinitionAdapter adapter = (XSDComplexTypeDefinitionAdapter) complexType;
- xsdModelGroupList = adapter.getModelGroups();
- }
-
- for (Iterator i = xsdModelGroupList.iterator(); i.hasNext(); )
- {
- Object obj = i.next();
- if (obj instanceof XSDModelGroup)
- {
- adapterList.add(XSDAdapterFactory.getInstance().adapt((XSDModelGroup)obj));
- }
- else if (obj instanceof XSDModelGroupDefinition)
- {
- adapterList.add(XSDAdapterFactory.getInstance().adapt((XSDModelGroupDefinition)obj));
- }
- }
- }
- else if (structure instanceof XSDModelGroupDefinitionAdapter)
- {
- XSDModelGroupDefinitionAdapter adapter = (XSDModelGroupDefinitionAdapter) structure;
- XSDModelGroup group = adapter.getXSDModelGroupDefinition().getModelGroup();
- if (group != null)
- {
- adapterList.add(XSDAdapterFactory.getInstance().adapt(group));
- }
- }
-
- return adapterList;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDModelGroupRouter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDModelGroupRouter.java
deleted file mode 100644
index 1a42e6c652..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDModelGroupRouter.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.AbstractRouter;
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.ConnectionRouter;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Ray;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-// TODO Manhattan connection router is final
-public class XSDModelGroupRouter extends AbstractRouter
-{
- public XSDModelGroupRouter()
- {
- super();
- }
- private Map rowsUsed = new HashMap();
- private Map colsUsed = new HashMap();
-
- private Map reservedInfo = new HashMap();
-
- private class ReservedInfo {
- public List reservedRows = new ArrayList(2);
- public List reservedCols = new ArrayList(2);
- }
-
- private static Ray UP = new Ray(0, -1),
- DOWN = new Ray(0, 1),
- LEFT = new Ray(-1, 0),
- RIGHT = new Ray(1, 0);
-
-
- /**
- * @see ConnectionRouter#invalidate(Connection)
- */
- public void invalidate(Connection connection) {
- removeReservedLines(connection);
- }
-
- private int getColumnNear(Connection connection, int r, int n, int x) {
- int min = Math.min(n, x),
- max = Math.max(n, x);
- if (min > r) {
- max = min;
- min = r - (min - r);
- }
- if (max < r) {
- min = max;
- max = r + (r - max);
- }
- int proximity = 0;
- int direction = -1;
- if (r % 2 == 1)
- r--;
- Integer i;
- while (proximity < r) {
- i = new Integer(r + proximity * direction);
- if (!colsUsed.containsKey(i)) {
- colsUsed.put(i, i);
- reserveColumn(connection, i);
- return i.intValue();
- }
- int j = i.intValue();
- if (j <= min)
- return j + 2;
- if (j >= max)
- return j - 2;
- if (direction == 1)
- direction = -1;
- else {
- direction = 1;
- proximity += 2;
- }
- }
- return r;
- }
-
- /**
- * Returns the direction the point <i>p</i> is in relation to the given rectangle.
- * Possible values are LEFT (-1,0), RIGHT (1,0), UP (0,-1) and DOWN (0,1).
- *
- * @param r the rectangle
- * @param p the point
- * @return the direction from <i>r</i> to <i>p</i>
- */
- protected Ray getDirection(Rectangle r, Point p) {
- int i, distance = Math.abs(r.x - p.x);
- Ray direction;
-
- direction = LEFT;
-
- i = Math.abs(r.y - p.y);
- if (i <= distance) {
- distance = i;
- direction = UP;
- }
-
- i = Math.abs(r.bottom() - p.y);
- if (i <= distance) {
- distance = i;
- direction = DOWN;
- }
-
- i = Math.abs(r.right() - p.x);
- if (i < distance) {
- distance = i;
- direction = RIGHT;
- }
-
- return direction;
- }
-
- protected Ray getEndDirection(Connection conn) {
- ConnectionAnchor anchor = conn.getTargetAnchor();
- Point p = getEndPoint(conn);
- Rectangle rect;
- if (anchor.getOwner() == null)
- rect = new Rectangle(p.x - 1, p.y - 1, 2, 2);
- else {
- rect = conn.getTargetAnchor().getOwner().getBounds().getCopy();
- conn.getTargetAnchor().getOwner().translateToAbsolute(rect);
- }
- return getDirection(rect, p);
- }
-
- protected int getRowNear(Connection connection, int r, int n, int x) {
- int min = Math.min(n, x),
- max = Math.max(n, x);
- if (min > r) {
- max = min;
- min = r - (min - r);
- }
- if (max < r) {
- min = max;
- max = r + (r - max);
- }
-
- int proximity = 0;
- int direction = -1;
- if (r % 2 == 1)
- r--;
- Integer i;
- while (proximity < r) {
- i = new Integer(r + proximity * direction);
- if (!rowsUsed.containsKey(i)) {
- rowsUsed.put(i, i);
- reserveRow(connection, i);
- return i.intValue();
- }
- int j = i.intValue();
- if (j <= min)
- return j + 2;
- if (j >= max)
- return j - 2;
- if (direction == 1)
- direction = -1;
- else {
- direction = 1;
- proximity += 2;
- }
- }
- return r;
- }
-
- protected Ray getStartDirection(Connection conn) {
- ConnectionAnchor anchor = conn.getSourceAnchor();
- Point p = getStartPoint(conn);
- Rectangle rect;
- if (anchor.getOwner() == null)
- rect = new Rectangle(p.x - 1, p.y - 1, 2, 2);
- else {
- rect = conn.getSourceAnchor().getOwner().getBounds().getCopy();
- conn.getSourceAnchor().getOwner().translateToAbsolute(rect);
- }
- return getDirection(rect, p);
- }
-
- protected void processPositions(Ray start, Ray end, List positions,
- boolean horizontal, Connection conn) {
- removeReservedLines(conn);
-
- int pos[] = new int[positions.size() + 2];
- if (horizontal)
- pos[0] = start.x;
- else
- pos[0] = start.y;
- int i;
- for (i = 0; i < positions.size(); i++) {
- pos[i + 1] = ((Integer)positions.get(i)).intValue();
- }
- if (horizontal == (positions.size() % 2 == 1))
- pos[++i] = end.x;
- else
- pos[++i] = end.y;
-
- PointList points = new PointList();
- points.addPoint(new Point(start.x, start.y));
- Point p;
- int current, prev, min, max;
- boolean adjust;
- for (i = 2; i < pos.length - 1; i++) {
- horizontal = !horizontal;
- prev = pos[i - 1];
- current = pos[i];
-
- adjust = (i != pos.length - 2);
- if (horizontal) {
- if (adjust) {
- min = pos[i - 2];
- max = pos[i + 2];
- pos[i] = current = getRowNear(conn, current, min, max);
- }
- p = new Point(prev, current);
- } else {
- if (adjust) {
- min = pos[i - 2];
- max = pos[i + 2];
- pos[i] = current = getColumnNear(conn, current, min, max);
- }
- p = new Point(current, prev);
- }
- points.addPoint(p);
- }
- points.addPoint(new Point(end.x, end.y));
- conn.setPoints(points);
- }
-
- /**
- * @see ConnectionRouter#remove(Connection)
- */
- public void remove(Connection connection) {
- removeReservedLines(connection);
- }
-
- protected void removeReservedLines(Connection connection) {
- ReservedInfo rInfo = (ReservedInfo) reservedInfo.get(connection);
- if (rInfo == null)
- return;
-
- for (int i = 0; i < rInfo.reservedRows.size(); i++) {
- rowsUsed.remove(rInfo.reservedRows.get(i));
- }
- for (int i = 0; i < rInfo.reservedCols.size(); i++) {
- colsUsed.remove(rInfo.reservedCols.get(i));
- }
- reservedInfo.remove(connection);
- }
-
- protected void reserveColumn(Connection connection, Integer column) {
- ReservedInfo info = (ReservedInfo) reservedInfo.get(connection);
- if (info == null) {
- info = new ReservedInfo();
- reservedInfo.put(connection, info);
- }
- info.reservedCols.add(column);
- }
-
- protected void reserveRow(Connection connection, Integer row) {
- ReservedInfo info = (ReservedInfo) reservedInfo.get(connection);
- if (info == null) {
- info = new ReservedInfo();
- reservedInfo.put(connection, info);
- }
- info.reservedRows.add(row);
- }
-
- /**
- * @see ConnectionRouter#route(Connection)
- */
- public void route(Connection conn) {
- if ((conn.getSourceAnchor() == null) || (conn.getTargetAnchor() == null))
- return;
- int i;
- Point startPoint = getStartPoint(conn);
- conn.translateToRelative(startPoint);
- Point endPoint = getEndPoint(conn);
- conn.translateToRelative(endPoint);
-
- Ray start = new Ray(startPoint);
- Ray end = new Ray(endPoint);
- Ray average = new Ray(startPoint.x + 4, startPoint.y); // start.getAveraged(end);
-
- Ray direction = new Ray(start, end);
- Ray startNormal = getStartDirection(conn);
- Ray endNormal = getEndDirection(conn);
-
- List positions = new ArrayList(5);
- boolean horizontal = startNormal.isHorizontal();
- if (horizontal)
- positions.add(new Integer(start.y));
- else
- positions.add(new Integer(start.x));
- horizontal = !horizontal;
-
- if (startNormal.dotProduct(endNormal) == 0) {
- if ((startNormal.dotProduct(direction) >= 0)
- && (endNormal.dotProduct(direction) <= 0)) {
- // 0
- } else {
- // 2
- if (startNormal.dotProduct(direction) < 0)
- i = startNormal.similarity(start.getAdded(startNormal.getScaled(10)));
- else {
- if (horizontal)
- i = average.y;
- else
- i = average.x;
- }
- positions.add(new Integer(i));
- horizontal = !horizontal;
-
- if (endNormal.dotProduct(direction) > 0)
- i = endNormal.similarity(end.getAdded(endNormal.getScaled(10)));
- else {
- if (horizontal)
- i = average.y;
- else
- i = average.x;
- }
- positions.add(new Integer(i));
- horizontal = !horizontal;
- }
- } else {
- if (startNormal.dotProduct(endNormal) > 0) {
- //1
- if (startNormal.dotProduct(direction) >= 0)
- i = startNormal.similarity(start.getAdded(startNormal.getScaled(10)));
- else
- i = endNormal.similarity(end.getAdded(endNormal.getScaled(10)));
- positions.add(new Integer(i));
- horizontal = !horizontal;
- } else {
- //3 or 1
- if (startNormal.dotProduct(direction) < 0) {
- i = startNormal.similarity(start.getAdded(startNormal.getScaled(10)));
- positions.add(new Integer(i));
- horizontal = !horizontal;
- }
-
- if (horizontal)
- i = average.y;
- else
- i = average.x;
- positions.add(new Integer(i));
- horizontal = !horizontal;
-
- if (startNormal.dotProduct(direction) < 0) {
- i = endNormal.similarity(end.getAdded(endNormal.getScaled(10)));
- positions.add(new Integer(i));
- horizontal = !horizontal;
- }
- }
- }
- if (horizontal)
- positions.add(new Integer(end.y));
- else
- positions.add(new Integer(end.x));
-
- processPositions(start, end, positions, startNormal.isHorizontal(), conn);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java
deleted file mode 100644
index 678e0719ef..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure;
-import org.eclipse.wst.xsd.ui.internal.design.editpolicies.SelectionHandlesEditPolicyImpl;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDSchemaEditPart extends BaseEditPart
-{
- protected Label label;
-
- protected Figure outer, contentFigure;
- protected HeadingFigure headingFigure;
-
- public IFigure getContentPane()
- {
- return contentFigure;
- }
-
- protected IFigure createFigure()
- {
- outer = new Figure();
- // outer.setBorder(new RoundedLineBorder(1, 6));
- outer.setBorder(new LineBorder(1));
-
- FillLayout fillLayout = new FillLayout(4);
- outer.setLayoutManager(fillLayout);
-
- headingFigure = new HeadingFigure();
- outer.add(headingFigure);
-
- final int theMinHeight = 200;
- FillLayout outerLayout = new FillLayout()
- {
- protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
- {
- Dimension d = super.calculatePreferredSize(parent, width, height);
- d.union(new Dimension(250, theMinHeight));
- return d;
- }
- };
- outerLayout.setHorizontal(false);
- outer.setLayoutManager(outerLayout);
-
- RectangleFigure line = new RectangleFigure()
- {
- public Dimension getPreferredSize(int wHint, int hHint)
- {
- Dimension d = super.getPreferredSize(wHint, hHint);
- d.width += 20;
- d.height = 1;
- return d;
- }
- };
- ToolbarLayout lineLayout = new ToolbarLayout(false);
- lineLayout.setVertical(true);
- lineLayout.setStretchMinorAxis(true);
- line.setLayoutManager(lineLayout);
- outer.add(line);
-
- contentFigure = new Figure();
- contentFigure.setBorder(new MarginBorder(4, 4, 4, 4));
- fillLayout = new FillLayout(4);
- contentFigure.setLayoutManager(fillLayout);
-
- outer.add(contentFigure);
-
- return outer;
- }
-
- protected List getModelChildren()
- {
- XSDSchemaAdapter schemaAdapter = (XSDSchemaAdapter) getModel();
- List list = new ArrayList();
-
- schemaAdapter.updateCategories();
-
- List templist = new ArrayList();
- templist.add(schemaAdapter.getCategory(CategoryAdapter.DIRECTIVES));
- Holder holder = new Holder(templist);
- list.add(holder);
-
- templist = new ArrayList();
- templist.add(schemaAdapter.getCategory(CategoryAdapter.ELEMENTS));
- templist.add(schemaAdapter.getCategory(CategoryAdapter.TYPES));
- holder = new Holder(templist);
- list.add(holder);
-
- templist = new ArrayList();
- templist.add(schemaAdapter.getCategory(CategoryAdapter.ATTRIBUTES));
- templist.add(schemaAdapter.getCategory(CategoryAdapter.GROUPS));
- holder = new Holder(templist);
- list.add(holder);
-
- return list;
- }
-
- protected EditPart createChild(Object model)
- {
- CategoryRowEditPart result = new CategoryRowEditPart();
- result.setModel(model);
- result.setParent(this);
- return result;
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
-
- LineBorder border = (LineBorder) outer.getBorder();
- border.setWidth(isSelected ? 2 : 1);
- headingFigure.setSelected(isSelected);
- outer.repaint();
-
- String targetNamespaceValue = ((XSDSchema) ((XSDSchemaAdapter) getModel()).getTarget()).getTargetNamespace();
- if (targetNamespaceValue == null || targetNamespaceValue.length() == 0)
- {
- targetNamespaceValue = Messages._UI_GRAPH_XSDSCHEMA_NO_NAMESPACE;
- }
- headingFigure.getLabel().setText(Messages._UI_GRAPH_XSDSCHEMA + " : " + targetNamespaceValue); //$NON-NLS-1$
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- EditPart result = null;
- if (editPart instanceof CategoryEditPart)
- {
- CategoryAdapter adapter = (CategoryAdapter)editPart.getModel();
- switch (adapter.getGroupType())
- {
- case CategoryAdapter.DIRECTIVES:
- {
- if (direction == PositionConstants.SOUTH)
- {
- result = getCategoryEditPart(CategoryAdapter.ELEMENTS);
- }
- break;
- }
- case CategoryAdapter.ELEMENTS:
- {
- if (direction == PositionConstants.SOUTH)
- {
- result = getCategoryEditPart(CategoryAdapter.ATTRIBUTES);
- }
- else if (direction == PositionConstants.NORTH)
- {
- result = getCategoryEditPart(CategoryAdapter.DIRECTIVES);
- }
- break;
- }
- case CategoryAdapter.TYPES:
- {
- if (direction == PositionConstants.SOUTH)
- {
- result = getCategoryEditPart(CategoryAdapter.GROUPS);
- }
- else if (direction == PositionConstants.NORTH)
- {
- result = getCategoryEditPart(CategoryAdapter.DIRECTIVES);
- }
- break;
- }
- case CategoryAdapter.ATTRIBUTES:
- {
- if (direction == PositionConstants.NORTH)
- {
- result = getCategoryEditPart(CategoryAdapter.ELEMENTS);
- }
- break;
- }
- case CategoryAdapter.GROUPS:
- {
- if (direction == PositionConstants.NORTH)
- {
- result = getCategoryEditPart(CategoryAdapter.TYPES);
- }
- break;
- }
- }
- }
- else if (editPart == this)
- {
- if (direction == KeyBoardAccessibilityEditPolicy.IN_TO_FIRST_CHILD)
- {
- result = ((CategoryRowEditPart)getChildren().get(0)).doGetRelativeEditPart(editPart, direction);
- }
- }
- return result;
- }
-
- private EditPart getCategoryEditPart(int kind)
- {
- for (Iterator j = getChildren().iterator(); j.hasNext(); )
- {
- EditPart row = (EditPart)j.next();
- for (Iterator i = row.getChildren().iterator(); i.hasNext(); )
- {
- EditPart editPart = (EditPart)i.next();
- if (editPart instanceof CategoryEditPart)
- {
- CategoryEditPart categoryEditPart = (CategoryEditPart)editPart;
- CategoryAdapter adapter = (CategoryAdapter)categoryEditPart.getModel();
- if (adapter.getGroupType() == kind)
- {
- return editPart;
- }
- }
- }
- }
- return null;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionHandlesEditPolicyImpl());
- }
-
- protected class Holder
- {
- List list;
-
- public Holder(List list)
- {
- this.list = list;
- }
-
- public List getList()
- {
- return list;
- }
- }
-
- protected class CategoryRowEditPart extends BaseEditPart
- {
- protected XSDSchema schema;
- protected Figure contentPane;
-
- protected IFigure createFigure()
- {
- Figure containerFigure = new Figure();
- containerFigure.setBorder(new MarginBorder(4, 4, 4, 4));
- // containerFigure.setBorder(new LineBorder(1));
- // containerFigure.setBackgroundColor(ColorConstants.green);
-
- FillLayout fillLayout = new FillLayout(4);
- fillLayout.setHorizontal(true);
- containerFigure.setLayoutManager(fillLayout);
-
- return containerFigure;
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- if (editPart instanceof CategoryEditPart)
- {
- if (direction == KeyBoardAccessibilityEditPolicy.OUT_TO_PARENT)
- {
- return getParent();
- }
- }
- else if (editPart instanceof XSDSchemaEditPart)
- {
- if (direction == KeyBoardAccessibilityEditPolicy.IN_TO_FIRST_CHILD)
- {
- return (EditPart)getChildren().get(0);
- }
- }
- return ((XSDSchemaEditPart)getParent()).doGetRelativeEditPart(editPart, direction);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getContentPane()
- */
- public IFigure getContentPane()
- {
- return super.getContentPane();
- }
-
- protected List getModelChildren()
- {
- Holder holder = (Holder) getModel();
- return holder.getList();
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java
deleted file mode 100644
index 13d4e52f2c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSimpleTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseTypeConnectingEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.CenteredConnectionAnchor;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.ColumnEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.TypeReferenceConnection;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.RoundedLineBorder;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.StructureFigure;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class XSDSimpleTypeEditPart extends BaseTypeConnectingEditPart
-{
- StructureFigure figure;
- protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
-
- public XSDSimpleTypeEditPart()
- {
- super();
- }
-
- public XSDSimpleTypeDefinition getXSDSimpleTypeDefinition()
- {
- return (XSDSimpleTypeDefinition)((XSDSimpleTypeDefinitionAdapter)getModel()).getTarget();
- }
-
- protected IFigure createFigure()
- {
- figure = new StructureFigure();
- figure.setBorder(new RoundedLineBorder(1, 10));
- ToolbarLayout toolbarLayout = new ToolbarLayout();
- toolbarLayout.setStretchMinorAxis(true);
- figure.setLayoutManager(toolbarLayout);
- return figure;
- }
-
- protected void refreshVisuals()
- {
- XSDSimpleTypeDefinitionAdapter adapter = (XSDSimpleTypeDefinitionAdapter)getModel();
- String name = adapter.getDisplayName();
- HeadingFigure headingFigure = figure.getHeadingFigure();
- headingFigure.setIsReadOnly(adapter.isReadOnly());
- Label label = headingFigure.getLabel();
- label.setText(name);
- label.setIcon(adapter.getImage());
- }
-
- public IStructureFigure getStructureFigure()
- {
- return (IStructureFigure)getFigure();
- }
-
- public IFigure getContentPane()
- {
- return getStructureFigure().getContentPane();
- }
-
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
- }
-
- public void addFeedback()
- {
- getStructureFigure().addSelectionFeedback();
- super.addFeedback();
- }
-
- public void removeFeedback()
- {
- getStructureFigure().removeSelectionFeedback();
- super.removeFeedback();
- }
-
- public ReferenceConnection createConnectionFigure(BaseEditPart child)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public TypeReferenceConnection createConnectionFigure()
- {
- TypeReferenceConnection connectionFigure = null;
- XSDSimpleTypeDefinitionAdapter adapter = (XSDSimpleTypeDefinitionAdapter)getModel();
- IType superType = adapter.getSuperType();
-
- if (superType != null)
- {
- AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart)getTargetEditPart(superType);
-
- if (referenceTypePart != null)
- {
- connectionFigure = new TypeReferenceConnection();
- // draw a line out from the top
- connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.TOP, 1));
-
- // TODO (cs) need to draw the target anchor to look like a UML inheritance relationship
- // adding a label to the connection would help to
- connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(referenceTypePart.getFigure(), CenteredConnectionAnchor.BOTTOM, 0, 0));
- connectionFigure.setHighlight(false);
- }
- }
- return connectionFigure;
- }
-
- private EditPart getTargetEditPart(IType type)
- {
- ColumnEditPart columnEditPart = null;
- for (EditPart editPart = this; editPart != null; editPart = editPart.getParent())
- {
- if (editPart instanceof ColumnEditPart)
- {
- columnEditPart = (ColumnEditPart)editPart;
- break;
- }
- }
- if (columnEditPart != null)
- {
- for (Iterator i = columnEditPart.getChildren().iterator(); i.hasNext(); )
- {
- EditPart child = (EditPart)i.next();
- if (child.getModel() == type)
- {
- return child;
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java
deleted file mode 100644
index ae847ef035..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts.model;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-/**
- * Dummy class to add space to field list
- *
- */
-public class SpaceFiller implements IField
-{
- String kind;
- public SpaceFiller(String kind)
- {
- super();
- this.kind = kind;
- }
-
- public Image getImage()
- {
- if (kind.equals("attribute")) //$NON-NLS-1$
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDAttribute.gif"); //$NON-NLS-1$
- }
- else
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"); //$NON-NLS-1$
- }
- }
-
- public String getKind()
- {
- return kind;
- }
-
- public void setKind(String kind)
- {
- this.kind = kind;
- }
-
- public boolean isGlobal()
- {
- return false;
- }
-
- public IComplexType getContainerType()
- {
- return null;
- }
-
- public String getName()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTypeName()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTypeNameQualifier()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public IType getType()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int getMinOccurs()
- {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public int getMaxOccurs()
- {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public Command getUpdateMinOccursCommand(int minOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateMaxOccursCommand(int maxOccurs)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateTypeNameCommand(String typeName, String quailifier)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getUpdateNameCommand(String name)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command getDeleteCommand()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void registerListener(IADTObjectListener listener)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
- // TODO Auto-generated method stub
-
- }
-
- public boolean isReadOnly()
- {
- return true;
- }
-
- public IModel getModel()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isReference()
- {
- // TODO Auto-generated method stub
- return false;
- }
-}
-
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/TargetConnectionSpaceFiller.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/TargetConnectionSpaceFiller.java
deleted file mode 100644
index fcbb8a2d29..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/TargetConnectionSpaceFiller.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editparts.model;
-
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-
-public class TargetConnectionSpaceFiller implements IADTObject
-{
- private XSDBaseAdapter adapter;
-
- public TargetConnectionSpaceFiller(XSDBaseAdapter adapter)
- {
- this.adapter = adapter;
- }
-
- /**
- * @deprecated remove this
- * @return
- */
- public XSDBaseAdapter getAdapter()
- {
- return adapter;
- }
-
- public void registerListener(IADTObjectListener listener)
- {
-
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
-
- }
-
- public boolean isReadOnly()
- {
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/DragAndDropEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/DragAndDropEditPolicy.java
deleted file mode 100644
index e5bbbcc400..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/DragAndDropEditPolicy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editpolicies;
-
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.wst.xsd.ui.internal.commands.DragAndDropCommand;
-
-public class DragAndDropEditPolicy extends org.eclipse.gef.editpolicies.GraphicalEditPolicy
-{
- protected EditPartViewer viewer;
- protected SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy;
-
- public DragAndDropEditPolicy(EditPartViewer viewer, SelectionHandlesEditPolicyImpl selectionHandlesEditPolicy)
- {
- this.viewer = viewer;
- this.selectionHandlesEditPolicy = selectionHandlesEditPolicy;
- }
-
- public boolean understandsRequest(Request req)
- {
- return true;
- }
-
-
- public org.eclipse.gef.commands.Command getCommand(Request request)
- {
- DragAndDropCommand command = null;
- if (request instanceof ChangeBoundsRequest)
- {
- command = new DragAndDropCommand(viewer, (ChangeBoundsRequest)request);
- selectionHandlesEditPolicy.setDragAndDropCommand(command);
- }
- return command;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java
deleted file mode 100644
index 3a8b31801d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editpolicies;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.tools.DragEditPartsTracker;
-
-
-public class GraphNodeDragTracker extends DragEditPartsTracker
-{
- protected EditPart editPart;
-
- public GraphNodeDragTracker(EditPart editPart)
- {
- super(editPart);
- this.editPart = editPart;
- }
-
- protected Command getCommand()
- {
- Request request = getTargetRequest();
- return editPart.getCommand(request);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java
deleted file mode 100644
index 655916c00b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editpolicies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.FreeformLayout;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Polyline;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.handles.MoveHandleLocator;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.commands.DragAndDropCommand;
-
-
-public class SelectionHandlesEditPolicyImpl extends ADTSelectionFeedbackEditPolicy
-{
- protected IFigure feedback;
- protected Rectangle originalLocation;
- protected DragAndDropCommand dragAndDropCommand;
- protected Polyline polyLine;
- protected RectangleFigure ghostShape;
-
- protected List createSelectionHandles()
- {
- List list = new ArrayList();
- EditPart editPart = getHost();
-
- if (editPart instanceof GraphicalEditPart)
- {
- GraphicalEditPart graphicalEditPart = (GraphicalEditPart)editPart;
- IFigure figure = (graphicalEditPart instanceof BaseEditPart) ?
- ((BaseEditPart)graphicalEditPart).getFigure() :
- graphicalEditPart.getFigure();
-
- Cursor cursorFigure = figure.getCursor();
- MoveHandleLocator loc = new MoveHandleLocator(figure);
- MoveHandle moveHandle = new MoveHandle(graphicalEditPart, loc);
- moveHandle.setCursor(cursorFigure);
- list.add(moveHandle);
- }
-
- return list;
- }
-
-
- public boolean understandsRequest(Request request)
- {
- boolean result = false;
-
- if (REQ_MOVE.equals(request.getType()))
- {
- result = false; // return false to disable move for now
- }
- else
- {
- result = super.understandsRequest(request);
- }
- return result;
- }
-
-
- public org.eclipse.gef.commands.Command getCommand(Request request)
- {
- return null;
- }
-
- public void setDragAndDropCommand(DragAndDropCommand dragAndDropCommand)
- {
- this.dragAndDropCommand = dragAndDropCommand;
- }
-
- protected org.eclipse.gef.commands.Command getMoveCommand(ChangeBoundsRequest request)
- {
- ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_MOVE_CHILDREN);
- req.setEditParts(getHost());
-
- req.setMoveDelta(request.getMoveDelta());
- req.setSizeDelta(request.getSizeDelta());
- req.setLocation(request.getLocation());
-
- return getHost().getParent().getCommand(req);
- }
-
- public void showSourceFeedback(Request request)
- {
- if (REQ_MOVE.equals(request.getType()) ||
- REQ_ADD.equals(request.getType()))
- showChangeBoundsFeedback((ChangeBoundsRequest)request);
- }
-
- protected void showChangeBoundsFeedback(ChangeBoundsRequest request)
- {
- IFigure p = getDragSourceFeedbackFigure();
- Rectangle r = originalLocation.getTranslated(request.getMoveDelta());
- Dimension resize = request.getSizeDelta();
- r.width += resize.width;
- r.height+= resize.height;
-
- ((GraphicalEditPart)getHost()).getFigure().translateToAbsolute(r);
-
- p.translateToRelative(r);
- Rectangle pBounds = r.getCopy();
-
- if (dragAndDropCommand != null && dragAndDropCommand.canExecute())
- {
- int size = request.getEditParts().size();
- if (size > 0 && request.getEditParts().get(size - 1) == getHost())
- {
- PointList pointList = dragAndDropCommand.getConnectionPoints(r);
- if (pointList != null && pointList.size() > 0)
- {
- polyLine.setPoints(pointList);
-
- Point firstPoint = pointList.getFirstPoint();
- if (firstPoint != null)
- {
- pBounds = pBounds.getUnion(new Rectangle(firstPoint.x, firstPoint.y, 1, 1));
- }
- }
- }
- }
- p.setBounds(pBounds);
- ghostShape.setBounds(r);
- p.validate();
- }
-
-
-
-
- protected IFigure getDragSourceFeedbackFigure()
- {
- EditPart editPart = getHost();
- if (feedback == null && editPart instanceof BaseEditPart)
- {
- BaseEditPart baseEditPart = (BaseEditPart)editPart;
- originalLocation = new Rectangle(baseEditPart.getFigure().getBounds());
- feedback = createDragSourceFeedbackFigure(baseEditPart.getFigure());
- }
- return feedback;
- }
-
- protected IFigure createDragSourceFeedbackFigure(IFigure draggedFigure)
- {
- // Use a ghost rectangle for feedback
- Figure panel = new Figure();
- panel.setLayoutManager(new FreeformLayout());
-
- ghostShape = new RectangleFigure();
- FigureUtilities.makeGhostShape(ghostShape);
- ghostShape.setLineStyle(Graphics.LINE_DASHDOT);
- ghostShape.setForegroundColor(ColorConstants.white);
- ghostShape.setOpaque(false);
-
- Rectangle r = draggedFigure.getBounds();
- panel.setOpaque(false);
- panel.add(ghostShape);
-
- polyLine = new Polyline();
- //polyLine.setLineStyle(Graphics.LINE_DASHDOT);
- polyLine.setLineWidth(1);
- panel.add(polyLine);
-
- panel.setBounds(r);
- ghostShape.setBounds(r);
-
- addFeedback(panel);
-
- return panel;
- }
-
- public void deactivate()
- {
- if (feedback != null)
- {
- removeFeedback(feedback);
- feedback = null;
- }
- hideFocus();
- super.deactivate();
- }
-
- /**
- * Erase feedback indicating that the receiver object is
- * being dragged. This method is called when a drag is
- * completed or cancelled on the receiver object.
- * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
- */
- protected void eraseChangeBoundsFeedback(ChangeBoundsRequest request)
- {
- if (feedback != null)
- {
- removeFeedback(feedback);
- }
- feedback = null;
- originalLocation = null;
- }
-
- /**
- * Erase feedback indicating that the receiver object is
- * being dragged. This method is called when a drag is
- * completed or cancelled on the receiver object.
- * @param dragTracker org.eclipse.gef.tools.DragTracker The drag tracker of the tool performing the drag.
- */
- public void eraseSourceFeedback(Request request)
- {
- if (REQ_MOVE.equals(request.getType()) || REQ_ADD.equals(request.getType()))
- {
- eraseChangeBoundsFeedback((ChangeBoundsRequest)request);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelComponentLabelCellEditorLocator.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelComponentLabelCellEditorLocator.java
deleted file mode 100644
index a594a502f9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelComponentLabelCellEditorLocator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.editpolicies;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.LabelCellEditorLocator;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.INamedEditPart;
-
-public class TopLevelComponentLabelCellEditorLocator extends LabelCellEditorLocator
-{
- public TopLevelComponentLabelCellEditorLocator(INamedEditPart namedEditPart, Point cursorLocation)
- {
- super(namedEditPart, cursorLocation);
- }
-
- public void relocate(CellEditor celleditor)
- {
- Text text = (Text) celleditor.getControl();
-
- Label label = namedEditPart.getNameLabelFigure();
-
- if (text.getBounds().x <= 0)
- {
- super.relocate(celleditor);
- }
- else
- {
- org.eclipse.swt.graphics.Point sel = text.getSelection();
- org.eclipse.swt.graphics.Point pref = text.computeSize(-1, -1);
- Rectangle rect = label.getTextBounds().getCopy();
- label.translateToAbsolute(rect);
- text.setBounds(rect.x, rect.y-1, rect.width, pref.y+1);
- text.setSelection(0);
- text.setSelection(sel);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java
deleted file mode 100644
index ad125399d4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.ScrollPane;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.ViewportLayout;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.HeadingFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.RoundedLineBorder;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.FillLayout;
-
-public class CategoryFigure extends Figure
-{
- protected ScrollPane scrollpane;
- protected Figure outerPane;
- public HeadingFigure headingFigure;
- Figure contentPane;
-
- public CategoryFigure(int type)
- {
- super();
-
- outerPane = new Figure();
- outerPane.setBorder(new RoundedLineBorder(1, 6));
-
- ToolbarLayout layout = new ToolbarLayout(false);
- layout.setVertical(true);
- layout.setStretchMinorAxis(true);
- FillLayout fillLayout = new FillLayout(3);
- fillLayout.setHorizontal(false);
-
- FillLayout outerLayout = new FillLayout();
- outerPane.setLayoutManager(outerLayout);
-
- add(outerPane);
-
- headingFigure = new HeadingFigure();
- outerPane.add(headingFigure);
-
- Figure line = new Figure();
- line.setBorder(new LineBorder(1));
- ToolbarLayout lineLayout = new ToolbarLayout(false);
- lineLayout.setVertical(true);
- lineLayout.setStretchMinorAxis(true);
- line.setLayoutManager(lineLayout);
- outerPane.add(line);
-
- scrollpane = new ScrollPane();
- scrollpane.setForegroundColor(ColorConstants.black);
- scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC);
- outerPane.add(scrollpane);
-
- Figure pane = new Figure();
- pane.setBorder(new MarginBorder(5, 8, 5, 8));
- ToolbarLayout toolbarLayout = new ToolbarLayout(false);
- toolbarLayout.setSpacing(3);
- pane.setLayoutManager(toolbarLayout); // good
-
- Viewport viewport = new Viewport();
- viewport.setContentsTracksHeight(true);
- ViewportLayout viewportLayout = new ViewportLayout();
- viewport.setLayoutManager(viewportLayout);
-
- scrollpane.setViewport(viewport);
- scrollpane.setContents(pane);
- }
-
- public HeadingFigure getHeadingFigure()
- {
- return headingFigure;
- }
-
- public ScrollPane getScrollPane()
- {
- return scrollpane;
- }
-
- public IFigure getContentPane()
- {
- return scrollpane.getContents();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java
deleted file mode 100644
index 81ec1d5435..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RoundedRectangle;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.design.editparts.ReferenceConnection;
-
-public class CenteredIconFigure extends RoundedRectangle
-{
- public static final int NORMAL = 0;
- public static final int SELECTED = 1;
- public static final int HOVER = 2;
- public Image image;
- protected Label toolTipLabel;
- protected int mode = 0;
-
- public CenteredIconFigure()
- {
- super();
- setFill(true);
- toolTipLabel = new Label();
- setCornerDimensions(new Dimension(5,5));
- }
-
- public void refresh()
- {
- repaint();
- }
-
- protected void outlineShape(Graphics graphics)
- {
- graphics.pushState();
- try
- {
- if (mode == NORMAL)
- { // TODO: common up and organize colors....
- graphics.setForegroundColor(ReferenceConnection.inactiveConnection);
- }
- else if (mode == SELECTED)
- {
- graphics.setForegroundColor(ColorConstants.black);
- }
- super.outlineShape(graphics);
- }
- finally
- {
- graphics.popState();
- }
- }
-
- protected void fillShape(Graphics g)
- {
- super.fillShape(g);
- if (image != null)
- {
- Rectangle r = getBounds();
- Dimension imageSize = new Dimension(15, 15);
- g.drawImage(image, r.x + (r.width - imageSize.width)/2, r.y + (r.height - imageSize.height)/2 - 1);
- }
- }
-
- public Label getToolTipLabel()
- {
- return toolTipLabel;
- }
-
- public void setMode(int mode)
- {
- this.mode = mode;
- }
-
- public void setToolTipText(String text)
- {
- if (text.length() > 0)
- {
- setToolTip(toolTipLabel);
- toolTipLabel.setText(text);
- }
- else
- {
- setToolTip(null);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java
deleted file mode 100644
index c0117ce8cb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.figures;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.ModelGroupLayout;
-
-public class GenericGroupFigure extends Figure
-{
- protected CenteredIconFigure centeredIconFigure;
- protected Figure contentFigure;
- protected String text;
- protected boolean hasText = false;
- protected Label textFigure;
-
- public GenericGroupFigure()
- {
- super();
- setLayoutManager(new ModelGroupLayout(true));
-
- centeredIconFigure = new CenteredIconFigure();
- centeredIconFigure.setPreferredSize(new Dimension(15, 15));
-
- add(centeredIconFigure);
- contentFigure = new Figure();
- contentFigure.setLayoutManager(new ModelGroupLayout(false, 0));
- add(contentFigure);
- }
-
- public void setText(String text)
- {
- this.text = text;
- hasText = false;
- if (text != null && text.length() > 0)
- {
- hasText = true;
- }
- }
-
- public boolean hasText()
- {
- return hasText;
- }
-
- public String getText()
- {
- return text;
- }
-
- public Point getTextCoordinates()
- {
- Rectangle rect = centeredIconFigure.getBounds();
- return new Point(rect.x, rect.y + 14);
- }
-
- public void setIconFigure(Image image)
- {
- centeredIconFigure.image = image;
- }
-
- public CenteredIconFigure getTargetFigure()
- {
- return centeredIconFigure;
- }
-
- public CenteredIconFigure getIconFigure()
- {
- return centeredIconFigure;
- }
-
- public Figure getContentFigure()
- {
- return contentFigure;
- }
-
- public void setToolTipText(String text)
- {
- centeredIconFigure.setToolTipText(text);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java
deleted file mode 100644
index b4ef29f118..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.figures;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-
-public class HyperLinkLabel extends Label
-{
- protected void paintFigure(Graphics graphics)
- {
- super.paintFigure(graphics);
- graphics.setFont(getFont());
-
- // TODO (cs) this lookup to find " :" is a hack
- // that's specialized for element and type label text
- // we need to make the TopLevelComponent use two labels in this case
- //
- String string = getText();
- int index = string.indexOf(" :");
- if (index != -1)
- {
- string = string.substring(0, index);
- }
- // end hack
-
- Point p = getTextLocation();
- Dimension textSize = FigureUtilities.getTextExtents(string, getFont());
- int textWidth = textSize.width;
- int textHeight = textSize.height;
- int descent = graphics.getFontMetrics().getDescent();
- int lineY = bounds.y + p.y + textHeight - descent + 1;
- int lineX = bounds.x + p.x;
- graphics.drawLine(lineX, lineY, lineX + textWidth, lineY);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java
deleted file mode 100644
index e107b577a4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.figures;
-
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFigureFactory;
-
-public interface IExtendedFigureFactory extends IFigureFactory
-{
- IModelGroupFigure createModelGroupFigure(Object model);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java
deleted file mode 100644
index 10ff423a21..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.figures;
-
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IADTFigure;
-
-public interface IModelGroupFigure extends IADTFigure
-{
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java
deleted file mode 100644
index 7009930d7c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.figures;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class ModelGroupFigure extends GenericGroupFigure implements IModelGroupFigure
-{
- public static final Image SEQUENCE_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/sequence_obj.gif"); //$NON-NLS-1$
- public static final Image SEQUENCE_ICON_DISABLED_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/sequencedis_obj.gif"); //$NON-NLS-1$
- public static final Image CHOICE_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/choice_obj.gif"); //$NON-NLS-1$
- public static final Image CHOICE_ICON_DISABLED_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/choicedis_obj.gif"); //$NON-NLS-1$
- public static final Image ALL_ICON_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/all_obj.gif"); //$NON-NLS-1$
- public static final Image ALL_ICON_DISABLED_IMAGE = XSDEditorPlugin.getPlugin().getIcon("obj16/alldis_obj.gif"); //$NON-NLS-1$
-
- public ModelGroupFigure()
- {
- super();
- }
-
- public void setIconFigure(Image image)
- {
- centeredIconFigure.image = image;
- }
-
- public void addSelectionFeedback()
- {
- // TODO Auto-generated method stub
-
- }
-
- public void editPartAttached(EditPart owner)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void refreshVisuals(Object model)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void removeSelectionFeedback()
- {
- // TODO Auto-generated method stub
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java
deleted file mode 100644
index fa6a55a68f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.figures;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class SpacingFigure extends Label
-{
- public SpacingFigure()
- {
- super(""); //$NON-NLS-1$
- setIcon(XSDEditorPlugin.getXSDImage("icons/Dot.gif")); //$NON-NLS-1$
- setBorder(new MarginBorder(3, 0, 3, 0));
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ContainerLayout.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ContainerLayout.java
deleted file mode 100644
index 6209800b93..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ContainerLayout.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.layouts;
-
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.ui.internal.design.figures.SpacingFigure;
-
-
-public class ContainerLayout extends AbstractLayout
-{
- protected boolean isHorizontal;
- protected int spacing = 0;
- protected int border = 0;
-
- public ContainerLayout()
- {
- this(true, 0);
- }
-
- public ContainerLayout(boolean isHorizontal, int spacing)
- {
- this.isHorizontal = isHorizontal;
- this.spacing = spacing;
- }
-
- public void setHorizontal(boolean isHorizontal)
- {
- this.isHorizontal = isHorizontal;
- }
-
- public void setSpacing(int spacing)
- {
- this.spacing = spacing;
- }
-
- public void setBorder(int border)
- {
- this.border = border;
- }
-
- protected int alignFigure(IFigure parent, IFigure child)
- {
- return -1;
- }
-
- /**
- * Calculates and returns the preferred size of the container
- * given as input.
- *
- * @param figure Figure whose preferred size is required.
- * @return The preferred size of the passed Figure.
- * @since 2.0
- */
- protected Dimension calculatePreferredSizeHelper(IFigure parent)
- {
- Dimension preferred = new Dimension();
- List children = parent.getChildren();
-
- for (int i=0; i < children.size(); i++)
- {
- IFigure child = (IFigure)children.get(i);
-
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- preferred.width += childSize.width;
- preferred.height = Math.max(preferred.height, childSize.height);
- }
- else
- {
- preferred.height += childSize.height;
- preferred.width = Math.max(preferred.width, childSize.width);
- }
- }
-
- int childrenSize = children.size();
- if (childrenSize > 1)
- {
- if (isHorizontal)
- {
- preferred.width += spacing * (childrenSize - 1);
- }
- else
- {
- preferred.height += spacing * (childrenSize - 1);
- }
- }
-
- preferred.width += border * 2;
- preferred.height += border * 2;
- preferred.width += parent.getInsets().getWidth();
- preferred.height += parent.getInsets().getHeight();
-
- return preferred;
- }
-
- protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
- {
- Dimension preferred = null;
-
- // Here we ensure that an unexpanded container is given a size of (0,0)
- //
-// if (parent instanceof IExpandable)
-// {
-// IExpandable expandableFigure = (IExpandable)parent;
-// if (!expandableFigure.isExpanded())
-// {
-// preferred = new Dimension();
-// }
-// }
-
- if (preferred == null)
- {
- preferred = calculatePreferredSizeHelper(parent);
- }
-
- return preferred;
- }
-
-
- protected void adjustLayoutLocation(IFigure parent, Dimension dimension)
- {
- }
-
- public void layout(IFigure parent)
- {
- List children = parent.getChildren();
-
- int rx = 0;
- Dimension dimension = new Dimension();
-
-
- for (int i=0; i < children.size(); i++)
- {
- IFigure child = (IFigure)children.get(i);
- Dimension childSize = child.getPreferredSize();
- if (isHorizontal)
- {
- dimension.height = Math.max(dimension.height, childSize.height);
- rx += childSize.width;
- }
- else
- {
- dimension.width = Math.max(dimension.width, childSize.width);
- }
- }
-
- //dimension.width += parent.getInsets().left;
- //dimension.height += parent.getInsets().top;
-
- if (isHorizontal)
- {
- dimension.height += border*2;
- dimension.width += border;
- }
- else
- {
- dimension.width += border*2;
- dimension.height += border;
- }
- adjustLayoutLocation(parent, dimension);
-
- for (int i=0; i < children.size(); i++)
- {
- IFigure child = (IFigure)children.get(i);
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- int y = -1;
-
- y = alignFigure(parent, child);
-
- if (y == -1)
- {
- y = (dimension.height - childSize.height) / 2;
- }
-
- Rectangle rectangle = new Rectangle(dimension.width, y, childSize.width, childSize.height);
- rectangle.translate(parent.getClientArea().getLocation());
-
-
- child.setBounds(rectangle);
- dimension.width += childSize.width;
- dimension.width += spacing;
-
- if (child instanceof SpacingFigure)
- {
- int availableHorizontalSpace = parent.getClientArea().width - rx;
- dimension.width += availableHorizontalSpace;
- }
- }
- else
- {
- Rectangle rectangle = new Rectangle(0, dimension.height, childSize.width, childSize.height);
- rectangle.translate(parent.getClientArea().getLocation());
-
-
- child.setBounds(rectangle);
- dimension.height += childSize.height;
- dimension.height += spacing;
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/FillLayout.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/FillLayout.java
deleted file mode 100644
index 14fe8e5b3d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/FillLayout.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.layouts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-public class FillLayout extends AbstractLayout
-{
- protected boolean isHorizontal = false;
- protected int spacing = 0;
- public Dimension min;
-
- public FillLayout()
- {
- }
-
- public FillLayout(int spacing)
- {
- this.spacing = spacing;
- }
-
- public void setHorizontal(boolean isHorizontal)
- {
- this.isHorizontal = isHorizontal;
- }
-
- /**
- * Calculates and returns the preferred size of the input container. This is
- * the size of the largest child of the container, as all other children fit
- * into this size.
- *
- * @param figure
- * Container figure for which preferred size is required.
- * @return The preferred size of the input figure.
- */
-
- protected Dimension calculatePreferredSize(IFigure figure, int width, int height)
- {
- Dimension d = calculatePreferredClientAreaSize(figure);
- d.expand(figure.getInsets().getWidth(), figure.getInsets().getHeight());
- d.union(getBorderPreferredSize(figure));
- return d;
- }
-
- protected Dimension calculatePreferredClientAreaSize(IFigure figure)
- {
- Dimension d = new Dimension();
- List children = figure.getChildren();
-
- for (Iterator i = children.iterator(); i.hasNext();)
- {
- IFigure child = (IFigure) i.next();
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- d.width += childSize.width;
- d.height = Math.max(childSize.height, d.height);
- }
- else
- {
- d.height += childSize.height;
- d.width = Math.max(childSize.width, d.width);
- }
- }
-
- int childrenSize = children.size();
- if (childrenSize > 0)
- {
- if (isHorizontal)
- {
- d.width += spacing * (childrenSize - 1);
- }
- else
- {
- d.height += spacing * (childrenSize - 1);
- }
- }
-
- if (min != null)
- {
- d.width = Math.max(d.width, min.width);
- d.height = Math.max(d.height, min.height);
- }
- return d;
- }
-
- /*
- * Returns the minimum size required by the input container. This is the size
- * of the largest child of the container, as all other children fit into this
- * size.
- */
- public Dimension getMinimumSize(IFigure figure, int width, int height)
- {
- Dimension d = new Dimension();
- List children = figure.getChildren();
- IFigure child;
-
- for (int i = 0; i < children.size(); i++)
- {
- child = (IFigure) children.get(i);
- d.union(child.getMinimumSize());
- }
- d.expand(figure.getInsets().getWidth(), figure.getInsets().getHeight());
- return d;
- }
-
- public Dimension getPreferredSize(IFigure figure, int width, int height)
- {
- return calculatePreferredSize(figure, width, height);
- }
-
- /*
- * Lays out the children on top of each other with their sizes equal to that
- * of the available paintable area of the input container figure.
- */
- public void layout(IFigure figure)
- {
- Dimension preferredSize = calculatePreferredClientAreaSize(figure);
- Rectangle r = figure.getClientArea().getCopy();
- List children = figure.getChildren();
-
- int nChildren = children.size();
- int extraHorizontalSpace = r.width - preferredSize.width;
-
- for (Iterator i = children.iterator(); i.hasNext();)
- {
- IFigure child = (IFigure) i.next();
- Dimension preferredChildSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- int w = preferredChildSize.width + (extraHorizontalSpace / nChildren);
- child.setBounds(new Rectangle(r.x, r.y, w, Math.max(preferredSize.height, r.height)));
- r.x += w + spacing;
- }
- else
- {
- child.setBounds(new Rectangle(r.x, r.y, Math.max(preferredSize.width, r.width), preferredChildSize.height));
- r.y += preferredChildSize.height + spacing;
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ModelGroupLayout.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ModelGroupLayout.java
deleted file mode 100644
index 69f7b79e9d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ModelGroupLayout.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.design.layouts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.wst.xsd.ui.internal.design.figures.ModelGroupFigure;
-import org.eclipse.wst.xsd.ui.internal.design.figures.SpacingFigure;
-
-public class ModelGroupLayout extends AbstractLayout
-{
- protected boolean isHorizontal;
- protected int spacing = 10;
- protected int border = 0;
-
- public ModelGroupLayout()
- {
- this(0);
- }
-
- public ModelGroupLayout(boolean isHorizontal)
- {
- this.isHorizontal = isHorizontal;
- }
-
- public ModelGroupLayout(boolean isHorizontal, int spacing)
- {
- this.isHorizontal = isHorizontal;
- this.spacing = spacing;
- }
-
- public ModelGroupLayout(int spacing)
- {
- super();
- this.spacing = spacing;
- }
-
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
- {
- Dimension preferred = new Dimension();
- List children = container.getChildren();
-
- for (int i = 0; i < children.size(); i++)
- {
- IFigure child = (IFigure) children.get(i);
-
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- preferred.width += childSize.width;
- preferred.height = Math.max(preferred.height, childSize.height);
- }
- else
- {
- preferred.height += childSize.height;
- preferred.width = Math.max(preferred.width, childSize.width);
- }
- }
-
- int childrenSize = children.size();
- if (childrenSize > 1)
- {
- if (isHorizontal)
- {
- preferred.width += spacing * (childrenSize - 1);
- }
- else
- {
- preferred.height += spacing * (childrenSize - 1);
- }
- }
-
- preferred.width += border * 2;
- preferred.height += border * 2;
- preferred.width += container.getInsets().getWidth();
- preferred.height += container.getInsets().getHeight();
-
- return preferred;
- }
-
- public void layout(IFigure container)
- {
- List children = container.getChildren();
-
- int rx = 0;
- Dimension dimension = new Dimension();
-
- for (int i = 0; i < children.size(); i++)
- {
- IFigure child = (IFigure) children.get(i);
- Dimension childSize = child.getPreferredSize();
- if (isHorizontal)
- {
- dimension.height = Math.max(dimension.height, childSize.height);
- rx += childSize.width;
- }
- else
- {
- dimension.width = Math.max(dimension.width, childSize.width);
- }
- }
-
- if (isHorizontal)
- {
- dimension.height += border * 2;
- dimension.width += border;
- }
- else
- {
- dimension.width += border * 2;
- dimension.height += border;
- }
-
- Rectangle r = container.getClientArea();
- dimension = new Dimension(r.width, r.height);
- Point p = new Point(0, 0);
-
- for (Iterator i = children.iterator(); i.hasNext();)
- {
- IFigure child = (IFigure) i.next();
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- Rectangle rectangle = new Rectangle(p.x, 0, childSize.width, childSize.height);
-
- // last child
- if (!i.hasNext())
- {
- rectangle.width = dimension.width - rectangle.x;
- }
-
- if (p.x == 0)
- {
- rectangle.y = r.height / 2 - childSize.height / 2;
- }
- else
- {
- rectangle.y = r.height / 2 - childSize.height / 2;
- }
-
- rectangle.translate(container.getClientArea().getLocation());
- child.setBounds(rectangle);
- p.x += childSize.width;
- p.x += spacing;
-
- }
- else
- {
- Rectangle rectangle = new Rectangle(0, p.y, childSize.width, childSize.height);
-
- if (child instanceof SpacingFigure)
- {
- rectangle.x = dimension.width + 6;
- }
- else if (child instanceof ModelGroupFigure)
- {
- rectangle.width = dimension.width - rectangle.x;
- }
- else
- {
- rectangle.width = dimension.width - rectangle.x;
- }
-
- rectangle.translate(container.getClientArea().getLocation());
- child.setBounds(rectangle);
- p.y += childSize.height;
- p.y += spacing;
- }
- }
- }
-
- public void setSpacing(int spacing)
- {
- this.spacing = spacing;
- }
-
- protected int alignFigure(IFigure parent, IFigure child)
- {
- return -1;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/BuiltInTypesTreeViewerProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/BuiltInTypesTreeViewerProvider.java
deleted file mode 100644
index f0cecbb770..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/BuiltInTypesTreeViewerProvider.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Trung de Irene <trungha@ca.ibm.com>
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.util.XSDConstants;
-
-
-/**
- * This class provides the content for SelectBuiltInTypesForFilterDialog
- * readability Warning: Some simple tricks to tweak efficiency are used
- */
-public class BuiltInTypesTreeViewerProvider {
-
- ILabelProvider labelProvider;
-
- ITreeContentProvider contentProvider;
-
-// private static final String CONST_PARENT = "parent";
-
- /**
- * Currently there are 3 subgroups: Numbers, Data and Time, Other
- * Folks can choose to expand to more subgroups
- */
- private static int BUILT_IN_TYPES_SUB_GROUP = 3;
-
- static String[] numberTypes =
- { "base64Binary", "byte", "decimal", "double", "float", "hexBinary",
- "int", "integer", "long", "negativeInteger", "nonNegativeInteger",
- "nonPositiveInteger", "positiveInteger", "short", "unsignedByte",
- "unsignedInt", "unsignedLong", "unsignedShort"};
-
- static String[] dateAndTimeTypes =
- { "date", "dateTime", "duration", "gDay",
- "gMonth", "gMonthDay", "gYear", "gYearMonth", "time"};
-
-
- public static List getAllBuiltInTypes() {
- List items = new ArrayList();
- //for (int i = 0; i < XSDDOMHelper.dataType.length; i++) {
- // items.add(XSDDOMHelper.dataType[i][0]);
- //}
- Iterator it = items.iterator();
-
- List mainContainer = new ArrayList(BUILT_IN_TYPES_SUB_GROUP);
- ComponentSpecification header = new ComponentSpecification("", "Root", null);
- mainContainer.add(header);
-
- List numbersGroup = new ArrayList();
- header = new ComponentSpecification("", "Numbers", null);
- numbersGroup.add(header);
- mainContainer.add(numbersGroup);
-
- List dateAndTimeGroup = new ArrayList();
- header = new ComponentSpecification("", "Date and Time", null);
- dateAndTimeGroup.add(header);
- mainContainer.add(dateAndTimeGroup);
-
- List otherGroup = new ArrayList();
- header = new ComponentSpecification("", "Other", null);
- otherGroup.add(header);
- mainContainer.add(otherGroup);
-
- while (it.hasNext()) {
- Object item = it.next();
- String name = item.toString();
-
- ComponentSpecification builtInTypeItem = new ComponentSpecification(name, XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, null);
-
- // if this built-In Type is in Number group
- if ( partOf(name, numberTypes) ){
- // Set parent
- //builtInTypeItem.addAttributeInfo(CONST_PARENT, numbersGroup);
-
- numbersGroup.add(builtInTypeItem);
- }
- // if this built-In Type is in Date-and-Time group
- else if ( partOf(name, dateAndTimeTypes)){
- //builtInTypeItem.addAttributeInfo(CONST_PARENT, dateAndTimeGroup);
- dateAndTimeGroup.add(builtInTypeItem);
- }
- // otherwise, put in Other group
- else {
- //builtInTypeItem.addAttributeInfo(CONST_PARENT, otherGroup);
- otherGroup.add(builtInTypeItem);
- }
- }
-
- return mainContainer;
- }
-
- public ILabelProvider getLabelProvider(){
- if (labelProvider != null)
- return labelProvider;
-
- labelProvider = new BuiltInTypeLabelProvider();
- return labelProvider;
- }
-
- public ITreeContentProvider getContentProvider() {
- if (contentProvider != null)
- return contentProvider;
-
- contentProvider = new BuiltInTypesTreeContentProvider();
- return contentProvider;
- }
-
- /**
- * Determines whether an equivalent of 'item' appears in 'array'
- * @param item
- * @param array
- * @return
- */
- private static boolean partOf(String item, String[] array){
- for(int i = 0; i < array.length; i++ ){
- if ( item.equals(array[i]) ){
- return true;
- }
- }
- return false;
- }
-
- class BuiltInTypeLabelProvider implements ILabelProvider{
- public Image getImage(Object element) {
- if ( getText(element).equals("Numbers") )
- return XSDEditorPlugin.getXSDImage("icons/XSDNumberTypes.gif");
- if ( getText(element).equals("Date and Time") )
- return XSDEditorPlugin.getXSDImage("icons/XSDDateAndTimeTypes.gif");
- if ( getText(element).equals("Other") )
- return XSDEditorPlugin.getXSDImage("icons/browsebutton.gif");
- if ( element instanceof ComponentSpecification ){
- return XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
- }
- return null;
- }
-
- public String getText(Object element) {
- ComponentSpecification spec = null;
-
- /* if not non-leaf node, the first element has the name for
- * the whole list */
- if (element instanceof List){
- spec = (ComponentSpecification) ((List) element).get(0);
- }
- else if (element instanceof ComponentSpecification ){
- spec = (ComponentSpecification) element;
- }
- return spec.getName();
- }
-
- public void addListener(ILabelProviderListener listener) {
-
- }
-
- public void dispose() {
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
-
- }
-
- }
-
-
- class BuiltInTypesTreeContentProvider implements ITreeContentProvider {
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof List) {
- List parentContent = (List) parentElement;
-
- /** Ignore the first element (which contains the name of this list
- * ie. 'Numbers', 'Date and time', 'Other') */
- return parentContent.subList(1, parentContent.size()).toArray();
- }
- return new Object[0];
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (getChildren(element).length > 1) {
- return true;
- }
- return false;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public void dispose() {
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementButtonHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementButtonHandler.java
deleted file mode 100644
index 9c83571743..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementButtonHandler.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.dialogs;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.INewComponentHandler;
-
-public class NewElementButtonHandler implements INewComponentHandler
-{
- public NewElementButtonHandler()
- {
- }
-
- public void openNewComponentDialog()
- {
- NewElementDialog newElementDialog = new NewElementDialog();
- newElementDialog.createAndOpen();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementDialog.java
deleted file mode 100644
index 2a0619b52b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementDialog.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.dialogs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.common.util.XSDCommonUIUtils;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-public class NewElementDialog extends NewComponentDialog implements IComponentDialog
-{
- protected XSDSchema schema;
- protected Object setObject;
- protected int typeKind;
- protected Object selection;
-
- public NewElementDialog()
- {
- super(Display.getCurrent().getActiveShell(), Messages._UI_LABEL_NEW_ELEMENT, "NewElement"); //$NON-NLS-1$
- }
-
- public NewElementDialog(XSDSchema schema)
- {
- super(Display.getCurrent().getActiveShell(), Messages._UI_LABEL_NEW_ELEMENT, "NewElement"); //$NON-NLS-1$
- this.schema = schema;
- }
-
- private void setup() {
- if (schema != null) {
- List usedNames = getUsedElementNames();
- setUsedNames(usedNames);
- setDefaultName(XSDCommonUIUtils.createUniqueElementName("NewElement", schema.getElementDeclarations()));
- }
- }
-
- public int createAndOpen()
- {
- setup();
- int returnCode = super.createAndOpen();
- if (returnCode == 0)
- {
- if (setObject instanceof Adapter)
- {
- //Command command = new AddComplexTypeDefinitionCommand(getName(), schema);
- }
- }
- return returnCode;
- }
-
- public ComponentSpecification getSelectedComponent()
- {
- ComponentSpecification componentSpecification = new ComponentSpecification(null, getName(), null);
- componentSpecification.setMetaName(IXSDSearchConstants.ELEMENT_META_NAME);
- componentSpecification.setNew(true);
- return componentSpecification;
- }
-
- public void setInitialSelection(ComponentSpecification componentSpecification)
- {
- // TODO Auto-generated method stub
- }
-
- private List getUsedElementNames() {
- List usedNames = new ArrayList();
- if (schema != null ) {
- List elementsList = schema.getElementDeclarations();
- Iterator elements = elementsList.iterator();
- while (elements.hasNext()) {
- usedNames.add(((XSDElementDeclaration) elements.next()).getName());
- }
- }
-
- return usedNames;
- }
- }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeButtonHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeButtonHandler.java
deleted file mode 100644
index e815a88b8d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeButtonHandler.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.dialogs;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.INewComponentHandler;
-
-public class NewTypeButtonHandler implements INewComponentHandler
-{
- public NewTypeButtonHandler()
- {
- }
-
- public void openNewComponentDialog()
- {
- NewTypeDialog newTypeDialog = new NewTypeDialog();
- newTypeDialog.createAndOpen();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java
deleted file mode 100644
index a437d6cdab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Trung de Irene <trungha@ca.ibm.com>
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.dialogs;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-/**
- * The BuiltInTypesFilteringDialog is a SelectionDialog that allows the user to
- * select a ...
- */
-public class SelectBuiltInTypesForFilteringDialog extends CheckedTreeSelectionDialog {
-
- public final static String CUSTOM_LIST_SEPARATOR = XSDEditorPlugin.CUSTOM_LIST_SEPARATOR;
-
- public SelectBuiltInTypesForFilteringDialog(Shell parent,
- ILabelProvider labelProvider, ITreeContentProvider contentProvider) {
- super(parent, labelProvider, contentProvider);
-
- init();
- }
-
- public CheckboxTreeViewer getTreeViewer(){
- return super.getTreeViewer();
- }
-
- private void init(){
- // grey state enable
- setContainerMode(true);
-
- setTitle(Messages._UI_LABEL_SET_COMMON_BUILT_IN_TYPES);
- setMessage(Messages._UI_LABEL_SELECT_TYPES_FILTER_OUT);
-
- //super.create();
- //super.getTreeViewer().setSorter(new ViewerSorter());
-
- }
-
- /**
- * Returns a String acting as list of built-in types selected by the user
- * in the filter dialog (white space acts as the item separator).
- * Suggest using getSelectedBuiltInTypesFromString
- * to get a concrete array of selected types.
- * We can only store String in the plugin preference's storage so we have
- * use this method for conversion
- */
- public static String getTypesListInString(Object[] chosenTypes) {
- String returningList = ""; //$NON-NLS-1$
- for (int i = 0; i < chosenTypes.length; i++){
- if ( chosenTypes[i] instanceof ComponentSpecification){
- ComponentSpecification aType =
- (ComponentSpecification) chosenTypes[i];
-
- returningList += aType.getName() + CUSTOM_LIST_SEPARATOR;
- }
- /* else selectedBuiltInTypes[i] instanceof List, ie. a parentNode
- * we ignore it. */
- }
- return returningList;
- }
-
- /**
- * Filters out all built-In type not recorded in the 'listString' and
- * returns the result in a List
- * Warning: recursive method
- * @param listString
- * @param aContainer
- * Containing all types
- * @return a subset of what 'aContainer' has as specified by 'listString'
- */
- public static List getSelectedBuiltInTypesFromString(String listString,
- List aContainer) {
- List selectedTypes = new ArrayList();
-
- // ignore the 'header' item in the container, starting from i = 1
- for (int i = 1; i < aContainer.size(); i++){
- Object o = aContainer.get(i);
- if ( o instanceof ComponentSpecification){
- ComponentSpecification aType = (ComponentSpecification) o;
- String typeName = aType.getName();
- // if typeName's name appears in 'listString'
- if ( listString.indexOf(typeName + CUSTOM_LIST_SEPARATOR) != -1)
- selectedTypes.add(o);
- }
- else if ( o instanceof List){
- selectedTypes.addAll( getSelectedBuiltInTypesFromString(listString, (List) o) );
- }
- }
- return selectedTypes;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java
deleted file mode 100644
index f2a74acc7d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Base class for hyperlinks detectors. Provides a framework and common code for
- * hyperlink detectors. TODO: Can we pull this class further up the inheritance
- * hierarchy?
- */
-public abstract class BaseHyperlinkDetector implements IHyperlinkDetector
-{
- /*
- * (non-Javadoc)
- */
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks)
- {
- if (region == null || textViewer == null)
- {
- return null;
- }
-
- List hyperlinks = new ArrayList(0);
- IDocument document = textViewer.getDocument();
- int offset = region.getOffset();
-
- IDOMNode node = getCurrentNode(document, offset);
-
- // This call allows us to determine whether an attribute is linkable,
- // without incurring the cost of asking for the target component.
-
- if (!isLinkable(node))
- {
- return null;
- }
-
- IRegion hyperlinkRegion = getHyperlinkRegion(node);
-
- // createHyperlink is a template method. Derived classes, should override.
-
- IHyperlink hyperlink = createHyperlink(document, node, hyperlinkRegion);
-
- if (hyperlink != null)
- {
- hyperlinks.add(hyperlink);
- }
-
- if (hyperlinks.size() == 0)
- {
- return null;
- }
-
- return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
- }
-
- /**
- * Determines whether a node is "linkable" that is, the component it refers to
- * can be the target of a "go to definition" navigation.
- *
- * @param node the node to test, must not be null;
- * @return true if the node is linkable, false otherwise.
- */
- private boolean isLinkable(IDOMNode node)
- {
- if (node == null)
- {
- return false;
- }
-
- short nodeType = node.getNodeType();
-
- boolean isLinkable = false;
-
- if (nodeType == Node.ATTRIBUTE_NODE)
- {
- IDOMAttr attr = (IDOMAttr) node;
- String name = attr.getName();
-
- // isLinkableAttribute is a template method. Derived classes should
- // override.
-
- isLinkable = isLinkableAttribute(name);
- }
-
- return isLinkable;
- }
-
- /**
- * Determines whether an attribute is "linkable" that is, the component it
- * points to can be the target of a "go to definition" navigation. Derived
- * classes should override.
- *
- * @param name the attribute name. Must not be null.
- * @return true if the attribute is linkable, false otherwise.
- */
- protected abstract boolean isLinkableAttribute(String name);
-
- /**
- * Creates a hyperlink based on the selected node. Derived classes should
- * override.
- *
- * @param document the source document.
- * @param node the node under the cursor.
- * @param region the text region to use to create the hyperlink.
- * @return a new IHyperlink for the node or null if one cannot be created.
- */
- protected abstract IHyperlink createHyperlink(IDocument document, IDOMNode node, IRegion region);
-
- /**
- * Locates the attribute node under the cursor.
- *
- * @param offset the cursor offset.
- * @param parent the parent node
- * @return an IDOMNode representing the attribute if one is found at the
- * offset or null otherwise.
- */
- protected IDOMNode getAttributeNode(int offset, IDOMNode parent)
- {
- IDOMAttr attrNode = null;
- NamedNodeMap map = parent.getAttributes();
-
- for (int index = 0; index < map.getLength(); index++)
- {
- attrNode = (IDOMAttr) map.item(index);
- boolean located = attrNode.contains(offset);
- if (located)
- {
- if (attrNode.hasNameOnly())
- {
- attrNode = null;
- }
- break;
- }
- }
-
- if (attrNode == null)
- {
- return parent;
- }
- return attrNode;
- }
-
- /**
- * Returns the node the cursor is currently on in the document or null if no
- * node is selected
- *
- * @param offset the current cursor offset.
- * @return IDOMNode either element, doctype, text, attribute or null
- */
- private IDOMNode getCurrentNode(IDocument document, int offset)
- {
- IndexedRegion inode = null;
- IStructuredModel sModel = null;
-
- try
- {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- inode = sModel.getIndexedRegion(offset);
- if (inode == null)
- inode = sModel.getIndexedRegion(offset - 1);
- }
- finally
- {
- if (sModel != null)
- sModel.releaseFromRead();
- }
-
- if (inode instanceof IDOMNode)
- {
- IDOMNode node = (IDOMNode) inode;
-
- if (node.hasAttributes())
- {
- node = getAttributeNode(offset, node);
- }
- return node;
- }
-
- return null;
- }
-
- /**
- * Get the text region corresponding to an IDOMNode.
- *
- * @param node the node for which we want the text region. Must not be null.
- * @return an IRegion for the node, or null if the node is not recognized.
- */
- protected IRegion getHyperlinkRegion(IDOMNode node)
- {
- if (node == null)
- {
- return null;
- }
-
- IRegion hyperRegion = null;
- short nodeType = node.getNodeType();
-
- switch (nodeType)
- {
- case Node.ELEMENT_NODE :
- {
- hyperRegion = new Region(node.getStartOffset(), node.getEndOffset() - node.getStartOffset());
- }
- break;
- case Node.ATTRIBUTE_NODE :
- {
- IDOMAttr att = (IDOMAttr) node;
-
- int regOffset = att.getValueRegionStartOffset();
-
- // ISSUE: We are using a deprecated method here. Is there
- // a better way to get what we need?
-
- ITextRegion valueRegion = att.getValueRegion();
- if (valueRegion != null)
- {
- int regLength = valueRegion.getTextLength();
- String attValue = att.getValueRegionText();
-
- // Do not include quotes in attribute value region and only
- // underline the actual value, not the quotes.
-
- if (StringUtils.isQuoted(attValue))
- {
- regLength = regLength - 2;
- regOffset++;
- }
- hyperRegion = new Region(regOffset, regLength);
- }
- }
- break;
- default :
- // Do nothing.
- break;
- }
-
- return hyperRegion;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java
deleted file mode 100644
index a51c0fd84d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor;
-
-import org.eclipse.jface.viewers.ISelection;
-
-public interface ISelectionMapper
-{
- ISelection mapSelection(ISelection selectedObject);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java
deleted file mode 100644
index 41274520a4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.xsd.ui"; //$NON-NLS-1$
-
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- *
- * @param message
- * text to print
- * @param category
- * category of the message, to be compared with
- * /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- *
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java
deleted file mode 100644
index beb583485c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.editor;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML;
-
-
-/**
- * SourcePageActionContributor
- *
- * This class is for multi page editor's source page contributor.
- *
- *
- */
-public class SourcePageActionContributor extends ActionContributorXML {
-
- private IActionBars fBars;
-
- /**
- * This method calls:
- * <ul>
- * <li><code>contributeToMenu</code> with <code>bars</code>' menu manager</li>
- * <li><code>contributeToToolBar</code> with <code>bars</code>' tool bar
- * manager</li>
- * <li><code>contributeToStatusLine</code> with <code>bars</code>' status line
- * manager</li>
- * </ul>
- * The given action bars are also remembered and made accessible via
- * <code>getActionBars</code>.
- *
- * @param bars the action bars
- *
- */
- public void init(IActionBars bars) {
- fBars = bars;
- contributeToMenu(bars.getMenuManager());
- contributeToToolBar(bars.getToolBarManager());
- contributeToStatusLine(bars.getStatusLineManager());
- }
-
- /**
- * Returns this contributor's action bars.
- *
- * @return the action bars
- */
- public IActionBars getActionBars() {
- return fBars;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java
deleted file mode 100644
index 47649de226..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 20065 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-
-/**
- * Configuration for editing XSD content type
- */
-public class StructuredTextViewerConfigurationXSD extends StructuredTextViewerConfigurationXML {
- public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
- if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))
- return null;
-
- List allDetectors = new ArrayList(0);
- // add XSD Hyperlink detector
- allDetectors.add(new XSDHyperlinkDetector());
-
- IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
- for (int m = 0; m < superDetectors.length; m++) {
- IHyperlinkDetector detector = superDetectors[m];
- if (!allDetectors.contains(detector)) {
- allDetectors.add(detector);
- }
- }
- return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java
deleted file mode 100644
index 89e5800fdd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.wst.xsd.ui.internal.actions.IXSDToolbarAction;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory;
-
-public class XSDEditorConfiguration
-{
- public static final String XSDEDITORCONFIGURATIONEXTENSIONID = "org.eclipse.wst.xsd.ui.XSDEditorExtensionConfiguration"; //$NON-NLS-1$
- public static final String INTERNALEDITORCONFIGURATION_EXTENSIONID = "org.eclipse.wst.xsd.ui.internalEditorConfiguration"; //$NON-NLS-1$
- public static final String CLASSNAME = "class"; //$NON-NLS-1$
- public static final String ADAPTERFACTORY = "adapterFactory"; //$NON-NLS-1$
- public static final String TOOLBARACTION = "toolbarAction"; //$NON-NLS-1$
- public static final String FIGUREFACTORY = "figureFactory"; //$NON-NLS-1$
- public static final String EDITPARTFACTORY = "editPartFactory"; //$NON-NLS-1$
-
- List definedExtensionsList = null;
-
- public XSDEditorConfiguration()
- {
-
- }
-
- public XSDAdapterFactory getAdapterFactory()
- {
- if (definedExtensionsList == null)
- {
- readXSDConfigurationRegistry();
- }
- if (!definedExtensionsList.isEmpty())
- {
- return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getAdapterFactory();
- }
- return null;
- }
-
- public EditPartFactory getEditPartFactory()
- {
- if (definedExtensionsList == null)
- {
- readXSDConfigurationRegistry();
- }
- if (!definedExtensionsList.isEmpty())
- {
- return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getEditPartFactory();
- }
- return null;
- }
-
- public IExtendedFigureFactory getFigureFactory()
- {
- if (definedExtensionsList == null)
- {
- readXSDConfigurationRegistry();
- }
- if (!definedExtensionsList.isEmpty())
- {
- return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getFigureFactory();
- }
- return null;
- }
-
- public List getToolbarActions()
- {
- if (definedExtensionsList == null)
- {
- readXSDConfigurationRegistry();
- }
- if (!definedExtensionsList.isEmpty())
- {
- return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getActionList();
- }
- return Collections.EMPTY_LIST;
- }
-
- protected Object loadClass(IConfigurationElement element, String classString)
- {
- String pluginId = element.getDeclaringExtension().getContributor().getName();
-
- try
- {
- Class theClass = Platform.getBundle(pluginId).loadClass(classString);
- Object instance = theClass.newInstance();
-
- return instance;
- }
- catch (Exception e)
- {
-
- }
- return null;
- }
-
- public void readXSDConfigurationRegistry()
- {
- definedExtensionsList = new ArrayList();
- updateList(INTERNALEDITORCONFIGURATION_EXTENSIONID);
- updateList(XSDEDITORCONFIGURATIONEXTENSIONID);
- }
-
- private void updateList(String ID)
- {
- IConfigurationElement[] xsdEditorExtensionList = Platform.getExtensionRegistry().getConfigurationElementsFor(ID);
- boolean definedExtensionsExist = (xsdEditorExtensionList != null && xsdEditorExtensionList.length > 0);
-
- if (definedExtensionsExist)
- {
-
- for (int i = 0; i < xsdEditorExtensionList.length; i++)
- {
- XSDEditorExtensionProperties properties = new XSDEditorExtensionProperties();
- definedExtensionsList.add(properties);
-
- IConfigurationElement element = xsdEditorExtensionList[i];
- String adapterFactoryClass = element.getAttribute(ADAPTERFACTORY);
- if (adapterFactoryClass != null)
- {
- Object object = loadClass(element, adapterFactoryClass);
- XSDAdapterFactory adapterFactory = null;
- if (object instanceof XSDAdapterFactory)
- {
- adapterFactory = (XSDAdapterFactory) object;
- properties.setAdapterFactory(adapterFactory);
- }
- }
-
- String figureFactoryClass = element.getAttribute(FIGUREFACTORY);
- if (figureFactoryClass != null)
- {
- Object object = loadClass(element, figureFactoryClass);
- IExtendedFigureFactory figureFactory = null;
- if (object instanceof IExtendedFigureFactory)
- {
- figureFactory = (IExtendedFigureFactory) object;
- properties.setFigureFactoryList(figureFactory);
- }
- }
-
- IConfigurationElement[] toolbarActions = element.getChildren(TOOLBARACTION);
- List actionList = new ArrayList();
- if (toolbarActions != null)
- {
- for (int j = 0; j < toolbarActions.length; j++)
- {
- IConfigurationElement actionElement = toolbarActions[j];
- String actionClass = actionElement.getAttribute(CLASSNAME);
- IXSDToolbarAction action = null;
- if (actionClass != null)
- {
- Object object = loadClass(actionElement, actionClass);
- if (object instanceof IXSDToolbarAction)
- {
- action = (IXSDToolbarAction) object;
- actionList.add(action);
- }
- }
- }
- }
- properties.setActionList(actionList);
-
- String editPartFactoryClass = element.getAttribute(EDITPARTFACTORY);
- if (editPartFactoryClass != null)
- {
- Object object = loadClass(element, editPartFactoryClass);
- EditPartFactory editPartFactory = null;
- if (object instanceof EditPartFactory)
- {
- editPartFactory = (EditPartFactory) object;
- properties.setEditPartFactoryList(editPartFactory);
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java
deleted file mode 100644
index a88daff901..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java
+++ /dev/null
@@ -1,460 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.editor;
-
-/**
- * Context help id constants.
- */
-public interface XSDEditorContextIds
-{
- public static final String PLUGIN_NAME = "org.eclipse.wst.xsd.ui.internal";
-
- /* CONTEXT_IDs New XSD Wizard uses the WizardNewFileCreationPage from org.eclipse.ui.dialogs */
-
- /* CONTEXT_IDs for XSDEditor follow the xsdexxx context IDs */
-
- /* CONTEXT_ID xsde0010 for XSD Editor Design View */
- public static final String XSDE_SCHEMA_DESIGN_VIEW = PLUGIN_NAME + ".xsde0010";
- /* no CONTEXT_ID for File Name Text Edit (not editable) */
- /* CONTEXT_ID xsde0020 for Version Text Edit */
- public static final String XSDE_SCHEMA_VERSION = PLUGIN_NAME + ".xsde0020";
- /* CONTEXT_ID xsde0030 for Language Text Edit */
- public static final String XSDE_SCHEMA_LANGUAGE = PLUGIN_NAME + ".xsde0030";
- /* CONTEXT_ID xsde0040 for Namespace Group */
- public static final String XSDE_SCHEMA_NAMESPACE_GROUP = PLUGIN_NAME + ".xsde0040";
- /* CONTEXT_ID xsde0050 for Prefix Text Edit */
- public static final String XSDE_SCHEMA_PREFIX = PLUGIN_NAME + ".xsde0050";
- /* CONTEXT_ID xsde0060 for Target namespace Text Edit */
- public static final String XSDE_SCHEMA_TARGET_NAMESPACE = PLUGIN_NAME + ".xsde0060";
- /* CONTEXT_ID xsde0070 for Apply Push Button */
- public static final String XSDE_SCHEMA_APPLY = PLUGIN_NAME + ".xsde0070";
- /* CONTEXT_ID xsde0080 for Attribute form default Combo Box */
- public static final String XSDE_SCHEMA_ATTRIBUTE = PLUGIN_NAME + ".xsde0080";
- /* CONTEXT_ID xsde0090 for Element form default Combo Box */
- public static final String XSDE_SCHEMA_ELEMENT = PLUGIN_NAME + ".xsde0090";
- /* CONTEXT_ID xsde0100 for Block default Combo Box */
- public static final String XSDE_SCHEMA_BLOCK = PLUGIN_NAME + ".xsde0100";
- /* CONTEXT_ID xsde0110 for Final Default Combo Box */
- public static final String XSDE_SCHEMA_FINAL = PLUGIN_NAME + ".xsde0110";
-
-
- /* CONTEXT_ID xsde0200 for Annotations Comment Group - only used generically */
- /* CONTEXT_ID - used in Documentation Design View */
- /* CONTEXT_ID - used in App Info Design View */
- public static final String XSDE_ANNOTATION_COMMENT_GROUP = PLUGIN_NAME + ".xsde0200";
- /* CONTEXT_ID xsde0210 for Annotations Comment Group - only used generically */
- /* CONTEXT_ID - used in Documentation Design View */
- /* CONTEXT_ID - used in App Info Design View */
- public static final String XSDE_ANNOTATION_COMMENT = PLUGIN_NAME + ".xsde0210";
-
- /* CONTEXT_ID xsde0300 for Documentation Design View */
- public static final String XSDE_DOCUMENTATION_DESIGN_VIEW = PLUGIN_NAME + ".xsde0300";
- /* CONTEXT_ID xsde0310 for Source Text Edit */
- public static final String XSDE_DOCUMENTATION_SOURCE = PLUGIN_NAME + ".xsde0310";
- /* CONTEXT_ID xsde0320 for Language Text Edit */
- public static final String XSDE_DOCUMENTATION_LANGUAGE = PLUGIN_NAME + ".xsde0320";
- /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */
- /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */
-
- /* CONTEXT_ID xsde0400 for App Info Design View */
- public static final String XSDE_APP_INFO_DESIGN_VIEW = PLUGIN_NAME + ".xsde0400";
- /* CONTEXT_ID xsde0410 for App Info Source Text Edit */
- public static final String XSDE_APP_INFO_SOURCE = PLUGIN_NAME + ".xsde0410";
- /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */
- /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */
-
- /* CONTEXT_ID xsde0500 for Complex Type Design View */
- public static final String XSDE_COMPLEX_DESIGN_VIEW = PLUGIN_NAME + ".xsde0500";
- /* CONTEXT_ID xsde0510 for Name Text Edit */
- public static final String XSDE_COMPLEX_NAME = PLUGIN_NAME + ".xsde0510";
- /* CONTEXT_ID xsde0520 for Abstract Combo Box */
- public static final String XSDE_COMPLEX_ABSTRACT = PLUGIN_NAME + ".xsde0520";
- /* CONTEXT_ID xsde0530 for Mixed Combo Box */
- public static final String XSDE_COMPLEX_MIXED = PLUGIN_NAME + ".xsde0530";
- /* CONTEXT_ID xsde0540 for Block Combo Box */
- public static final String XSDE_COMPLEX_BLOCK = PLUGIN_NAME + ".xsde0540";
- /* CONTEXT_ID xsde0550 for Final Combo Box */
- public static final String XSDE_COMPLEX_FINAL = PLUGIN_NAME + ".xsde0550";
-
- /* CONTEXT_ID xsde0600 for Simple Type Design View */
- public static final String XSDE_SIMPLE_DESIGN_VIEW = PLUGIN_NAME + ".xsde0600";
- /* CONTEXT_ID xsde0610 for Name Text Edit */
- public static final String XSDE_SIMPLE_NAME = PLUGIN_NAME + ".xsde0610";
-
- /* CONTEXT_ID for Global Element and Element Design Views are the same */
- /* CONTEXT_ID xsde0700 for Element Design View */
- public static final String XSDE_ELEMENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde0700";
- /* CONTEXT_ID xsde0710 for Element Name Text Edit */
- public static final String XSDE_ELEMENT_NAME = PLUGIN_NAME + ".xsde0710";
- /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID User-defined complex type Radio Button is from Type Helper xsde0940 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
- /* CONTEXT_ID xsde0720 for Abstract Check Box */
- public static final String XSDE_ELEMENT_ABSTRACT = PLUGIN_NAME + ".xsde0720";
- /* CONTEXT_ID xsde0730 for Nillable Check Box */
- public static final String XSDE_ELEMENT_NILLABLE = PLUGIN_NAME + ".xsde0730";
- /* CONTEXT_ID xsde0740 for Value Group */
- public static final String XSDE_ELEMENT_VALUE = PLUGIN_NAME + ".xsde0740";
- /* CONTEXT_ID xsde0750 for Fixed Radio Button */
- public static final String XSDE_ELEMENT_FIXED = PLUGIN_NAME + ".xsde0750";
- /* CONTEXT_ID xsde0760 for Default Radio Button */
- public static final String XSDE_ELEMENT_DEFAULT = PLUGIN_NAME + ".xsde0760";
- /* CONTEXT_ID xsde0770 for Value Group */
- public static final String XSDE_ELEMENT_VALUE_GROUP = PLUGIN_NAME + ".xsde0770";
- /* CONTEXT_ID xsde0780 for Minimum Text Edit */
- public static final String XSDE_ELEMENT_MINIMUM = PLUGIN_NAME + ".xsde0780";
- /* CONTEXT_ID xsde0790 for Maximum Text Edit */
- public static final String XSDE_ELEMENT_MAXIMUM = PLUGIN_NAME + ".xsde0790";
- /* CONTEXT_ID xsde0800 for Block Combo Box */
- public static final String XSDE_ELEMENT_BLOCK = PLUGIN_NAME + ".xsde0800";
- /* CONTEXT_ID xsde0810 for Final Combo Box */
- public static final String XSDE_ELEMENT_FINAL = PLUGIN_NAME + ".xsde0810";
- /* CONTEXT_ID xsde0820 for Substitution Group Combo Box */
- public static final String XSDE_ELEMENT_SUBSTITUTION = PLUGIN_NAME + ".xsde0820";
- /* CONTEXT_ID xsde0830 for Form Qualification Combo Box */
- public static final String XSDE_ELEMENT_FORM = PLUGIN_NAME + ".xsde0830";
-
- /* CONTEXT_ID xsde0900 for Type Helper Group - only used generically */
- /* CONTEXT_ID - used in Global Element Design View */
- /* CONTEXT_ID - used in Global Attribute Design View */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Restriction Design View */
- /* CONTEXT_ID - used in List Design View */
- /* CONTEXT_ID - used in Union Design View */
- public static final String XSDE_TYPE_HELPER_GROUP = PLUGIN_NAME + ".xsde0900";
- /* CONTEXT_ID xsde0910 for None Radio Button - only used generically */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Restriction Design View */
- /* CONTEXT_ID - used in List Design View */
- /* CONTEXT_ID - used in Union Design View */
- public static final String XSDE_TYPE_HELPER_NONE = PLUGIN_NAME + ".xsde0910";
- /* CONTEXT_ID xsde0920 for Built-in simple type Radio Button - only used generically */
- /* CONTEXT_ID - used in Global Element Design View */
- /* CONTEXT_ID - used in Global Attribute Design View */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Restriction Design View */
- /* CONTEXT_ID - used in List Design View */
- /* CONTEXT_ID - used in Union Design View */
- public static final String XSDE_TYPE_HELPER_BUILT_IN = PLUGIN_NAME + ".xsde0920";
- /* CONTEXT_ID xsde0930 for User-defined simple type Radio Button - only used generically */
- /* CONTEXT_ID - used in Global Element Design View */
- /* CONTEXT_ID - used in Global Attribute Design View */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Restriction Design View */
- /* CONTEXT_ID - used in List Design View */
- /* CONTEXT_ID - used in Union Design View */
- public static final String XSDE_TYPE_HELPER_USER_DEFINED_SIMPLE = PLUGIN_NAME + ".xsde0930";
- /* CONTEXT_ID xsde0940 for User-defined complex type Radio Button - only used generically */
- /* CONTEXT_ID - used in Global Element Design View */
- public static final String XSDE_TYPE_HELPER_USER_DEFINED_COMPLEX = PLUGIN_NAME + ".xsde0940";
- /* CONTEXT_ID xsde0950 for Type information Combo Box - only used generically */
- /* CONTEXT_ID - used in Global Element Design View */
- /* CONTEXT_ID - used in Global Attribute Design View */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Restriction Design View */
- /* CONTEXT_ID - used in List Design View */
- public static final String XSDE_TYPE_HELPER_TYPE = PLUGIN_NAME + ".xsde0950";
-
- /* CONTEXT_ID xsde1000 for Attribute Design View */
- public static final String XSDE_ATTRIBUTE_DESIGN_VIEW = PLUGIN_NAME + ".xsde1000";
- /* CONTEXT_ID xsde1010 for Attribute Name Text Edit */
- public static final String XSDE_ATTRIBUTE_NAME = PLUGIN_NAME + ".xsde1010";
- /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
- /* CONTEXT_ID xsde1020 for Value Group */
- public static final String XSDE_ATTRIBUTE_VALUE_GROUP = PLUGIN_NAME + ".xsde1020";
- /* CONTEXT_ID xsde1030 for Fixed Radio Button */
- public static final String XSDE_ATTRIBUTE_FIXED = PLUGIN_NAME + ".xsde1030";
- /* CONTEXT_ID xsde1040 for Default Radio Button */
- public static final String XSDE_ATTRIBUTE_DEFAULT = PLUGIN_NAME + ".xsde1040";
- /* CONTEXT_ID xsde1050 for Value Text Edit */
- public static final String XSDE_ATTRIBUTE_VALUE = PLUGIN_NAME + ".xsde1050";
- /* CONTEXT_ID xsde1060 for Usage Combo Box */
- public static final String XSDE_ATTRIBUTE_USAGE = PLUGIN_NAME + ".xsde1060";
- /* CONTEXT_ID xsde1070 for Form qualificaiton Combo Box */
- public static final String XSDE_ATTRIBUTE_FORM = PLUGIN_NAME + ".xsde1070";
-
- /* CONTEXT_ID xsde1100 for Element Ref Window Design View */
- public static final String XSDE_ELEMENT_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1100";
- /* CONTEXT_ID xsde1110 for Reference Name Combo Box */
- public static final String XSDE_ELEMENT_REF_REFERENCE = PLUGIN_NAME + ".xsde1110";
- /* CONTEXT_ID xsde1120 for Minimum Text Edit */
- public static final String XSDE_ELEMENT_REF_MINIMUM = PLUGIN_NAME + ".xsde1120";
- /* CONTEXT_ID xsde1130 for Maximum Text Edit */
- public static final String XSDE_ELEMENT_REF_MAXIMUM = PLUGIN_NAME + ".xsde1130";
-
- /* CONTEXT_ID xsde1200 for Simple Content Design View - used generically */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Complex Content Design View */
- public static final String XSDE_SIMPLE_CONTENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde1200";
- /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
- /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
- /* CONTEXT_ID xsde1210 for Derived by Combo Box - used generically */
- /* CONTEXT_ID - used in Simple Content Design View */
- /* CONTEXT_ID - used in Complex Content Design View */
- public static final String XSDE_SIMPLE_CONTENT_DERIVED = PLUGIN_NAME + ".xsde1210";
-
- /* CONTEXT_ID xsde1300 for Restriction Design View */
- public static final String XSDE_RESTRICTION_DESIGN_VIEW = PLUGIN_NAME + ".xsde1300";
- /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
- /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
- /* CONTEXT_ID xsde1310 for Facets Group */
- public static final String XSDE_RESTRICTION_FACETS_GROUP = PLUGIN_NAME + ".xsde1310";
- /* CONTEXT_ID xsde1320 for Facets Table */
- public static final String XSDE_RESTRICTION_FACETS = PLUGIN_NAME + ".xsde1320";
-
- /* CONTEXT_ID xsde1400 for List Design View */
- public static final String XSDE_LIST_DESIGN_VIEW = PLUGIN_NAME + ".xsde1400";
- /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */
- /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-
- /* CONTEXT_ID xsde1500 for Attribute Group Design View */
- public static final String XSDE_ATTRIBUTE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde1500";
- /* CONTEXT_ID xsde1510 for Name Text Edit */
- public static final String XSDE_ATTRIBUTE_GROUP_NAME = PLUGIN_NAME + ".xsde1510";
-
- /* CONTEXT_ID for Global Attribute and Attribute Design Views are the same */
- /* CONTEXT_ID xsde1600 for Attribute Group Reference Design View */
- public static final String XSDE_ATTRIBUTE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1600";
- /* CONTEXT_ID xsde1610 for Reference Name Combo Box */
- public static final String XSDE_ATTRIBUTE_GROUP_REF_NAME = PLUGIN_NAME + ".xsde1610";
-
- /* CONTEXT_ID xsde1700 for Attribute Reference Design View */
- public static final String XSDE_ATTRIBUTE_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1700";
- /* CONTEXT_ID xsde1710 for Reference Name Combo Box */
- public static final String XSDE_ATTRIBUTE_REF_NAME = PLUGIN_NAME + ".xsde1710";
-
- /* CONTEXT_ID xsde1800 for Pattern Design View */
- public static final String XSDE_PATTERN_DESIGN_VIEW = PLUGIN_NAME + ".xsde1800";
- /* CONTEXT_ID xsde1810 for Value Text Edit */
- public static final String XSDE_PATTERN_VALUE = PLUGIN_NAME + ".xsde1810";
- /* CONTEXT_ID xsde1820 for Create Regular Expression Push Button */
- public static final String XSDE_PATTERN_REGULAR = PLUGIN_NAME + ".xsde1820";
-
- /* CONTEXT_ID xsde1900 for Enum Design View */
- public static final String XSDE_ENUM_DESIGN_VIEW = PLUGIN_NAME + ".xsde1900";
- /* CONTEXT_ID xsde1910 for Value Text Edit */
- public static final String XSDE_ENUM_VALUE = PLUGIN_NAME + ".xsde1910";
-
- /* CONTEXT_ID xsde2000 for Include Design Page */
- public static final String XSDE_INCLUDE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2000";
- /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
- /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
-
- /* CONTEXT_ID xsde2100 for Include Helper Select Push Button - used generically */
- /* CONTEXT_ID - used in Include Design View */
- /* CONTEXT_ID - used in Import Design View */
- public static final String XSDE_INCLUDE_HELPER_SELECT = PLUGIN_NAME + ".xsde2100";
-
- /* CONTEXT_ID xsde2200 for Import Design Page */
- public static final String XSDE_IMPORT_DESIGN_VIEW = PLUGIN_NAME + ".xsde2200";
- /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
- /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
- /* CONTEXT_ID xsde2210 for Prefix Text Edit */
- public static final String XSDE_IMPORT_PREFIX = PLUGIN_NAME + ".xsde2210";
- /* no CONTEXT_ID for Namespace Text Edit (not editable) */
-
- /* CONTEXT_ID xsde2300 for Redefine Design View */
- public static final String XSDE_REDEFINE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2300";
- /* no CONTEXT_ID for Schema Location Text Edit (not editable) */
- /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */
-
- /* CONTEXT_ID xsde2400 for Group Design View */
- public static final String XSDE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde2400";
- /* CONTEXT_ID xsde2410 for Name Text Edit */
- public static final String XSDE_GROUP_NAME = PLUGIN_NAME + ".xsde2410";
-
- /* CONTEXT_ID xsde2500 for Group Scope Design View */
- public static final String XSDE_GROUP_SCOPE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2500";
- /* CONTEXT_ID xsde2510 for Content model Group */
- public static final String XSDE_GROUP_SCOPE_CONTENT_GROUP = PLUGIN_NAME + ".xsde2510";
- /* CONTEXT_ID xsde2520 for Sequence Radio Button */
- public static final String XSDE_GROUP_SCOPE_SEQUENCE = PLUGIN_NAME + ".xsde2520";
- /* CONTEXT_ID xsde2530 for Choice Radio Button */
- public static final String XSDE_GROUP_SCOPE_CHOICE = PLUGIN_NAME + ".xsde2530";
- /* CONTEXT_ID xsde2540 for All Radio Button */
- public static final String XSDE_GROUP_SCOPE_ALL = PLUGIN_NAME + ".xsde2540";
- /* CONTEXT_ID xsde2550 for Minimum Text Edit */
- public static final String XSDE_GROUP_SCOPE_MINIMUM = PLUGIN_NAME + ".xsde2550";
- /* CONTEXT_ID xsde2560 for Maximum Text Edit*/
- public static final String XSDE_GROUP_SCOPE_MAXIMUM = PLUGIN_NAME + ".xsde2560";
-
- /* CONTEXT_ID xsde2600 for Group Ref Design View */
- public static final String XSDE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2600";
- /* CONTEXT_ID xsde2610 for Reference name Combo Box */
- public static final String XSDE_GROUP_REF_REFERENCE = PLUGIN_NAME + ".xsde2610";
- /* CONTEXT_ID xsde2620 for Minimum Text Edit */
- public static final String XSDE_GROUP_REF_MINIMUM = PLUGIN_NAME + ".xsde2620";
- /* CONTEXT_ID xsde2630 for Maximum Text Edit */
- public static final String XSDE_GROUP_REF_MAXIMUM = PLUGIN_NAME + ".xsde2630";
-
- /* CONTEXT_ID xsde2700 for Unique Design View */
- public static final String XSDE_UNIQUE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2700";
- /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
- /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
- /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
- /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
- /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
- /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
- /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
- /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
-
- /* CONTEXT_ID xsde2800 for Unique Base Name Text Edit - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_NAME = PLUGIN_NAME + ".xsde2800";
- /* CONTEXT_ID xsde2810 for Selector Group - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_SELECTOR_GROUP = PLUGIN_NAME + ".xsde2810";
- /* CONTEXT_ID xsde2820 for Selector Multi-line Edit - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_SELECTOR = PLUGIN_NAME + ".xsde2820";
- /* CONTEXT_ID xsde2830 for Fields Group - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_FIELDS_GROUP = PLUGIN_NAME + ".xsde2830";
- /* CONTEXT_ID xsde2840 for Source Text Edit - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_SOURCE = PLUGIN_NAME + ".xsde2840";
- /* CONTEXT_ID xsde2850 for Add Push Button - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_ADD = PLUGIN_NAME + ".xsde2850";
- /* CONTEXT_ID xsde2860 for Remove Push Button - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_REMOVE = PLUGIN_NAME + ".xsde2860";
- /* CONTEXT_ID xsde2870 for Target List Box - used generically */
- /* CONTEXT_ID - used in Unique Design View */
- /* CONTEXT_ID - used in Key Design View */
- /* CONTEXT_ID - used in Key Ref Design View */
- public static final String XSDE_UNIQUE_BASE_TARGET = PLUGIN_NAME + ".xsde2870";
-
- /* CONTEXT_ID xsde2900 for Key Design View */
- public static final String XSDE_KEY_DESIGN_VIEW = PLUGIN_NAME + ".xsde2900";
- /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
- /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
- /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
- /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
- /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
- /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
- /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
- /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
- /* CONTEXT_ID xsde2900 for Key Design View */
-
- /* CONTEXT_ID xsde2950 for Key Ref Design View */
- public static final String XSDE_KEY_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2950";
- /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */
- /* CONTEXT_ID xsde2960 for Reference Key Combo Box */
- public static final String XSDE_KEY_REF_REFERENCE = PLUGIN_NAME + ".xsde2960";
- /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */
- /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */
- /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */
- /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */
- /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */
- /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */
- /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */
-
- /* CONTEXT_ID xsde3000 for Any Element Design View */
- public static final String XSDE_ANY_ELEMENT_VIEW = PLUGIN_NAME + ".xsde3000";
- /* CONTEXT_ID xsde3010 for Namespace Text Edit */
- public static final String XSDE_ANY_ELEMENT_NAMESPACE = PLUGIN_NAME + ".xsde3010";
- /* CONTEXT_ID xsde3020 for Process Contents Combo Box */
- public static final String XSDE_ANY_ELEMENT_PROCESS = PLUGIN_NAME + ".xsde3020";
- /* CONTEXT_ID xsde3030 for Minimum Text Edit */
- public static final String XSDE_ANY_ELEMENT_MINIMUM = PLUGIN_NAME + ".xsde3030";
- /* CONTEXT_ID xsde3040 for Maximum Text Edit */
- public static final String XSDE_ANY_ELEMENT_MAXIMUM = PLUGIN_NAME + ".xsde3040";
-
- /* CONTEXT_ID xsde3100 for Any Attribute Design View */
- public static final String XSDE_ANY_ATTRIBUTE_VIEW = PLUGIN_NAME + ".xsde3100";
- /* CONTEXT_ID xsde3110 for Namespace Text Edit */
- public static final String XSDE_ANY_ATTRIBUTE_NAMESPACE = PLUGIN_NAME + ".xsde3110";
- /* CONTEXT_ID xsde3120 for Process Contents Combo Box */
- public static final String XSDE_ANY_ATTRIBUTE_PROCESS = PLUGIN_NAME + ".xsde3120";
-
- /* no CONTEXT_ID for Union Design View - uses a generic interface */
- /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */
- /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */
- /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */
- /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */
-
- /* CONTEXT_ID xsde3200 for Notation Design View */
- public static final String XSDE_NOTATION_VIEW = PLUGIN_NAME + ".xsde3200";
-
- /* CONTEXT_ID xsde4000 for Source View */
- public static final String XSDE_SOURCE_VIEW = PLUGIN_NAME + ".xsde4000";
-
- /* CONTEXT_IDs for Regular Expression Wizard follow the xsdrxxx context IDs */
-
- /* CONTEXT_ID xsdr0010 for Compose Regular Expression Page */
- public static final String XSDR_COMPOSITION_PAGE = PLUGIN_NAME + ".xsdr0010";
- /* CONTEXT_ID xsdr0015 for Token Contents Combo Box */
- public static final String XSDR_COMPOSITION_TOKEN = PLUGIN_NAME + ".xsdr0015";
- /* CONTEXT_ID xsdr0020 for Occurrece Group */
- public static final String XSDR_COMPOSITION_OCCURRENCE_GROUP = PLUGIN_NAME + ".xsdr0020";
- /* CONTEXT_ID xsdr0030 for Just once Radio Button */
- public static final String XSDR_COMPOSITION_JUST_ONCE = PLUGIN_NAME + ".xsdr0030";
- /* CONTEXT_ID xsdr0040 for Zero or more Radio Button */
- public static final String XSDR_COMPOSITION_ZERO_OR_MORE = PLUGIN_NAME + ".xsdr0040";
- /* CONTEXT_ID xsdr0050 for One or more Radio Button */
- public static final String XSDR_COMPOSITION_ONE_OR_MORE = PLUGIN_NAME + ".xsdr0050";
- /* CONTEXT_ID xsdr0060 for Optional Radio Button */
- public static final String XSDR_COMPOSITION_OPTIONAL = PLUGIN_NAME + ".xsdr0060";
- /* CONTEXT_ID xsdr0070 for Repeat Radio Button */
- public static final String XSDR_COMPOSITION_REPEAT = PLUGIN_NAME + ".xsdr0070";
- /* CONTEXT_ID xsdr0080 for Range Radio Button */
- public static final String XSDR_COMPOSITION_RANGE = PLUGIN_NAME + ".xsdr0080";
- /* CONTEXT_ID xsdr0090 for Repeat Text Edit */
- public static final String XSDR_COMPOSITION_REPEAT_TEXT = PLUGIN_NAME + ".xsdr0090";
- /* CONTEXT_ID xsdr0100 for Range Minimum Text Edit */
- public static final String XSDR_COMPOSITION_RANGE_MIN = PLUGIN_NAME + ".xsdr0100";
- /* CONTEXT_ID xsdr0110 for Range Maximum Text Edit */
- public static final String XSDR_COMPOSITION_RANGE_MAX = PLUGIN_NAME + ".xsdr0110";
- /* CONTEXT_ID xsdr0120 for Add Push Button */
- public static final String XSDR_COMPOSITION_ADD = PLUGIN_NAME + ".xsdr0120";
- /* CONTEXT_ID xsdr0130 for Current Regular Expression Text Edit */
- public static final String XSDR_COMPOSITION_CURRENT = PLUGIN_NAME + ".xsdr0130";
-
- /* CONTEXT_ID xsdr0200 for Test Regular Expression Page */
- public static final String XSDR_TEST_PAGE = PLUGIN_NAME + ".xsdr0200";
- /* no CONTEXT_ID for Regular Expression Text Edit (not editable) */
- /* CONTEXT_ID xsdr0210 for Sample Text Text Edit */
- public static final String XSDR_TEST_SAMPLE = PLUGIN_NAME + ".xsdr0210";
-
- /* CONTEXT_IDs for Preferences Page follows the xsdpxxx context IDs */
-
- /* CONTEXT_ID xsdp0010 for XML Schema Preferences Page */
- public static final String XSDP_PREFERENCE_PAGE = PLUGIN_NAME + ".xsdp0010";
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java
deleted file mode 100644
index f87139aeaf..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory;
-
-public class XSDEditorExtensionProperties
-{
- XSDAdapterFactory adapterFactory;
- IExtendedFigureFactory figureFactory;
- EditPartFactory editPartFactory;
- List actionList;
-
- public XSDEditorExtensionProperties()
- {
-
- }
-
- public void setActionList(List actionList)
- {
- this.actionList = actionList;
- }
-
- public void setAdapterFactory(XSDAdapterFactory adapterFactory)
- {
- this.adapterFactory = adapterFactory;
- }
-
- public void setEditPartFactoryList(EditPartFactory editPartFactory)
- {
- this.editPartFactory = editPartFactory;
- }
-
- public void setFigureFactoryList(IExtendedFigureFactory figureFactory)
- {
- this.figureFactory = figureFactory;
- }
-
- public List getActionList()
- {
- return actionList;
- }
-
- public XSDAdapterFactory getAdapterFactory()
- {
- return adapterFactory;
- }
-
- public EditPartFactory getEditPartFactory()
- {
- return editPartFactory;
- }
-
- public IExtendedFigureFactory getFigureFactory()
- {
- return figureFactory;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java
deleted file mode 100644
index 78f1d8930b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDFileEditorInput extends FileEditorInput
-{
- private IFile file;
- private XSDSchema schema;
- private String editorName;
-
- public XSDFileEditorInput(IFile file, XSDSchema schema) {
- super(file);
- if (file == null) {
- throw new IllegalArgumentException();
- }
- this.file = file;
- this.schema = schema;
- editorName = file.getName();
- }
-
- public IFile getFile()
- {
- return file;
- }
-
- public XSDSchema getSchema()
- {
- return schema;
- }
-
- public void setEditorName(String name)
- {
- editorName = name;
- }
-
- public String getName()
- {
- if (editorName != null)
- {
- return editorName;
- }
- return super.getName();
- }
-
- public String getToolTipText()
- {
- if (schema != null)
- {
- String ns = schema.getTargetNamespace();
- if (ns != null && ns.length() > 0)
- return Messages._UI_LABEL_TARGET_NAMESPACE + ns;
- else
- return Messages._UI_LABEL_NO_NAMESPACE;
- }
- return super.getToolTipText();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java
deleted file mode 100644
index db9b913085..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-
-package org.eclipse.wst.xsd.ui.internal.editor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * XSDHyperlink knows how to open links from XSD files.
- *
- * @see XSDHyperlinkDetector
- */
-public class XSDHyperlink implements IHyperlink
-{
- private IRegion fRegion;
- private XSDConcreteComponent fComponent;
-
- public XSDHyperlink(IRegion region, XSDConcreteComponent component)
- {
- fRegion = region;
- fComponent = component;
- }
-
- public IRegion getHyperlinkRegion()
- {
- return fRegion;
- }
-
- public String getTypeLabel()
- {
- return null;
- }
-
- public String getHyperlinkText()
- {
- return null;
- }
-
- public void open()
- {
- XSDSchema schema = fComponent.getSchema();
-
- if (schema == null)
- {
- return;
- }
-
- String schemaLocation = schema.getSchemaLocation();
- schemaLocation = URIHelper.removePlatformResourceProtocol(schemaLocation);
- IPath schemaPath = new Path(schemaLocation);
- IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
-
- boolean fileExists = schemaFile != null && schemaFile.exists();
-
- if (!fileExists)
- {
- return;
- }
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
- IEditorPart editorPart = workbenchPage.getActiveEditor();
-
- workbenchPage.getNavigationHistory().markLocation(editorPart);
-
- try
- {
- editorPart = IDE.openEditor(workbenchPage, schemaFile, true);
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- ((InternalXSDMultiPageEditor) editorPart).openOnGlobalReference(fComponent);
- }
- }
- catch (PartInitException pie)
- {
- Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java
deleted file mode 100644
index a2a8562d63..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.GEFActionConstants;
-import org.eclipse.gef.ui.actions.ZoomComboContributionItem;
-import org.eclipse.gef.ui.actions.ZoomInRetargetAction;
-import org.eclipse.gef.ui.actions.ZoomOutRetargetAction;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.RetargetAction;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor;
-import org.eclipse.wst.xsd.ui.internal.actions.IXSDToolbarAction;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction;
-
-/**
- * Manages the installation/deinstallation of global actions for multi-page
- * editors. Responsible for the redirection of global actions to the active
- * editor. Multi-page contributor replaces the contributors for the individual
- * editors in the multi-page editor.
- */
-public class XSDMultiPageEditorContributor extends MultiPageEditorActionBarContributor
-{
- private IEditorPart activeEditorPart;
- private InternalXSDMultiPageEditor xsdEditor;
- protected ITextEditor textEditor;
- protected IEditorActionBarContributor sourceViewerActionContributor = null;
- protected List fPartListeners= new ArrayList();
- ZoomInRetargetAction zoomInRetargetAction;
- ZoomOutRetargetAction zoomOutRetargetAction;
- ZoomComboContributionItem zoomComboContributionItem;
- /**
- * Creates a multi-page contributor.
- */
- public XSDMultiPageEditorContributor()
- {
- super();
- sourceViewerActionContributor = new SourcePageActionContributor();
- zoomInRetargetAction = new ZoomInRetargetAction();
- zoomOutRetargetAction = new ZoomOutRetargetAction();
- fPartListeners.add(zoomInRetargetAction);
- fPartListeners.add(zoomOutRetargetAction);
- }
-
- /**
- * Returns the action registed with the given text editor.
- *
- * @return IAction or null if editor is null.
- */
- protected IAction getAction(ITextEditor editor, String actionID)
- {
- return (editor == null ? null : editor.getAction(actionID));
- }
-
- /*
- * (non-JavaDoc) Method declared in
- * AbstractMultiPageEditorActionBarContributor.
- */
-
- public void setActivePage(IEditorPart part)
- {
- if (activeEditorPart == part)
- return;
-
- activeEditorPart = part;
-
- IActionBars actionBars = getActionBars();
- boolean isSource = false;
-
- if (activeEditorPart != null && activeEditorPart instanceof ITextEditor)
- {
- isSource = true;
- zoomInRetargetAction.setEnabled(false);
- zoomOutRetargetAction.setEnabled(false);
- activateSourcePage(activeEditorPart, true);
- }
- else
- {
- activateSourcePage(xsdEditor, false);
- if (part instanceof InternalXSDMultiPageEditor)
- {
- xsdEditor = (InternalXSDMultiPageEditor) part;
- }
- if (xsdEditor != null)
- {
- // cs: here's we ensure the UNDO and REDO actions are available when
- // the design view is active
- IWorkbenchPartSite site = xsdEditor.getSite();
- if (site instanceof IEditorSite)
- {
- ITextEditor textEditor = xsdEditor.getTextEditor();
- IActionBars siteActionBars = ((IEditorSite) site).getActionBars();
- siteActionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, getAction(textEditor, ITextEditorActionConstants.UNDO));
- siteActionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, getAction(textEditor, ITextEditorActionConstants.REDO));
- siteActionBars.updateActionBars();
- }
-
- Object adapter = xsdEditor.getAdapter(ActionRegistry.class);
- if (adapter instanceof ActionRegistry)
- {
- ActionRegistry registry = (ActionRegistry) adapter;
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), registry.getAction(DeleteAction.ID));
- actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_IN, registry.getAction(GEFActionConstants.ZOOM_IN));
- actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_OUT, registry.getAction(GEFActionConstants.ZOOM_OUT));
- actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(), registry.getAction(ActionFactory.PRINT.getId()));
- zoomInRetargetAction.setEnabled(true);
- zoomOutRetargetAction.setEnabled(true);
- }
- }
- }
-
- if (actionBars != null) {
- // update menu bar and tool bar
- actionBars.updateActionBars();
- }
-
- if (zoomComboContributionItem != null)
- {
- zoomComboContributionItem.setVisible(!isSource);
- zoomComboContributionItem.update();
- }
- }
-
- protected void activateSourcePage(IEditorPart activeEditor, boolean state)
- {
- if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor)
- {
- sourceViewerActionContributor.setActiveEditor(activeEditor);
- ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(state);
- }
- }
-
- public void setActiveEditor(IEditorPart part)
- {
- IEditorPart activeNestedEditor = null;
- if (part instanceof MultiPageEditorPart)
- {
- activeNestedEditor = part;
- }
- setActivePage(activeNestedEditor);
-
- if (part instanceof InternalXSDMultiPageEditor)
- {
- xsdEditor = (InternalXSDMultiPageEditor) part;
-
- textEditor = xsdEditor.getTextEditor();
- if (textEditor != null)
- {
-// updateActions();
- getActionBars().updateActionBars();
- }
- }
-
- List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- ((IXSDToolbarAction)i.next()).setEditorPart(activeNestedEditor);
- }
-
- super.setActiveEditor(part);
- }
-
- public void contributeToMenu(IMenuManager manager)
- {
- IMenuManager menu = new MenuManager(Messages._UI_MENU_XSD_EDITOR);
- manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu);
-
- // Add extension menu actions
- List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- menu.add((IXSDToolbarAction)i.next());
- }
-
- menu.add(zoomInRetargetAction);
- menu.add(zoomOutRetargetAction);
-
- menu.updateAll(true);
- }
-
- public void contributeToToolBar(IToolBarManager manager)
- {
- manager.add(new Separator());
- // Add extension toolbar actions
- List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions();
- for (Iterator i = list.iterator(); i.hasNext(); )
- {
- manager.add((IXSDToolbarAction)i.next());
- }
-
- manager.add(new Separator());
- String[] zoomStrings = new String[] { ZoomManager.FIT_ALL, ZoomManager.FIT_HEIGHT, ZoomManager.FIT_WIDTH };
- zoomComboContributionItem = new ZoomComboContributionItem(getPage(), zoomStrings);
- manager.add(zoomComboContributionItem);
- }
-
-
- public void init(IActionBars bars, IWorkbenchPage page)
- {
- Iterator e = fPartListeners.iterator();
- while (e.hasNext())
- {
- page.addPartListener((RetargetAction) e.next());
- }
-
- initSourceViewerActionContributor(bars);
-
- super.init(bars, page);
- }
-
-
- protected void initSourceViewerActionContributor(IActionBars actionBars) {
- if (sourceViewerActionContributor != null)
- sourceViewerActionContributor.init(actionBars, getPage());
- }
-
- public void dispose()
- {
- fPartListeners = null;
- if (sourceViewerActionContributor != null)
- sourceViewerActionContributor.dispose();
- super.dispose();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gif
deleted file mode 100644
index 210bb24ce0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gif
deleted file mode 100644
index ac58c1e8ab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gif
deleted file mode 100644
index 2375c655d8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gif
deleted file mode 100644
index d535dac36d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.gif
deleted file mode 100644
index 47f6730398..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gif
deleted file mode 100644
index 3d550a30e8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gif
deleted file mode 100644
index bd37eb50b5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gif
deleted file mode 100644
index 2b347ac458..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gif
deleted file mode 100644
index 6d74e802b5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gif
deleted file mode 100644
index d2108c0368..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gif
deleted file mode 100644
index a39f93cdce..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gif
deleted file mode 100644
index 5280cc2904..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gif
deleted file mode 100644
index 2da001e3e9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gif
deleted file mode 100644
index 79d49d037b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gif
deleted file mode 100644
index 648462ff67..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gif
deleted file mode 100644
index a89fa8f187..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gif
deleted file mode 100644
index 8365af2f3c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gif
deleted file mode 100644
index 89ba825253..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gif
deleted file mode 100644
index 41c68dda8c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gif
deleted file mode 100644
index 007f8522af..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gif
deleted file mode 100644
index 4fc84e4c3a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gif
deleted file mode 100644
index d349a05f2b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gif
deleted file mode 100644
index dd45f08fb1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gif
deleted file mode 100644
index 749acfc9c9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gif
deleted file mode 100644
index 0cfb8076dd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gif
deleted file mode 100644
index 378e43e14d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gif
deleted file mode 100644
index 3900f1b55d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gif
deleted file mode 100644
index 79d49d037b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gif
deleted file mode 100644
index dd45f08fb1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gif
deleted file mode 100644
index 555ef53306..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gif
deleted file mode 100644
index 34a7fb3f23..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gif
deleted file mode 100644
index 9e44ce52a9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gif
deleted file mode 100644
index b26c527f5e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gif
deleted file mode 100644
index 04032a915a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gif
deleted file mode 100644
index ee5829d693..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gif
deleted file mode 100644
index ce9df985b8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gif
deleted file mode 100644
index 7134210d0a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gif
deleted file mode 100644
index 56964c13a5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gif
deleted file mode 100644
index 2399a58204..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gif
deleted file mode 100644
index 8bf3f972d2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gif
deleted file mode 100644
index 7ef38df720..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gif
deleted file mode 100644
index 11d7958525..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gif
deleted file mode 100644
index d08e78f891..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gif
deleted file mode 100644
index a113cf45a0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gif
deleted file mode 100644
index 38bc12e32f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gif
deleted file mode 100644
index 75f33c24fa..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gif
deleted file mode 100644
index 9aefeb27b6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gif
deleted file mode 100644
index 292adafc8e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gif
deleted file mode 100644
index 5a8a650f3d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gif
deleted file mode 100644
index 85f9baaf44..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gif
deleted file mode 100644
index 9e665d5c78..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gif
deleted file mode 100644
index 24d1a279e5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gif
deleted file mode 100644
index 13dae59bea..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gif
deleted file mode 100644
index 0bc60689c6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gif
deleted file mode 100644
index eab699e385..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gif
deleted file mode 100644
index f2e363564f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gif
deleted file mode 100644
index 94ae2a0ee2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.gif
deleted file mode 100644
index 789d137394..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gif
deleted file mode 100644
index c705db0c1e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gif
deleted file mode 100644
index 3c65dc4ba1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gif
deleted file mode 100644
index a61441f2a8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java
deleted file mode 100644
index 4e3c62acfb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor.search;
-
-public interface IXSDTypesFilter {
- /**
- * Give me an Object o, if I know it and it should be filtered out, I will
- * return true. Otherwise I'll return false, even if I don't know the object
- * @param o
- * @return
- */
- public boolean shouldFilterOut(Object o);
-
- public void turnOn();
- public void turnOff();
- public boolean isOn();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java
deleted file mode 100644
index aa9a0342c8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-
-public class XSDComponentDescriptionProvider extends LabelProvider implements IComponentDescriptionProvider
-{
- public boolean isApplicable(Object component)
- {
- // TODO (cs) if this provider is used in a multi language context
- // we'll need to provide some logic here
- return true;
- }
-
- private static final Image SIMPLE_TYPE_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif");
- private static final Image COMPLEX_TYPE_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif");
- private static final Image ELEMENT_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDElement.gif");
- //private final static Image BUILT_IN_TYPE)IMAGE =
-
- public String getQualifier(Object component)
- {
- String result = null;
- if (component instanceof ComponentSpecification)
- {
- result = ((ComponentSpecification)component).getQualifier();
- }
- else if (component instanceof XSDNamedComponent)
- {
- result = ((XSDNamedComponent)component).getTargetNamespace();
- }
- else if (component instanceof SearchMatch)
- {
- QualifiedName qualifiedName = getQualifiedNameForSearchMatch((SearchMatch)component);
- if (qualifiedName != null)
- {
- result = qualifiedName.getNamespace();
- }
- }
- return result;
- }
-
- // TODO... this will be much easier with Hiroshi's proposed SearchMatch changes
- //
- private QualifiedName getQualifiedNameForSearchMatch(SearchMatch match)
- {
- QualifiedName qualifiedName = null;
- Object o = match.map.get("name");
- if (o != null && o instanceof QualifiedName)
- {
- qualifiedName = (QualifiedName)o;
- }
- return qualifiedName;
- }
-
- public String getName(Object component)
- {
- String result = null;
- if (component instanceof ComponentSpecification)
- {
- result = ((ComponentSpecification)component).getName();
- }
- else if (component instanceof XSDNamedComponent)
- {
- result = ((XSDNamedComponent)component).getName();
- }
- else if (component instanceof SearchMatch)
- {
- QualifiedName qualifiedName = getQualifiedNameForSearchMatch((SearchMatch)component);
- if (qualifiedName != null)
- {
- result = qualifiedName.getLocalName();
- }
- }
- return result;
- }
-
- public IFile getFile(Object component)
- {
- IFile result = null;
- if (component instanceof ComponentSpecification)
- {
- result = ((ComponentSpecification)component).getFile();
- }
- else if (component instanceof SearchMatch)
- {
- result = ((SearchMatch)component).getFile();
- }
- else if (component instanceof XSDConcreteComponent)
- {
- XSDConcreteComponent concreteComponent = (XSDConcreteComponent)component;
- XSDSchema schema = concreteComponent.getSchema();
- if (schema != null)
- {
- // TODO (cs) revisit and test more
- //
- String location = schema.getSchemaLocation();
- String platformResource = "platform:/resource";
- if (location != null && location.startsWith(platformResource))
- {
- Path path = new Path(location.substring(platformResource.length()));
- result = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- }
- }
- return result;
- }
-
- public ILabelProvider getLabelProvider()
- {
- return this;
- }
-
- public String getText(Object element)
- {
- String result = "";
- String name = getName(element);
- if (name != null)
- {
- result += name;
- /*
- String qualifier = getQualifier(element);
- if (qualifier != null)
- {
- result += " - " + qualifier;
- }
- IFile file = getFile(element);
- if (file != null)
- {
- result += " (" + file.getProject().getName() + ")";
- }*/
- }
- return result;
- }
-
- public Image getImage(Object component)
- {
- Image result = null;
- if (component instanceof SearchMatch)
- {
- SearchMatch searchMatch = (SearchMatch)component;
- QualifiedName qualifiedName = (QualifiedName)searchMatch.map.get("metaName");
- if ( qualifiedName != null ){
- if ( qualifiedName.equals(IXSDSearchConstants.SIMPLE_TYPE_META_NAME))
- result = SIMPLE_TYPE_IMAGE;
- else if ( qualifiedName.equals(IXSDSearchConstants.COMPLEX_TYPE_META_NAME))
- result = COMPLEX_TYPE_IMAGE;
- else if ( qualifiedName.equals(IXSDSearchConstants.ELEMENT_META_NAME))
- result = ELEMENT_IMAGE;
- }
- }
- else if (component instanceof XSDComplexTypeDefinition)
- result = COMPLEX_TYPE_IMAGE;
- else if (component instanceof XSDSimpleTypeDefinition)
- result = SIMPLE_TYPE_IMAGE;
- else if (component instanceof XSDElementDeclaration)
- result = ELEMENT_IMAGE;
- return result;
- }
-
- public Image getFileIcon(Object component) {
- return XSDEditorPlugin.getXSDImage("icons/XSDFile.gif");
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java
deleted file mode 100644
index 337fa15fad..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.editor.search;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.core.search.SearchEngine;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDSchema;
-
-public class XSDElementsSearchListProvider extends XSDSearchListProvider
-{
- public XSDElementsSearchListProvider(IFile currentFile, XSDSchema[] schemas)
- {
- super(currentFile, schemas);
- }
-
- public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm)
- {
- // now we traverse the types already defined within the visible schemas
- // we do this in addition to the component search since this should execute
- // very quickly and there's a good chance the user wants to select a time that's
- // already imported/included
- // TODO (cs) ensure we don't add duplicates when we proceed to use the search list
- //
- List visitedSchemas = new ArrayList();
- for (int i = 0; i < schemas.length; i++)
- {
- XSDSchema schema = schemas[i];
- ComponentCollectingXSDVisitor visitor = new ComponentCollectingXSDVisitor(list, IXSDSearchConstants.ELEMENT_META_NAME);
- visitor.visitSchema(schema, true);
- visitedSchemas.addAll(visitor.getVisitedSchemas());
- }
- // finally we call the search API's to do a potentially slow search
- if (scope != null)
- {
- populateComponentListUsingSearch(list, scope, pm, createFileMap(visitedSchemas));
- }
- }
-
- private void populateComponentListUsingSearch(IComponentList list, SearchScope scope, IProgressMonitor pm, HashMap files)
- {
- SearchEngine searchEngine = new SearchEngine();
- InternalSearchRequestor requestor = new InternalSearchRequestor(list, files);
- findMatches(searchEngine, requestor, scope, IXSDSearchConstants.ELEMENT_META_NAME);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java
deleted file mode 100644
index 8bbc6abee4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialogConfiguration;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ScopedComponentSearchListDialog;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class XSDSearchListDialogDelegate implements IComponentDialog
-{
- public final static QualifiedName TYPE_META_NAME = new QualifiedName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "type"); //$NON-NLS-1$
- public final static QualifiedName ELEMENT_META_NAME = new QualifiedName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "element"); //$NON-NLS-1$
- // protected Object setObject;
- protected ComponentSpecification selection;
- protected IFile currentFile;
- protected XSDSchema[] schemas;
- protected QualifiedName metaName;
- protected boolean showComplexTypes = true;
-
- public XSDSearchListDialogDelegate(QualifiedName metaName, IFile currentFile, XSDSchema[] schemas)
- {
- super();
- this.metaName = metaName;
- this.currentFile = currentFile;
- this.schemas = schemas;
- }
-
- public ComponentSpecification getSelectedComponent()
- {
- return selection;
- }
-
- public void setInitialSelection(ComponentSpecification componentSpecification)
- {
- // TODO Auto-generated method stub
- }
-
- /**
- * Whether to show complex types in the Dialog's List, has no effect if the
- * dialog populates list of elements instead of type
- * @param value
- */
- public void showComplexTypes(boolean value)
- {
- showComplexTypes = value;
- }
-
- public int createAndOpen()
- {
- Shell shell = XSDEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
- int returnValue = Window.CANCEL;
- ScopedComponentSearchListDialog dialog = null;
-
- // TODO (cs) lot's of code is common to both these blocks. Can we re-org it a bit
- // so it's easier to see the difference between how we config for an element vs type?
- if ( metaName == ELEMENT_META_NAME)
- {
- XSDComponentDescriptionProvider descriptionProvider = new XSDComponentDescriptionProvider();
- final XSDElementsSearchListProvider searchListProvider = new XSDElementsSearchListProvider(currentFile, schemas);
- ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
-
- configuration.setDescriptionProvider(descriptionProvider);
- configuration.setSearchListProvider(searchListProvider);
- configuration.setFilterLabelText(Messages._UI_LABEL_NAME_SEARCH_FILTER_TEXT);
- configuration.setListLabelText(Messages._UI_LABEL_ELEMENTS_COLON);
-// configuration.setNewComponentHandler(new NewElementButtonHandler());
- //TODO externalize string
- dialog = new ScopedComponentSearchListDialog(shell, Messages._UI_LABEL_SET_ELEMENT_REFERENCE, configuration);
- }
- else if (metaName == TYPE_META_NAME)
- {
- XSDComponentDescriptionProvider descriptionProvider = new XSDComponentDescriptionProvider();
- final XSDTypesSearchListProvider searchListProvider = new XSDTypesSearchListProvider(currentFile, schemas);
- if (!showComplexTypes)
- searchListProvider.showComplexTypes(false);
-
- ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration();
- configuration.setDescriptionProvider(descriptionProvider);
- configuration.setSearchListProvider(searchListProvider);
-// configuration.setNewComponentHandler(new NewTypeButtonHandler());
- configuration.setFilterLabelText(Messages._UI_LABEL_NAME_SEARCH_FILTER_TEXT);
- configuration.setListLabelText(Messages._UI_LABEL_TYPES_COLON);
- dialog = new ScopedComponentSearchListDialog(shell, Messages._UI_LABEL_SET_TYPE, configuration); //$NON-NLS-1$
- }
-
- if (dialog != null)
- {
- dialog.setCurrentResource(currentFile);
- dialog.setBlockOnOpen(true);
- dialog.create();
- returnValue = dialog.open();
- if (returnValue == Window.OK)
- {
- selection = dialog.getSelectedComponent();
- }
- }
- return returnValue;
- }
-
-// private IEditorPart getActiveEditor()
-// {
-// IWorkbench workbench = PlatformUI.getWorkbench();
-// IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-// IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-// return editorPart;
-// }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java
deleted file mode 100644
index 9d80faeaab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.editor.search;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.core.search.SearchEngine;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList;
-import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-public class XSDTypesSearchListProvider extends XSDSearchListProvider
-{
- protected IXSDTypesFilter builtInFilter;
- /**
- * Determines if we should use the filter This us used to turn the filter on
- * and off
- */
- protected boolean supportFilter = true;
- private boolean showComplexTypes = true;
-
- public XSDTypesSearchListProvider(IFile currentFile, XSDSchema[] schemas)
- {
- super(currentFile, schemas);
- }
-
- public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm)
- {
- // first we add the 'built in' types
- //
- XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)
- {
- XSDTypeDefinition td = (XSDTypeDefinition) i.next();
- if (builtInFilter == null || !builtInFilter.shouldFilterOut(td))
- {
- list.add(td);
- }
- }
- // now we traverse the types already defined within the visible schemas
- // we do this in addition to the component search since this should execute
- // very quickly and there's a good chance the user wants to select a time
- // that's
- // already imported/included
- // TODO (cs) ensure we don't add duplicates when we proceed to use the
- // search list
- //
- List visitedSchemas = new ArrayList();
- for (int i = 0; i < schemas.length; i++)
- {
- XSDSchema schema = schemas[i];
- QualifiedName kind = showComplexTypes ? IXSDSearchConstants.TYPE_META_NAME : IXSDSearchConstants.SIMPLE_TYPE_META_NAME;
- ComponentCollectingXSDVisitor visitor = new ComponentCollectingXSDVisitor(list, kind);
- visitor.visitSchema(schema, true);
- visitedSchemas.addAll(visitor.getVisitedSchemas());
- }
- // finally we call the search API's to do a potentially slow search
- //
- if (scope != null)
- {
- populateComponentListUsingSearch(list, scope, pm, createFileMap(visitedSchemas));
- }
- }
-
- private void populateComponentListUsingSearch(IComponentList list, SearchScope scope, IProgressMonitor pm, HashMap files)
- {
- SearchEngine searchEngine = new SearchEngine();
- InternalSearchRequestor requestor = new InternalSearchRequestor(list, files);
- if (showComplexTypes)
- {
- findMatches(searchEngine, requestor, scope, IXSDSearchConstants.COMPLEX_TYPE_META_NAME);
- }
- findMatches(searchEngine, requestor, scope, IXSDSearchConstants.SIMPLE_TYPE_META_NAME);
- }
-
-
- public void _populateComponentListQuick(IComponentList list, IProgressMonitor pm)
- {
- }
-
- public void turnBuiltInFilterOn(boolean option)
- {
- supportFilter = option;
- }
-
- public void setBuiltInFilter(IXSDTypesFilter filter)
- {
- this.builtInFilter = filter;
- }
-
- public void showComplexTypes(boolean show)
- {
- showComplexTypes = show;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java
deleted file mode 100644
index e0f65945c0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.navigation;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.TextSelectionNavigationLocation;
-
-/**
- * The platform's navigation history plumbing doesn't like multipage text
- * editors very much and tends to ignore text locations. To fix this
- * problem we need to override the getEditPart() method of the super class
- * in order to return the actual TextEditor of our multi-page editor
- */
-public class MultiPageEditorTextSelectionNavigationLocation extends TextSelectionNavigationLocation
-{
- public MultiPageEditorTextSelectionNavigationLocation(ITextEditor part, boolean initialize)
- {
- super(part, initialize);
- }
-
- protected IEditorPart getEditorPart()
- {
- IEditorPart part = super.getEditorPart();
- if (part != null)
- return (ITextEditor) part.getAdapter(ITextEditor.class);
- return null;
- }
-
- public String getText()
- {
- // ISSUE: how to get title?
- // IEditorPart part = getEditorPart();
- // if (part instanceof WSDLTextEditor) {
- // return ((WSDLTextEditor) part).getWSDLEditor().getTitle();
- // }
- // else {
- // return super.getText();
- // }
- return super.getText();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java
deleted file mode 100644
index 76b363add0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.nsedit;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-public class SchemaPrefixChangeHandler
-{
- String newPrefix;
- XSDSchema xsdSchema;
-
- public SchemaPrefixChangeHandler(XSDSchema xsdSchema, String newPrefix)
- {
- this.xsdSchema = xsdSchema;
- this.newPrefix= newPrefix;
- }
-
- public void resolve()
- {
- XSDSchemaPrefixRenamer xsdSchemaPrefixRenamer = new XSDSchemaPrefixRenamer();
- xsdSchemaPrefixRenamer.visitSchema(xsdSchema);
- }
-
- public String getNewQName(XSDTypeDefinition comp, String value, String newXSDPrefix)
- {
- String qName = null;
- if (value != null)
- {
- qName = newXSDPrefix;
- if (qName != null && qName.length() > 0)
- {
- qName += ":" + value;
- }
- else
- {
- qName = value;
- }
- }
- else
- {
- qName = value;
- }
-
- return qName;
- }
-
-
- class XSDSchemaPrefixRenamer extends XSDVisitor
- {
- public XSDSchemaPrefixRenamer()
- {
- super();
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- super.visitElementDeclaration(element);
- XSDTypeDefinition type = element.getType();
- if (type != null)
- {
- String ns = type.getTargetNamespace();
- if (ns == null) ns = "";
-// if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
- if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
- {
- Element domElement = element.getElement();
- if (domElement != null && domElement instanceof IDOMNode)
- {
- Attr typeAttr = domElement.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
- if (typeAttr != null)
- {
- element.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName(type, type.getName(), newPrefix));
- }
- }
- }
- }
- }
-
- public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition simpleType)
- {
- super.visitSimpleTypeDefinition(simpleType);
- XSDTypeDefinition baseType = simpleType.getBaseTypeDefinition();
-
- if (baseType != null)
- {
- String ns = baseType.getTargetNamespace();
- if (ns == null) ns = "";
-// if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
- if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
- {
- XSDDOMHelper domHelper = new XSDDOMHelper();
- Element derivedBy = domHelper.getDerivedByElement(simpleType.getElement());
- if (derivedBy != null && derivedBy instanceof IDOMNode)
- {
- Attr typeAttr = derivedBy.getAttributeNode(XSDConstants.BASE_ATTRIBUTE);
- if (typeAttr != null)
- {
- derivedBy.setAttribute(XSDConstants.BASE_ATTRIBUTE, getNewQName(baseType, baseType.getName(), newPrefix));
- }
- }
- }
- }
-
- XSDSimpleTypeDefinition itemType = simpleType.getItemTypeDefinition();
- if (itemType != null)
- {
- String ns = itemType.getTargetNamespace();
- if (ns == null) ns = "";
- if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
- {
- XSDDOMHelper domHelper = new XSDDOMHelper();
- Node listNode = domHelper.getChildNode(simpleType.getElement(), XSDConstants.LIST_ELEMENT_TAG);
- if (listNode != null && listNode instanceof Element)
- {
- Element listElement = (Element)listNode;
- if (listElement instanceof IDOMNode)
- {
- Attr typeAttr = listElement.getAttributeNode(XSDConstants.ITEMTYPE_ATTRIBUTE);
- if (typeAttr != null)
- {
- listElement.setAttribute(XSDConstants.ITEMTYPE_ATTRIBUTE, getNewQName(itemType, itemType.getName(), newPrefix));
- }
- }
- }
- }
- }
-
- List memberTypes = simpleType.getMemberTypeDefinitions();
- if (memberTypes.size() > 0)
- {
- XSDDOMHelper domHelper = new XSDDOMHelper();
- Node unionNode = domHelper.getChildNode(simpleType.getElement(), XSDConstants.UNION_ELEMENT_TAG);
- if (unionNode != null && unionNode instanceof Element)
- {
- Element unionElement = (Element)unionNode;
- if (unionElement instanceof IDOMNode)
- {
- StringBuffer sb = new StringBuffer("");
- for (Iterator i = memberTypes.iterator(); i.hasNext(); )
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition)i.next();
- String ns = st.getTargetNamespace();
- if (ns == null) ns = "";
- if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
- {
- sb.append(getNewQName(st, st.getName(), newPrefix));
- }
- else
- {
- sb.append(st.getQName(xsdSchema));
- }
- if (i.hasNext())
- {
- sb.append(" ");
- }
- }
- unionElement.setAttribute(XSDConstants.MEMBERTYPES_ATTRIBUTE, sb.toString());
- }
- }
- }
- }
-
- public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
- {
- super.visitAttributeDeclaration(attr);
- XSDTypeDefinition type = attr.getType();
- if (type != null)
- {
- String ns = type.getTargetNamespace();
- if (ns == null) ns = "";
-// if (ns.equals(xsdSchema.getSchemaForSchemaNamespace()))
- if (ns.equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001))
- {
- Element domElement = attr.getElement();
- if (domElement != null && domElement instanceof IDOMNode)
- {
- Attr typeAttr = domElement.getAttributeNode(XSDConstants.TYPE_ATTRIBUTE);
- if (typeAttr != null)
- {
- attr.getElement().setAttribute(XSDConstants.TYPE_ATTRIBUTE, getNewQName(type, type.getName(), newPrefix));
- }
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java
deleted file mode 100644
index 9e745ddeef..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.nsedit;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-
-
-public class TargetNamespaceChangeHandler
-{
- String newNS;
- String oldNS;
- XSDSchema xsdSchema;
-
- public TargetNamespaceChangeHandler(XSDSchema xsdSchema, String oldNS, String newNS)
- {
- this.xsdSchema = xsdSchema;
- this.oldNS= oldNS;
- this.newNS= newNS;
- }
-
- public void resolve()
- {
- ElementReferenceRenamer elementReferenceRenamer = new ElementReferenceRenamer();
- elementReferenceRenamer.visitSchema(xsdSchema);
- AttributeReferenceRenamer attributeReferenceRenamer = new AttributeReferenceRenamer();
- attributeReferenceRenamer.visitSchema(xsdSchema);
- }
-
- class ElementReferenceRenamer extends XSDVisitor
- {
- public ElementReferenceRenamer()
- {
- super();
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- super.visitElementDeclaration(element);
- if (element.isElementDeclarationReference())
- {
- if (element.getResolvedElementDeclaration().getTargetNamespace() != null)
- {
- if (element.getResolvedElementDeclaration().getTargetNamespace().equals(oldNS))
- {
- // set the resolved element's declaration to new ns
- // this is defect 237518 - target namespace rename creates a new namespace
- element.getResolvedElementDeclaration().setTargetNamespace(newNS);
- }
- }
- else
- {
- if (oldNS == null || (oldNS != null && oldNS.equals("")))
- {
- element.getResolvedElementDeclaration().setTargetNamespace(newNS);
- }
- }
- }
- }
- }
-
- // Similar to defect 237518 but for attributes
- class AttributeReferenceRenamer extends XSDVisitor
- {
- public AttributeReferenceRenamer()
- {
- super();
- }
-
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- super.visitComplexTypeDefinition(type);
- if (type.getAttributeContents() != null)
- {
- for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) iter.next();
- if (attrGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeUse attrUse = (XSDAttributeUse) attrGroupContent;
- XSDAttributeDeclaration attrDecl = attrUse.getContent();
-
- if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
- {
- if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace() != null)
- {
- if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace().equals(oldNS))
- {
- attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
- }
- }
- else
- {
- if (oldNS == null || (oldNS != null && oldNS.equals("")))
- {
- attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
- }
- }
- }
- }
- }
- }
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- super.visitAttributeGroupDefinition(attributeGroup);
- EList list = attributeGroup.getAttributeUses();
- if (list != null)
- {
- for (Iterator iter = list.iterator(); iter.hasNext(); )
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
- XSDAttributeDeclaration attrDecl = attrUse.getContent();
-
- if (attrDecl != null && attrDecl.isAttributeDeclarationReference())
- {
- if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace() != null)
- {
- if (attrDecl.getResolvedAttributeDeclaration().getTargetNamespace().equals(oldNS))
- {
- attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
- }
- }
- else
- {
- if (oldNS == null || (oldNS != null && oldNS.equals("")))
- {
- attrDecl.getResolvedAttributeDeclaration().setTargetNamespace(newNS);
- }
- }
- }
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java
deleted file mode 100644
index a0e2f8b23f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.nsedit;
-
-import java.util.Iterator;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupContent;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeContent;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDIdentityConstraintDefinition;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNotationDeclaration;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.XSDWildcard;
-
-public class XSDVisitor
-{
- public XSDVisitor()
- {
- }
-
- protected XSDSchema schema;
-
- public void visitSchema(XSDSchema schema)
- {
- this.schema = schema;
- for (Iterator iterator = schema.getAttributeDeclarations().iterator(); iterator.hasNext();)
- {
- XSDAttributeDeclaration attr = (XSDAttributeDeclaration) iterator.next();
- visitAttributeDeclaration(attr);
- }
- for (Iterator iterator = schema.getTypeDefinitions().iterator(); iterator.hasNext();)
- {
- XSDTypeDefinition type = (XSDTypeDefinition) iterator.next();
- visitTypeDefinition(type);
- }
- for (Iterator iterator = schema.getElementDeclarations().iterator(); iterator.hasNext();)
- {
- XSDElementDeclaration element = (XSDElementDeclaration) iterator.next();
- visitElementDeclaration(element);
- }
- for (Iterator iterator = schema.getIdentityConstraintDefinitions().iterator(); iterator.hasNext();)
- {
- XSDIdentityConstraintDefinition identityConstraint = (XSDIdentityConstraintDefinition) iterator.next();
- visitIdentityConstraintDefinition(identityConstraint);
- }
- for (Iterator iterator = schema.getModelGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDModelGroupDefinition modelGroup = (XSDModelGroupDefinition) iterator.next();
- visitModelGroupDefinition(modelGroup);
- }
- for (Iterator iterator = schema.getAttributeGroupDefinitions().iterator(); iterator.hasNext();)
- {
- XSDAttributeGroupDefinition attributeGroup = (XSDAttributeGroupDefinition) iterator.next();
- visitAttributeGroupDefinition(attributeGroup);
- }
- for (Iterator iterator = schema.getNotationDeclarations().iterator(); iterator.hasNext();)
- {
- XSDNotationDeclaration element = (XSDNotationDeclaration) iterator.next();
- visitNotationDeclaration(element);
- }
-
- }
-
- public void visitAttributeDeclaration(XSDAttributeDeclaration attr)
- {
- }
-
- public void visitTypeDefinition(XSDTypeDefinition type)
- {
- if (type instanceof XSDSimpleTypeDefinition)
- {
- visitSimpleTypeDefinition((XSDSimpleTypeDefinition)type);
- }
- else if (type instanceof XSDComplexTypeDefinition)
- {
- visitComplexTypeDefinition((XSDComplexTypeDefinition)type);
- }
- }
-
- public void visitElementDeclaration(XSDElementDeclaration element)
- {
- if (element.isElementDeclarationReference())
- {
- }
- else if (element.getAnonymousTypeDefinition() != null)
- {
- visitTypeDefinition(element.getAnonymousTypeDefinition());
- }
- }
-
- public void visitIdentityConstraintDefinition(XSDIdentityConstraintDefinition identityConstraint)
- {
- }
-
- public void visitModelGroupDefinition(XSDModelGroupDefinition modelGroupDef)
- {
- if (!modelGroupDef.isModelGroupDefinitionReference())
- {
- if (modelGroupDef.getModelGroup() != null)
- {
- visitModelGroup(modelGroupDef.getModelGroup());
- }
- }
- }
-
- public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
- {
- if (attributeGroup.getAttributeUses() != null)
- {
- for (Iterator iter = attributeGroup.getAttributeUses().iterator(); iter.hasNext(); )
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)iter.next();
- visitAttributeDeclaration(attrUse.getContent());
- }
- }
- }
-
- public void visitNotationDeclaration(XSDNotationDeclaration notation)
- {
- }
-
- public void visitSimpleTypeDefinition(XSDSimpleTypeDefinition type)
- {
- }
-
- public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
- {
- if (type.getContentType() != null)
- {
- XSDComplexTypeContent complexContent = type.getContentType();
- if (complexContent instanceof XSDSimpleTypeDefinition)
- {
- visitSimpleTypeDefinition((XSDSimpleTypeDefinition)complexContent);
- }
- else if (complexContent instanceof XSDParticle)
- {
- visitParticle((XSDParticle) complexContent);
- }
- }
-
- if (type.getAttributeContents() != null)
- {
- for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
- {
- XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent)iter.next();
- if (attrGroupContent instanceof XSDAttributeUse)
- {
- XSDAttributeUse attrUse = (XSDAttributeUse)attrGroupContent;
- visitAttributeDeclaration(attrUse.getContent());
- }
- else if (attrGroupContent instanceof XSDAttributeGroupDefinition)
- {
- visitAttributeGroupDefinition((XSDAttributeGroupDefinition)attrGroupContent);
- }
- }
- }
- }
-
- public void visitParticle(XSDParticle particle)
- {
- visitParticleContent(particle.getContent());
- }
-
- public void visitParticleContent(XSDParticleContent particleContent)
- {
- if (particleContent instanceof XSDModelGroupDefinition)
- {
- visitModelGroupDefinition((XSDModelGroupDefinition) particleContent);
- }
- else if (particleContent instanceof XSDModelGroup)
- {
- visitModelGroup((XSDModelGroup)particleContent);
- }
- else if (particleContent instanceof XSDElementDeclaration)
- {
- visitElementDeclaration((XSDElementDeclaration)particleContent);
- }
- else if (particleContent instanceof XSDWildcard)
- {
- visitWildcard((XSDWildcard)particleContent);
- }
- }
-
- public void visitModelGroup(XSDModelGroup modelGroup)
- {
- if (modelGroup.getContents() != null)
- {
- for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
- {
- XSDParticle particle = (XSDParticle) iterator.next();
- visitParticle(particle);
- }
- }
- }
-
- public void visitWildcard(XSDWildcard wildcard)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
deleted file mode 100644
index 5a4aadc5b9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.xsd.ui.internal.text;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IProgressService;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter;
-import org.eclipse.wst.xsd.ui.internal.util.XSDSchemaLocationResolverAdapterFactory;
-import org.eclipse.xsd.XSDFactory;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class XSDModelAdapter implements INodeAdapter
-{
- protected ResourceSet resourceSet;
- protected XSDSchema schema;
- private ModelReconcileAdapter modelReconcileAdapter;
-
- public XSDSchema getSchema()
- {
- return schema;
- }
-
- public void setSchema(XSDSchema schema)
- {
- this.schema = schema;
- }
-
- public void clear()
- {
- schema = null;
- resourceSet = null;
- }
-
- public boolean isAdapterForType(Object type)
- {
- return type == XSDModelAdapter.class;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos)
- {
- }
-
- public ModelReconcileAdapter getModelReconcileAdapter()
- {
- return modelReconcileAdapter;
- }
-
- public XSDSchema createSchema(Document document)
- {
- try
- {
- // (cs) note that we always want to ensure that a
- // schema model object get's returned
- schema = XSDFactory.eINSTANCE.createXSDSchema();
- resourceSet = XSDSchemaImpl.createResourceSet();
- resourceSet.getAdapterFactories().add(new XSDSchemaLocationResolverAdapterFactory());
-
- IDOMNode domNode = (IDOMNode)document;
- String baseLocation = domNode.getModel().getBaseLocation();
-
- // TODO... gotta pester SSE folks to provide 'useful' baseLocations
- //
- URI uri = null;
- if (baseLocation.startsWith("/"))
- {
- uri = URI.createPlatformResourceURI(baseLocation);
- }
- else
- {
- uri = URI.createFileURI(baseLocation);
- }
- Resource resource = new XSDResourceImpl();
- resource.setURI(uri);
- schema = XSDFactory.eINSTANCE.createXSDSchema();
- resource.getContents().add(schema);
- resourceSet.getResources().add(resource);
-
- schema.setDocument(document);
- final Element element = document.getDocumentElement();
- if (element != null)
- {
- // Force the loading of the "meta" schema for schema instance instance.
- //
- String schemaForSchemaNamespace = element.getNamespaceURI();
- XSDSchemaImpl.getSchemaForSchema(schemaForSchemaNamespace);
- }
-
- IRunnableWithProgress setElementOperation = new IRunnableWithProgress()
- {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
- {
- // Use the animated flavour as we don't know beforehand how many ticks we need.
- // The task name will be displayed by the code in XSDResourceImpl.
-
- monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
- Map loadOptions = resourceSet.getLoadOptions();
- loadOptions.put(XSDResourceImpl.XSD_PROGRESS_MONITOR, monitor);
-
- schema.setElement(element);
-
- loadOptions.remove(XSDResourceImpl.XSD_PROGRESS_MONITOR);
- }
- };
-
- IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
- try
- {
- progressService.busyCursorWhile(setElementOperation);
- }
- catch (InvocationTargetException e)
- {
- e.printStackTrace();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
-
- // attach an adapter to keep the XSD model and DOM in sync
- //
- modelReconcileAdapter = new XSDModelReconcileAdapter(document, schema);
- domNode.getModel().addModelStateListener(modelReconcileAdapter);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- return schema;
- }
-
- /**
- * @deprecated
- */
- public XSDSchema createSchema(Element element)
- {
- return createSchema(element.getOwnerDocument());
- }
-
- public static XSDModelAdapter lookupOrCreateModelAdapter(Document document)
- {
- XSDModelAdapter adapter = null;
- if (document instanceof INodeNotifier)
- {
- INodeNotifier notifier = (INodeNotifier)document;
- adapter = (XSDModelAdapter)notifier.getAdapterFor(XSDModelAdapter.class);
- if (adapter == null)
- {
- adapter = new XSDModelAdapter();
- notifier.addAdapter(adapter);
- }
- }
- return adapter;
- }
-
-
- public static XSDSchema lookupOrCreateSchema(final Document document)
- {
- XSDSchema result = null;
- XSDModelAdapter adapter = lookupOrCreateModelAdapter(document);
- if (adapter.getSchema() == null)
- {
-
- adapter.createSchema(document);
- }
- result = adapter.getSchema();
- return result;
- }
-}
-
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
deleted file mode 100644
index 471dce6f06..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.xsd.ui.internal.text;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.xsd.XSDSchema;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class XSDModelQueryExtension extends ModelQueryExtension
-{
- public XSDModelQueryExtension()
- {
- }
-
- public String[] getAttributeValues(Element e, String namespace, String name)
- {
- List list = new ArrayList();
-
- String currentElementName = e.getLocalName();
- Node parentNode = e.getParentNode();
- String parentName = parentNode != null ? parentNode.getLocalName() : "";
-
- if (checkName(name, "type"))
- {
- if (checkName(currentElementName, "attribute"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList2();
- list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
- }
- else if (checkName(currentElementName, "element"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList2();
- list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
- list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
- }
- }
- else if (checkName(name, "blockDefault") ||
- checkName(name, "finalDefault"))
- {
- list.add("#all");
- list.add("substitution");
- list.add("extension");
- list.add("restriction");
- }
- else if (checkName(name, "namespace"))
- {
- if (checkName(currentElementName, "any") ||
- checkName(currentElementName, "anyAttribute"))
- {
- list.add("##any");
- list.add("##other");
- list.add("##targetNamespace");
- list.add("##local");
- }
- }
- else if (checkName(name, "maxOccurs"))
- {
- list.add("1");
- list.add("unbounded");
- }
- else if (checkName(name, "minOccurs"))
- {
- list.add("0");
- list.add("1");
- }
- else if (checkName(name, "itemType"))
- {
- if (checkName(currentElementName, "list"))
- {
- if (checkName(parentName, "simpleType"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
- }
- }
- }
- else if (checkName(name, "memberTypes"))
- {
- if (checkName(currentElementName, "union"))
- {
- if (checkName(parentName, "simpleType"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
- }
- }
- }
- else if (checkName(name, "base"))
- {
- if (checkName(currentElementName, "restriction"))
- {
- if (checkName(parentName, "simpleType"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserSimpleTypeNamesList());
- }
- else if (checkName(parentName, "simpleContent"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
- }
- else if (checkName(parentName, "complexContent"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
- }
- }
- else if (checkName(currentElementName, "extension"))
- {
- if (checkName(parentName, "simpleContent"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
- }
- else if (checkName(parentName, "complexContent"))
- {
- list = getTypesHelper(e).getBuiltInTypeNamesList();
- list.addAll(getTypesHelper(e).getUserComplexTypeNamesList());
- }
- }
- }
- else if (checkName(name, "ref"))
- {
- if (checkName(currentElementName, "element"))
- {
- list = getTypesHelper(e).getGlobalElements();
- }
- else if (checkName(currentElementName, "attribute"))
- {
- list = getTypesHelper(e).getGlobalAttributes();
- }
- else if (checkName(currentElementName, "attributeGroup"))
- {
- list = getTypesHelper(e).getGlobalAttributeGroups();
- }
- else if (checkName(currentElementName, "group"))
- {
- list = getTypesHelper(e).getModelGroups();
- }
- }
- else if (checkName(name, "substitutionGroup"))
- {
- if (checkName(currentElementName, "element"))
- {
- list = getTypesHelper(e).getGlobalElements();
- }
- }
-
- String[] result = new String[list.size()];
- list.toArray(result);
- return result;
- }
-
- protected XSDSchema lookupOrCreateSchema(Document document)
- {
- return XSDModelAdapter.lookupOrCreateSchema(document);
- }
-
- /**
- * @deprecated
- */
- protected XSDSchema lookupOrCreateSchemaForElement(Element element)
- {
- return lookupOrCreateSchema(element.getOwnerDocument());
- }
-
- protected TypesHelper getTypesHelper(Element element)
- {
- XSDSchema schema = lookupOrCreateSchema(element.getOwnerDocument());
- return new TypesHelper(schema);
- }
-
-
- protected boolean checkName(String localName, String token)
- {
- if (localName != null && localName.trim().equals(token))
- {
- return true;
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/DocumentAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/DocumentAdapter.java
deleted file mode 100644
index ca6c559af4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/DocumentAdapter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.util;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-abstract class DocumentAdapter implements INodeAdapter
-{
- Document document;
-
- public DocumentAdapter(Document document)
- {
- this.document = document;
- ((INodeNotifier) document).addAdapter(this);
- adaptChildElements(document);
- }
-
- private void adaptChildElements(Node parentNode)
- {
- for (Node child = parentNode.getFirstChild(); child != null; child = child.getNextSibling())
- {
- if (child.getNodeType() == Node.ELEMENT_NODE)
- {
- adapt((Element) child);
- }
- }
- }
-
- public void adapt(Element element)
- {
- if (((INodeNotifier) element).getExistingAdapter(this) == null)
- {
- ((INodeNotifier) element).addAdapter(this);
- adaptChildElements(element);
- }
- }
-
- public boolean isAdapterForType(Object type)
- {
- return type == this;
- }
-
- abstract public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index);
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java
deleted file mode 100644
index 2cd1353896..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-public abstract class SelectionAdapter implements ISelectionProvider
-{
- protected List listenerList = new ArrayList();
- protected ISelection selection = new StructuredSelection();
- protected ISelectionProvider eventSource;
-
- public void setEventSource(ISelectionProvider eventSource)
- {
- this.eventSource = eventSource;
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.add(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.remove(listener);
- }
-
- public ISelection getSelection()
- {
- return selection;
- }
-
- /**
- * This method should be specialized to return the correct object that corresponds to the 'other' model
- */
- abstract protected Object getObjectForOtherModel(Object object);
-
-
- public void setSelection(ISelection modelSelection)
- {
- List otherModelObjectList = new ArrayList();
- if (modelSelection instanceof IStructuredSelection)
- {
- for (Iterator i = ((IStructuredSelection)modelSelection).iterator(); i.hasNext(); )
- {
- Object modelObject = i.next();
- Object otherModelObject = getObjectForOtherModel(modelObject);
- if (otherModelObject != null)
- {
- otherModelObjectList.add(otherModelObject);
- }
- }
- }
-
- StructuredSelection nodeSelection = new StructuredSelection(otherModelObjectList);
- selection = nodeSelection;
- SelectionChangedEvent event = new SelectionChangedEvent(eventSource != null ? eventSource : this, nodeSelection);
-
- for (Iterator i = listenerList.iterator(); i.hasNext(); )
- {
- ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
- listener.selectionChanged(event);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java
deleted file mode 100644
index 1a6c5216e0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDImport;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.impl.XSDImportImpl;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-public class TypesHelper
-{
- XSDSchema xsdSchema;
- Vector list = new Vector();
-
- public TypesHelper(XSDSchema xsdSchema)
- {
- this.xsdSchema = xsdSchema;
- }
-
- private void updateExternalImportGlobals()
- {
- if (xsdSchema != null)
- {
- Iterator contents = xsdSchema.getContents().iterator();
- while (contents.hasNext())
- {
- XSDSchemaContent content = (XSDSchemaContent) contents.next();
- if (content instanceof XSDImportImpl)
- {
- XSDImportImpl anImport = (XSDImportImpl) content;
- try
- {
- if (anImport.getSchemaLocation() != null)
- {
- anImport.importSchema();
- }
- }
- catch (Exception e)
- {
-
- }
- }
- }
- }
- }
-
-
- public java.util.List getBuiltInTypeNamesList()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- String prefix = xsdSchema.getSchemaForSchemaQNamePrefix();
- if (prefix != null && prefix.length() > 0)
- {
- prefix = prefix + ":";
- }
- else
- {
- prefix = "";
- }
- List result = new ArrayList();
- if (xsdSchema != null)
- {
- XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)
- {
- XSDTypeDefinition td = (XSDTypeDefinition) i.next();
- String localName = td.getName();
- String prefixedName = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName;
- result.add(prefixedName);
- }
- }
- }
- return items;
- }
-
- // issue (cs) do we still need this? it can likely be remove now
- // was used for content assist but I don't think we really need it
- public java.util.List getBuiltInTypeNamesList2()
- {
- List result = new ArrayList();
- if (xsdSchema != null)
- {
- List prefixes = getPrefixesForNamespace(xsdSchema.getSchemaForSchemaNamespace());
- XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();)
- {
- XSDTypeDefinition td = (XSDTypeDefinition) i.next();
- String localName = td.getName();
- String prefix = prefixes.size() > 0 ? (String)prefixes.get(0) : null;
- String prefixedName = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName;
- result.add(prefixedName);
- }
- }
- return result;
- }
-
- public java.util.List getUserSimpleTypeNamesList()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- Iterator i = xsdSchema.getTypeDefinitions().iterator();
- while (i.hasNext())
- {
- XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
- if (typeDefinition instanceof XSDSimpleTypeDefinition)
- {
- items.addAll(getPrefixedNames(typeDefinition.getTargetNamespace(), typeDefinition.getName()));
- }
- }
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- public java.util.List getUserComplexTypeNamesList()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- Iterator i = xsdSchema.getTypeDefinitions().iterator();
- while (i.hasNext())
- {
- XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
- if (typeDefinition instanceof XSDComplexTypeDefinition)
- {
- items.addAll(getPrefixedNames(typeDefinition.getTargetNamespace(), typeDefinition.getName()));
- }
- }
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- public java.util.List getUserSimpleTypes()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- Iterator i = xsdSchema.getTypeDefinitions().iterator();
- while (i.hasNext())
- {
- XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next();
- if (typeDefinition instanceof XSDSimpleTypeDefinition)
- {
- items.add(typeDefinition);
- //items.add(typeDefinition.getQName(xsdSchema));
- }
- }
- // We need to add the anyType
-// items.add(getPrefix(xsdSchema.getSchemaForSchemaNamespace(), true) + "anyType");
-
- // items = addExternalImportedUserSimpleTypes(items);
- //items = (Vector) sortList(items);
- }
- return items;
- }
-
- public String getPrefix(String ns, boolean withColon)
- {
- String key = "";
-
- if (xsdSchema != null)
- {
- Map map = xsdSchema.getQNamePrefixToNamespaceMap();
- Iterator iter = map.keySet().iterator();
- while (iter.hasNext())
- {
- Object keyObj = iter.next();
- Object value = map.get(keyObj);
- if (value != null && value.toString().equals(ns))
- {
- if (keyObj != null)
- {
- key = keyObj.toString();
- }
- else
- {
- key = "";
- }
- break;
- }
- }
- if (!key.equals(""))
- {
- if (withColon)
- {
- key = key + ":";
- }
- }
- }
- return key;
- }
-
- public java.util.List getGlobalElements()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- if (xsdSchema.getElementDeclarations() != null)
- {
- Iterator i = xsdSchema.getElementDeclarations().iterator();
- while (i.hasNext())
- {
- XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) i.next();
- String name = elementDeclaration.getQName(xsdSchema);
- if (name != null)
- {
- items.add(name);
- }
- }
- }
- // items = addExternalImportedGlobalElements(items);
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- public java.util.List getGlobalAttributes()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- if (xsdSchema.getAttributeDeclarations() != null)
- {
- Iterator i = xsdSchema.getAttributeDeclarations().iterator();
- while (i.hasNext())
- {
- XSDAttributeDeclaration attributeDeclaration = (XSDAttributeDeclaration) i.next();
- if (attributeDeclaration.getTargetNamespace() == null || (attributeDeclaration.getTargetNamespace() != null && !attributeDeclaration.getTargetNamespace().equals(XSDConstants.SCHEMA_INSTANCE_URI_2001)))
- {
- String name = attributeDeclaration.getQName(xsdSchema);
- if (name != null)
- {
- items.add(name);
- }
- }
- }
- }
- // items = addExternalImportedAttributes(items);
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- public java.util.List getGlobalAttributeGroups()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- if (xsdSchema.getAttributeGroupDefinitions() != null)
- {
- Iterator i = xsdSchema.getAttributeGroupDefinitions().iterator();
- while (i.hasNext())
- {
- XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) i.next();
- String name = attributeGroupDefinition.getQName(xsdSchema);
- if (name != null)
- {
- items.add(name);
- }
- }
- }
- // items = addExternalImportedAttributeGroups(items);
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- public java.util.List getModelGroups()
- {
- Vector items = new Vector();
- if (xsdSchema != null)
- {
- updateExternalImportGlobals();
- if (xsdSchema.getModelGroupDefinitions() != null)
- {
- Iterator i = xsdSchema.getModelGroupDefinitions().iterator();
- while (i.hasNext())
- {
- XSDModelGroupDefinition modelGroupDefinition = (XSDModelGroupDefinition) i.next();
- String name = modelGroupDefinition.getQName(xsdSchema);
- if (name != null)
- {
- items.add(name);
- }
- }
- }
- // items = addExternalImportedGroups(items);
- items = (Vector) sortList(items);
- }
- return items;
- }
-
- // issue (cs) ssems like a rather goofy util method?
- public static java.util.List sortList(java.util.List types)
- {
- try
- {
- java.util.Collections.sort(types); // performance? n*log(n)
- }
- catch (Exception e)
- {
-// XSDEditorPlugin.getPlugin().getMsgLogger().write("Sort failed");
- }
- return types;
- }
-
- // issue (cs) do we still need this?
- public void updateMapAfterDelete(XSDImport deletedNode)
- {
- String ns = deletedNode.getNamespace();
- if (ns != null)
- {
- String prefix = getPrefix(ns, false);
- if (prefix != null)
- {
- prefix = prefix.trim();
- }
- String xmlnsAttr = (prefix == "") ? "xmlns" : "xmlns:" + prefix;
-
- if (prefix == "")
- {
- prefix = null;
- }
-
- if (xsdSchema != null)
- {
- Map map = xsdSchema.getQNamePrefixToNamespaceMap();
- map.remove(prefix);
- Element schemaElement = xsdSchema.getElement();
- schemaElement.removeAttribute(xmlnsAttr);
- }
- }
- }
-
- public List getPrefixedNames(String namespace, String localName)
- {
- List list = new ArrayList();
- if (namespace == null)
- {
- namespace = "";
- }
- if (xsdSchema != null && localName != null)
- {
- List prefixes = getPrefixesForNamespace(namespace);
- for (Iterator i = prefixes.iterator(); i.hasNext(); )
- {
- String prefix = (String)i.next();
- if (prefix == null) prefix = "";
- String prefixedName = prefix.length() > 0 ? prefix + ":" + localName : localName;
- list.add(prefixedName);
- }
- if (prefixes.size() == 0)
- {
- list.add(localName);
- }
- }
- return list;
- }
-
- protected List getPrefixesForNamespace(String namespace)
- {
- List list = new ArrayList();
- Map map = xsdSchema.getQNamePrefixToNamespaceMap();
- for (Iterator iter = map.keySet().iterator(); iter.hasNext();)
- {
- String prefix = (String) iter.next();
- Object value = map.get(prefix);
- if (value != null && value.toString().equals(namespace))
- {
- list.add(prefix);
- }
- }
- return list;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java
deleted file mode 100644
index 9c95ee7907..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.util;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-// issue (cs) can we get rid of this class?
-// I've stripped it down a whole lot... but it'd be great to get rid of it
-//
-public class ViewUtility
-{
- private static Font font;
-
- private static Font getFont()
- {
- if (font == null)
- {
- font = new Font(Display.getCurrent(), "ms sans serif", 8, SWT.NORMAL);
- }
- return font;
- }
-
- public static void setComposite(Composite comp)
- {
- // deprecated. Remove later
- }
- public static Composite createComposite(Composite parent, int numColumns)
- {
- Composite composite = new Composite(parent, SWT.NONE);
-
- composite.setFont(getFont());
-
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- return composite;
- }
-
- public static Composite createComposite(Composite parent, int numColumns, boolean horizontalFill)
- {
- if (!horizontalFill)
- {
- createComposite(parent, numColumns);
- }
-
- Composite composite = new Composite(parent, SWT.NONE);
-
- composite.setFont(getFont());
-
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- composite.setLayoutData(data);
-
- return composite;
- }
-
- public static Label createHorizontalFiller(Composite parent, int horizontalSpan)
- {
- Label label = new Label(parent, SWT.LEFT);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = horizontalSpan;
- label.setLayoutData(data);
- return label;
- }
-
- /**
- * Helper method for creating labels.
- */
- public static Label createLabel(Composite parent, String text)
- {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
- }
-
- public Label createLabel(Composite parent, int style, String text)
- {
- Label label = new Label(parent, style);
-// setColor(label);
- label.setText(text);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
- return label;
- }
-
- public static Label createLabel(Composite parent, String text, int alignment)
- {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = alignment;
- label.setLayoutData(data);
- return label;
- }
-
-
-
-
- /**
- * Create radio button
- */
- public static Button createRadioButton(Composite parent, String label)
- {
- Button button = new Button(parent, SWT.RADIO);
- button.setText(label);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
-
- return button;
- }
-
- /**
- * Helper method for creating check box
- */
- public static Button createCheckBox(Composite parent, String label)
- {
- Button button = new Button(parent, SWT.CHECK);
- button.setText(label);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- button.setLayoutData(data);
- return button;
- }
-
- public static Combo createComboBox(Composite parent)
- {
- return createComboBox(parent, true);
- }
-
- public static Combo createComboBox(Composite parent, boolean isReadOnly)
- {
- int style = isReadOnly == true ? SWT.READ_ONLY : SWT.DROP_DOWN;
-
- Combo combo = new Combo(parent, style);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- combo.setLayoutData(data);
- return combo;
- }
-
-
- public static Text createTextField(Composite parent, int width)
- {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.widthHint = width;
- text.setLayoutData(data);
-
- return text;
- }
-
- /**
- * <code>createWrappedMultiTextField</code> creates a wrapped multitext field
- *
- * @param parent a <code>Composite</code> value
- * @param width an <code>int</code> value
- * @param numLines an <code>int</code> value representing number of characters in height
- * @param verticalFill a <code>boolean</code> value
- * @return a <code>Text</code> value
- */
- public static Text createWrappedMultiTextField(Composite parent, int width, int numLines, boolean verticalFill)
- {
- Text text = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- if (verticalFill)
- {
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- }
- data.widthHint = width;
- FontData[] fontData = getFont().getFontData();
- // hack for now where on Windows, only 1 fontdata exists
- data.heightHint = numLines * fontData[0].getHeight();
- text.setLayoutData(data);
-
- return text;
- }
-
- public static Text createMultiTextField(Composite parent, int width, int height, boolean verticalFill)
- {
- Text text = new Text(parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- if (verticalFill)
- {
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- }
- data.widthHint = width;
- data.heightHint = height;
- text.setLayoutData(data);
-
- return text;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
deleted file mode 100644
index 6e705b827b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.util;
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-// issue (cs) remove this class!!
-public class XSDDOMHelper
-{
-
- private static String XMLSchemaURI = "http://www.w3.org/2001/XMLSchema";
-
- /**
- * Constructor for XSDDOMHelper.
- */
- public XSDDOMHelper()
- {
- super();
- }
-
- public Node getChildNode(Element parent, String childName)
- {
-/* NodeList nodeList = parent.getElementsByTagNameNS(XMLSchemaURI, childName);
- if (nodeList.getLength() > 0)
- return nodeList.item(0);
- return null;
-*/
- NodeList list = null;
- if (parent != null)
- {
- list = parent.getChildNodes();
- }
-
- if (list != null)
- {
- // Performance issue perhaps?
- for (int i = 0; i < list.getLength(); i++)
- {
- if (list.item(i) instanceof Element)
- {
- if (list.item(i).getLocalName().equals(childName))
- {
- return list.item(i);
- }
- }
- }
- }
- return null;
- }
-
-
-
-
- public void changeDerivedByType(Element element, String derivedByType, String type)
- {
- Document doc = element.getOwnerDocument();
-
- String prefix = element.getPrefix();
- prefix = prefix == null ? "" : prefix + ":";
-
- Element derivedByElement = getDerivedByElement(element);
-
- if (derivedByElement != null && derivedByElement.getLocalName().equals(derivedByType))
- {
- return; // it's already the derived by type
- }
- Element newNode;
- if (derivedByType.equals("restriction"))
- {
- newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.RESTRICTION_ELEMENT_TAG);
- }
- else
- {
- newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.EXTENSION_ELEMENT_TAG);
- }
-
- newNode.setAttribute("base", type);
-
- if (derivedByElement != null)
- {
- if (derivedByElement.hasChildNodes())
- {
- NodeList nodes = derivedByElement.getChildNodes();
- // use clones so we don't have a refresh problem
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node node = nodes.item(i);
- newNode.appendChild(node.cloneNode(true));
- }
- }
- element.replaceChild(newNode, derivedByElement);
- }
- else
- {
- Element parent = (Element) element.getParentNode(); // get back to complexType
- NodeList nodes = parent.getChildNodes();
- ArrayList nodeSaveList = new ArrayList();
-
- // save children. (nodes turns out to be the same object as parent;
- // deleting them from parent will delete them from nodes.)
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node node = nodes.item(i);
- nodeSaveList.add(node);
- }
-
- // remove children so we can surround them by complexContent
- for (int i = 0; i < nodeSaveList.size(); i++)
- {
- Node node = (Node) nodeSaveList.get(i);
- parent.removeChild(node);
- }
-
- // build a complexContent element
- Element complexContent = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + XSDConstants.COMPLEXCONTENT_ELEMENT_TAG);
- parent.appendChild(complexContent); // insert into complexType
- complexContent.appendChild(newNode); // insert derivation type
- for (int i = 0; i < nodeSaveList.size(); i++) // insert children previously of complexType
- {
- Node node = (Node) nodeSaveList.get(i);
- newNode.appendChild(node.cloneNode(true));
- }
-
- parent.appendChild(complexContent);
- formatChild(complexContent);
- }
- }
-
-
- /**
- * Get the derived by node given the complexContent or simpleContent node
- */
- public Element getDerivedByElement(Element element)
- {
- Node restrictionChild = getChildNode(element, "restriction");
- Node extensionChild = getChildNode(element, "extension");
- if (restrictionChild != null)
- {
- if (restrictionChild instanceof Element)
- {
- return (Element)restrictionChild;
- }
- }
-
- if (extensionChild != null)
- {
- if (extensionChild instanceof Element)
- {
- return (Element)extensionChild;
- }
- }
- return null;
- }
-
- /**
- * Get the derived by node given the ComplexType node
- * Returns the first one, if say, the INVALID schema has more than one
- */
- public Element getDerivedByElementFromComplexType(Element element)
- {
- NodeList nl = element.getChildNodes();
- int j = 0;
- for (j = 0; j < nl.getLength(); j++)
- {
- Node aNode = nl.item(j);
- if (inputEquals(aNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
- {
- break;
- }
- else if (inputEquals(aNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
- {
- break;
- }
- }
- Element derivedByNode = getDerivedByElement((Element)nl.item(j));
- return derivedByNode;
- }
-
- /**
- * Get the content model given the ComplexType node
- * Returns the first one, if say, the INVALID schema has more than one
- */
- public Element getContentModelFromParent(Element element)
- {
- NodeList nl = element.getChildNodes();
- int j = 0;
- boolean modelExists = false;
- int length = nl.getLength();
- for (j = 0; j < length; j++)
- {
- Node aNode = nl.item(j);
- if (inputEquals(aNode, XSDConstants.COMPLEXCONTENT_ELEMENT_TAG, false))
- {
- modelExists = true;
- break;
- }
- else if (inputEquals(aNode, XSDConstants.SIMPLECONTENT_ELEMENT_TAG, false))
- {
- modelExists = true;
- break;
- }
- else if (inputEquals(aNode, XSDConstants.SEQUENCE_ELEMENT_TAG, false))
- {
- modelExists = true;
- break;
- }
- else if (inputEquals(aNode, XSDConstants.CHOICE_ELEMENT_TAG, false))
- {
- modelExists = true;
- break;
- }
- else if (inputEquals(aNode, XSDConstants.ALL_ELEMENT_TAG, false))
- {
- modelExists = true;
- break;
- }
- }
- if (!modelExists)
- {
- return null;
- }
-
- Element derivedByNode = (Element)nl.item(j);
- return derivedByNode;
- }
-
- /**
- *
- */
- public void changeContentModel(Element complexTypeElement, String contentModel, Element sequenceChoiceOrAllElement)
- {
- Document doc = complexTypeElement.getOwnerDocument();
-
- String prefix = complexTypeElement.getPrefix();
- prefix = prefix == null ? "" : prefix + ":";
-
- Element contentModelElement = getContentModelFromParent(complexTypeElement);
-
- if (contentModelElement.getLocalName().equals(contentModel))
- {
- return; // it's already the content model
- }
- Element newNode;
- newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + contentModel);
-
- if (contentModelElement.hasChildNodes())
- {
- NodeList nodes = contentModelElement.getChildNodes();
- // use clones so we don't have a refresh problem
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node node = nodes.item(i);
- if (node instanceof Element)
- {
- if (node.getLocalName().equals(XSDConstants.ANNOTATION_ELEMENT_TAG))
- {
- if (!(XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.SEQUENCE_ELEMENT_TAG, false) ||
- XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.CHOICE_ELEMENT_TAG, false) ||
- XSDDOMHelper.inputEquals(contentModelElement, XSDConstants.ALL_ELEMENT_TAG, false)))
- {
- newNode.appendChild(node.cloneNode(true));
- }
- }
- else if (node.getLocalName().equals(XSDConstants.RESTRICTION_ELEMENT_TAG) ||
- node.getLocalName().equals(XSDConstants.EXTENSION_ELEMENT_TAG))
- {
- newNode.appendChild(node.cloneNode(true));
- if (sequenceChoiceOrAllElement != null)
- {
- node.appendChild(sequenceChoiceOrAllElement);
- }
- }
- else
- {
- removeNodeAndWhitespace(node);
- }
- }
- else
- {
- newNode.appendChild(node.cloneNode(true));
- }
- }
- }
- complexTypeElement.replaceChild(newNode, contentModelElement);
- }
-
- public Element cloneElement(Element parent, Element sourceNode)
- {
- Document doc = parent.getOwnerDocument();
- String prefix = parent.getPrefix();
- prefix = prefix == null ? "" : prefix + ":";
-
- Element newNode = doc.createElementNS(XSDDOMHelper.XMLSchemaURI, prefix + sourceNode.getLocalName());
-
- if (sourceNode.hasChildNodes())
- {
- NodeList nodes = sourceNode.getChildNodes();
- // use clones so we don't have a refresh problem
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node node = nodes.item(i);
- newNode.appendChild(node.cloneNode(true));
- }
- }
- return newNode;
-// parent.replaceChild(newNode, sourceNode);
- }
-
-
-
- public static void removeNodeAndWhitespace(Node node)
- {
- Node parentNode = node.getParentNode();
-
- Node nextElement = getNextElementNode(node);
- Node previousElement = getPreviousElementNode(node);
-
- Node nextSibling = node.getNextSibling();
- if (nextSibling instanceof Text)
- {
- parentNode.removeChild(nextSibling);
- }
-
- if (parentNode != null)
- {
- parentNode.removeChild(node);
- }
-
- if (nextElement != null)
- {
- formatChild(nextElement);
- }
-
- if (previousElement != null)
- {
- formatChild(previousElement);
- }
- }
-
- public static void formatChild(Node child)
- {
- if (child instanceof IDOMNode)
- {
- IDOMModel model = ((IDOMNode)child).getModel();
- try
- {
- // tell the model that we are about to make a big model change
- model.aboutToChangeModel();
-
- IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
- formatProcessor.formatNode(child);
- }
- finally
- {
- // tell the model that we are done with the big model change
- model.changedModel();
- }
- }
- }
-
-
- private static Node getNextElementNode(Node node)
- {
- Node next = node.getNextSibling();
-
- while (!(next instanceof Element) && next != null)
- {
- next = next.getNextSibling();
- }
- if (next instanceof Text)
- {
- return null;
- }
- return next;
- }
-
- private static Node getPreviousElementNode(Node node)
- {
- Node previous = node.getPreviousSibling();
-
- while (!(previous instanceof Element) && previous != null)
- {
- previous = previous.getPreviousSibling();
- }
- if (previous instanceof Text)
- {
- return null;
- }
- return previous;
- }
-
-
-
- // issue (cs) what's this method supposed to do?
- // bizzare name
- public static boolean inputEquals(Object input, String tagname, boolean isRef)
- {
- if (input instanceof Element)
- {
- Element element = (Element) input;
- if (element.getLocalName().equals(tagname))
- {
- boolean refPresent = element.hasAttribute("ref");
-
- return refPresent == isRef;
- }
- }
- return false;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java
deleted file mode 100644
index 3c8ca3d1e1..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.xsd.util.XSDSchemaLocationResolver;
-
-public class XSDSchemaLocationResolverAdapterFactory extends AdapterFactoryImpl
-{
- protected XSDSchemaLocationResolverImpl schemaLocator = new XSDSchemaLocationResolverImpl();
-
- public boolean isFactoryForType(Object type)
- {
- return type == XSDSchemaLocationResolver.class;
- }
-
- public Adapter adaptNew(Notifier target, Object type)
- {
- return schemaLocator;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java
deleted file mode 100644
index 71e5f884bd..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.util;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDSchemaLocationResolver;
-import org.eclipse.xsd.util.XSDSchemaLocator;
-
-public class XSDSchemaLocationResolverImpl extends AdapterImpl implements XSDSchemaLocationResolver
-{
- public String resolveSchemaLocation(XSDSchema xsdSchema, String namespaceURI, String schemaLocationURI)
- {
- String baseLocation = xsdSchema.getSchemaLocation();
- String result = URIResolverPlugin.createResolver().resolve(baseLocation, namespaceURI, schemaLocationURI);
- if (result == null) {
- result = namespaceURI;
- }
- if (result == null) {
- result = "";
- }
-
- return result;
- }
-
- public boolean isAdatperForType(Object type)
- {
- return type == XSDSchemaLocator.class;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java
deleted file mode 100644
index accfdc93d6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.xsd.ui.internal.validation;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.validation.internal.ConfigurationManager;
-import org.eclipse.wst.validation.internal.ProjectConfiguration;
-import org.eclipse.wst.validation.internal.ValidationRegistryReader;
-import org.eclipse.wst.validation.internal.ValidatorMetaData;
-import org.eclipse.wst.validation.internal.provisional.ValidationFactory;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidator;
-
-/**
- * This performs the as-you-type validation
- * @author Mark Hutchinson
- *
- */
-public class DelegatingSourceValidatorForXSD extends DelegatingSourceValidator
-{
- final private static String VALIDATOR_CLASS = "org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator";
-
- public DelegatingSourceValidatorForXSD()
- { super();
- }
-
- protected IValidator getDelegateValidator()
- {
- try
- { return ValidationFactory.instance.getValidator(VALIDATOR_CLASS);
- }
- catch (Exception e)
- { //
- }
- return null;
- }
-
- protected boolean isDelegateValidatorEnabled(IFile file) {
- boolean enabled = true;
- try {
- ProjectConfiguration configuration = ConfigurationManager.getManager().getProjectConfiguration(file.getProject());
- ValidatorMetaData vmd = ValidationRegistryReader.getReader().getValidatorMetaData(VALIDATOR_CLASS);
- if (configuration.isBuildEnabled(vmd) || configuration.isManualEnabled(vmd))
- enabled = true;
- else
- enabled = false;
- }
- catch (InvocationTargetException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- return enabled;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java
deleted file mode 100644
index ddd9f796c6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.widgets;
-
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorContextIds;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.TypesHelper;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDSchema;
-
-public class TypeSection
-{
- /**
- * Constructor for TypeSection.
- * @param parent
- */
- public TypeSection(Composite parent)
- {
- }
-
- protected Button simpleType;
- protected Button userSimpleType;
- protected Button userComplexType;
- protected Button noneRadio;
- protected Combo typeList;
- protected Combo derivedByCombo;
- protected boolean showUserComplexType = true;
- protected boolean showUserSimpleType = true;
- protected boolean showNone = false;
- protected boolean showDerivedBy = false;
- protected String derivedByChoices[] = { "restriction", "extension" };
- public final int NONE = 1;
- public final int BUILT_IN = 2;
- public final int SIMPLE = 3;
- public final int COMPLEX = 4;
-
- String sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_INFORMATION");
- String currentObjectUuid = "";
-
- /*
- * @see FlatPageSection#createClient(Composite, WidgetFactory)
- */
- public Composite createClient(Composite parent)
- {
- Composite client = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout(1, true);
- gl.verticalSpacing = 0;
- client.setLayout(gl);
-
- if (showNone)
- {
- noneRadio = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_NONE"));
- WorkbenchHelp.setHelp(noneRadio, XSDEditorContextIds.XSDE_TYPE_HELPER_NONE);
- }
-
- simpleType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_BUILT_IN_SIMPLE_TYPE"));
- WorkbenchHelp.setHelp(simpleType, XSDEditorContextIds.XSDE_TYPE_HELPER_BUILT_IN);
-
- if (showUserSimpleType)
- {
- userSimpleType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_USER_DEFINED_SIMPLE_TYPE"));
- WorkbenchHelp.setHelp(userSimpleType, XSDEditorContextIds.XSDE_TYPE_HELPER_USER_DEFINED_SIMPLE);
- }
-
- if (showUserComplexType)
- {
- userComplexType = ViewUtility.createRadioButton(client, XSDEditorPlugin.getXSDString("_UI_RADIO_USER_DEFINED_COMPLEX_TYPE"));
- WorkbenchHelp.setHelp(userComplexType, XSDEditorContextIds.XSDE_TYPE_HELPER_USER_DEFINED_COMPLEX);
- }
-
- // typeList = utility.createComboBox(client);
- // WorkbenchHelp.setHelp(typeList, XSDEditorContextIds.XSDE_TYPE_HELPER_TYPE);
- // utility.createHeadingLabel(client, "Type",null);
-
- if (showDerivedBy)
- {
- Composite derivedByComposite = ViewUtility.createComposite(client, 2);
- ViewUtility.createLabel(derivedByComposite, XSDEditorPlugin.getXSDString("_UI_LABEL_DERIVED_BY"));
- derivedByCombo = ViewUtility.createComboBox(derivedByComposite);
- populateDerivedByCombo();
- WorkbenchHelp.setHelp(derivedByCombo, XSDEditorContextIds.XSDE_SIMPLE_CONTENT_DERIVED);
- derivedByCombo.setToolTipText(XSDEditorPlugin.getXSDString("_UI_TOOLTIP_DERIVED_BY"));
- }
- // Set the default selection
- if (showNone)
- {
- // noneRadio.setSelection(true);
- // typeList.setEnabled(false);
- }
- else
- {
- simpleType.setSelection(true);
- }
- return client;
- }
-
- public void setIsDerivedBy(boolean derive)
- {
- if (derive)
- {
- sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_BASE_TYPE");
- }
- else
- {
- sectionTitle = XSDEditorPlugin.getXSDString("_UI_LABEL_TYPE_INFORMATION");
- }
- // setHeaderText(sectionTitle);
- }
-
- /**
- * Set to true if called by Complex Type & Simple Type
- */
- public void setShowDerivedBy(boolean derive)
- {
- showDerivedBy = derive;
- }
-
- /**
- * Gets the derivedByField
- * @return Returns a Button
- */
- public Combo getDerivedByCombo()
- {
- return derivedByCombo;
- }
-
- /**
- * Gets the noneRadio.
- * @return Returns a Button
- */
- public Button getNoneRadio()
- {
- return noneRadio;
- }
-
- /**
- * Gets the simpleType.
- * @return Returns a Button
- */
- public Button getSimpleType()
- {
- return simpleType;
- }
-
- /**
- * Gets the userComplexType.
- * @return Returns a Button
- */
- public Button getUserComplexType()
- {
- return userComplexType;
- }
-
- /**
- * Gets the userSimpleType.
- * @return Returns a Button
- */
- public Button getUserSimpleType()
- {
- return userSimpleType;
- }
-
- /**
- * Gets the typeList.
- * @return Returns a CCombo
- */
- public Combo getTypeList()
- {
- return typeList;
- }
-
- /**
- * Populate combo box with built-in simple types
- */
- public void populateBuiltInType(XSDSchema xsdSchema)
- {
- getTypeList().removeAll();
- List items = getBuiltInTypeNamesList(xsdSchema);
- for (int i = 0; i < items.size(); i++)
- {
- getTypeList().add(items.get(i).toString());
- }
- }
-
- public java.util.List getBuiltInTypeNamesList(XSDSchema xsdSchema)
- {
- TypesHelper helper = new TypesHelper(xsdSchema);
- return helper.getBuiltInTypeNamesList();
- }
-
- /**
- * Populate combo box with user defined complex types
- */
- public void populateUserComplexType(XSDSchema xsdSchema, boolean showAnonymous)
- {
- getTypeList().removeAll();
- if (showAnonymous)
- {
- getTypeList().add(XSDEditorPlugin.getXSDString("_UI_ANONYMOUS"));
- }
-
- List items = getUserComplexTypeNamesList(xsdSchema);
- for (int i = 0; i < items.size(); i++)
- {
- getTypeList().add(items.get(i).toString());
- }
- }
-
- public java.util.List getUserComplexTypeNamesList(XSDSchema xsdSchema)
- {
- TypesHelper helper = new TypesHelper(xsdSchema);
- return helper.getUserComplexTypeNamesList();
- }
-
- public void populateUserSimpleType(XSDSchema xsdSchema, boolean showAnonymous)
- {
- getTypeList().removeAll();
- if (showAnonymous)
- {
- getTypeList().add(XSDEditorPlugin.getXSDString("_UI_ANONYMOUS"));
- }
- List items = getUserSimpleTypeNamesList(xsdSchema);
- for (int i = 0; i < items.size(); i++)
- {
- getTypeList().add(items.get(i).toString());
- }
- }
-
- /**
- * Populate combo box with user defined simple types
- */
- public void populateUserSimpleType(XSDSchema xsdSchema)
- {
- getTypeList().removeAll();
- List items = getUserSimpleTypeNamesList(xsdSchema);
- for (int i = 0; i < items.size(); i++)
- {
- getTypeList().add(items.get(i).toString());
- }
- }
-
- public java.util.List getUserSimpleTypeNamesList(XSDSchema xsdSchema)
- {
- TypesHelper helper = new TypesHelper(xsdSchema);
- return helper.getUserSimpleTypeNamesList();
- }
-
- public String getPrefix(String ns, XSDSchema xsdSchema)
- {
- TypesHelper helper = new TypesHelper(xsdSchema);
- String key = helper.getPrefix(ns, true);
- return key;
- }
-
- /**
- * Populate combo box with derived by choices
- */
- protected void populateDerivedByCombo()
- {
- for (int i = 0; i < derivedByChoices.length; i++)
- {
- getDerivedByCombo().add(derivedByChoices[i]);
- }
- }
-
- /**
- * Gets the showUserComplexType.
- * @return Returns a boolean
- */
- public boolean getShowUserComplexType()
- {
- return showUserComplexType;
- }
-
- /**
- * Gets the showUserSimpleType.
- * @return Returns a boolean
- */
- public boolean getShowUserSimpleType()
- {
- return showUserSimpleType;
- }
-
- /**
- * Gets the showNone.
- * @return Returns a boolean
- */
- public boolean getShowNone()
- {
- return showNone;
- }
-
- /**
- * Sets the showUserComplexType.
- * @param showUserComplexType The showUserComplexType to set
- */
- public void setShowUserComplexType(boolean showUserComplexType)
- {
- this.showUserComplexType = showUserComplexType;
- }
-
- /**
- * Sets the showUserSimpleType.
- * @param showUserSimpleType The showUserSimpleType to set
- */
- public void setShowUserSimpleType(boolean showUserSimpleType)
- {
- this.showUserSimpleType = showUserSimpleType;
- }
-
- /**
- * Sets the showNone
- * @param showUserSimpleType The showNone to set
- */
- public void setShowNone(boolean showNone)
- {
- this.showNone = showNone;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java
deleted file mode 100644
index 810b1a5c04..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.wizards;
-
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-
-class RegexNode
-{
- private String contents;
- private int min;
- private int max;
- private int repeat;
- private int quantifier;
- private boolean hasParens;
- private boolean autoEscapeStatus;
-
-
- /* Quantifiers. */
- public static final int SINGLE = 0;
- public static final int STAR = 1;
- public static final int PLUS = 2;
- public static final int OPTIONAL = 3;
- public static final int REPEAT = 4;
- public static final int RANGE = 5;
-
- /* Regex quantifiers. First column is the on-screen textual representation, second column is the
- on-screen regex representation. The two are concatenated together to form the on-screen
- representation.
- Indexing of this array must correspond to the values of the quantifier constants above.
- */
- private static final String[][] regexQuantifiers =
- {
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_SINGLE"), "" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_STAR"), "*" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_PLUS"), "+" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_OPTIONAL"), "?" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_REPEAT"), "" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_QUANTIFIER_RANGE"), "" },
- };
-
-
- /* Regex tokens. First column is the on-screen representation, second column is the regex representation.
- More tokens can be added, but it is assumed that "Current Selection" is the last element in the array.
- If this is not the case, then the value of the SELECTION constant below will need to be changed
- accordingly.
- Also note that because these are java Strings, backslashes must be escaped (this is only relevant to the
- second column of the array).
- */
- private static final String[][] regexTerms =
- {
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_ANY_CHAR"), "." },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_ALPHANUMERIC_CHAR"), "\\w" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_WHITESPACE"), "\\s" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_DIGIT"), "\\d" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_UPPER"), "[A-Z]" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_LOWER"), "[a-z]" },
- { XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TERM_SELECTION"), "" },
- };
-
- /* Token enumerated constants. */
-
- // SELECTION must correspond to the index in regexTerms of "Current Selection". This is assumed to be
- // the last element.
- public static final int SELECTION = regexTerms.length - 1;
-
- public static final int EMPTY = -1;
-
- /*
- The metacharacters recognized by XML Schema.
- Note that the double backslash ("\\") actually represents an escaped single backslash character ("\").
- */
- private static final String metacharacters = ".\\?*+{}()[]";
-
-
- public static String getRegexTermText(int i)
- {
- if (i == SELECTION)
- {
- return regexTerms[i][0];
- }
- else
- {
- return regexTerms[i][0] + " ( " + regexTerms[i][1] + " )";
- }
- }
-
- public static String getRegexTermValue(int i)
- {
- if (i == SELECTION) // shouldn't happen
- {
- return "";
- }
- else
- {
- return regexTerms[i][1];
- }
- }
-
- public static int getNumRegexTerms()
- {
- return regexTerms.length;
- }
-
- public static String getQuantifierText(int i)
- {
- String result = regexQuantifiers[i][0];
-
- if (!regexQuantifiers[i][1].equals(""))
- {
- result += " ( ";
- result += regexQuantifiers[i][1];
- result += " )";
- }
-
- return result;
- }
-
- public RegexNode()
- {
- this.contents = "";
- this.quantifier = SINGLE;
- this.min = EMPTY;
- this.max = EMPTY;
- this.repeat = EMPTY;
- this.hasParens = false;
-
- }
-
-
- public String getContents()
- {
- return contents;
- }
-
- public void setContents(String contents)
- {
- this.contents = contents;
- }
-
-
- public int getQuantifier()
- {
- return quantifier;
- }
-
- public void setQuantifier(int quantifier)
- {
- this.quantifier = quantifier;
- }
-
-
- public int getMin()
- {
- return min;
- }
-
- public void setMin(int min)
- {
- this.min = min;
- }
-
- /**
- * Sets this.min to the integer representation of min iff min is a valid value (i.e. greater than 0).
- * Sets this.min to EMPTY if it is not.
- *
- * @param min The new min value
- * @returns Whether min was a valid value
- */
- public boolean setMin(String min)
- {
- this.min = convertToInt(min);
-
- // min > max is an invalid case, unless max is EMPTY (since EMPTY == -1).
- if ( (this.max != EMPTY) && (this.min > this.max) )
- {
- return false;
- }
-
- return (this.min >= 0);
- }
-
-
- public int getMax()
- {
- return max;
- }
-
- public void setMax(int max)
- {
- this.max = max;
- }
-
- /**
- * Sets this.max to the integer representation of max iff max is a valid value (i.e. greater than 0).
- * Sets this.max to EMPTY if it is not.
- *
- * @param max The new max value
- * @returns Whether max was a valid value, or (whether max == the empty string && min has a valid value)
- */
- public boolean setMax(String max)
- {
- this.max = convertToInt(max);
-
- // The empty string is a valid max value iff min has a valid value.
- // This is due to the fact that {n,} means "at least n times" in regex parlance.
- if (max.equals("") && this.min != EMPTY)
- {
- return true;
- }
-
- else if (this.max < this.min)
- {
- return false;
- }
-
- else
- {
- return (this.max >= 0);
- }
- }
-
-
-
- public int getRepeat()
- {
- return repeat;
- }
-
- public void setRepeat(int repeat)
- {
- this.repeat = repeat;
- }
-
- /**
- * Sets this.repeat to the integer representation of repeat iff repeat is a valid value (i.e. greater than 0).
- * Sets this.repeat to EMPTY if it is not.
- *
- * @param repeat The new repeat value
- * @returns Whether repeat was a valid value
- */
- public boolean setRepeat(String repeat)
- {
- this.repeat = convertToInt(repeat);
- return (this.repeat >= 0);
- }
-
-
-
- /**
- * Returns the integer representation of s. If s is less than zero, or if s is not an int
- * (i.e. if Integer.parseInt would throw a NumberFormatException), then returns EMPTY.
- *
- * @param s The String to convert.
- * @returns The integer representation of s.
- */
- private int convertToInt(String s)
- {
- int result;
- try
- {
- result = Integer.parseInt(s);
- if (result < 0)
- {
- result = EMPTY;
- }
- }
- catch (NumberFormatException e)
- {
- result = EMPTY;
- }
-
- return result;
- }
-
-
- public boolean getHasParens()
- {
- return hasParens;
- }
-
- public void setHasParens(boolean status)
- {
- this.hasParens = status;
- }
-
- public boolean getAutoEscapeStatus()
- {
- return autoEscapeStatus;
- }
-
- public void setAutoEscapeStatus(boolean status)
- {
- this.autoEscapeStatus = status;
- }
-
- /**
- * Returns an escaped version of s. In other words, each occurrence of a metacharacter ( .\?*+{}()[] )
- * is replaced by that character preceded by a backslash.
- *
- * @param s The String to escape.
- * @returns An escaped version of s.
- */
- private String addEscapeCharacters(String s)
- {
- StringBuffer result = new StringBuffer("");
-
- for (int i = 0; i < s.length(); i++)
- {
- char currentChar = s.charAt(i);
-
- if (isMetachar(currentChar))
- {
- result.append("\\"); // Note that this is an escaped backslash, not a double backslash.
- }
- result.append(currentChar);
-
- }
-
- return result.toString();
- }
-
- /**
- * Checks whether c is a metacharacter as defined in the static variable metacharacters.
- *
- * @param c The character to check.
- * @returns Whether c is a metacharacter.
- */
- private boolean isMetachar(char c)
- {
- return metacharacters.indexOf(c) != -1;
- }
-
-
- public boolean hasValidMin()
- {
- return (min != EMPTY);
- }
-
- public boolean hasValidMax()
- {
- return(max != EMPTY);
- }
-
- public boolean hasValidRepeat()
- {
- return(repeat != EMPTY);
- }
-
- public String toString()
- {
- String result = "";
-
- if (hasParens)
- {
- result += "(";
- }
-
- if (autoEscapeStatus)
- {
- result += addEscapeCharacters(contents);
- }
- else
- {
- result += contents;
- }
-
-
- if (hasParens)
- {
- result += ")";
- }
-
- switch (quantifier)
- {
- case STAR:
- result += "*";
- break;
-
- case PLUS:
- result += "+";
- break;
-
- case OPTIONAL:
- result += "?";
- break;
-
- case REPEAT:
- result += "{" + repeat + "}";
- break;
-
- case RANGE:
- result += "{" + min + ",";
- if (max == EMPTY)
- {
- result += "";
- }
- else
- {
- result += max;
- }
- result += "}";
- break;
-
- // SINGLE is a fall through
-
- }
- return result;
-
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java
deleted file mode 100644
index c5234ec43d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.wizards;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDPatternFacet;
-import org.eclipse.xsd.impl.XSDFactoryImpl;
-
-
-public class RegexWizard extends Wizard
-{
- private RegexCompositionPage compositionPage;
- private RegexTestingPage testingPage;
-
- /* The original, unchanged pattern. */
- private XSDPatternFacet originalPattern;
-
- /* A copy of the original pattern that is passed into the wizard. */
- private XSDPatternFacet modifiedPattern;
-
- String pattern;
-
- public RegexWizard(String expr)
- {
- super();
- setWindowTitle(XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_TITLE"));
- setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/regx_wiz.gif"));
-
- XSDFactoryImpl factory = new XSDFactoryImpl();
- modifiedPattern = factory.createXSDPatternFacet();
- modifiedPattern.setLexicalValue(expr);
-
- originalPattern = factory.createXSDPatternFacet();
- originalPattern.setLexicalValue(expr);
-
- compositionPage = new RegexCompositionPage(modifiedPattern);
- addPage(compositionPage);
-
- testingPage = new RegexTestingPage();
- addPage(testingPage);
- }
-
- public String getPattern()
- {
- return pattern;
- }
-
- public boolean canFinish()
- {
- return (compositionPage.getValue().length() > 0);
- }
-
- public boolean performFinish()
- {
- pattern = modifiedPattern.getLexicalValue();
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java
deleted file mode 100644
index 84e467e874..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.wizards;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-
-
-public class XSDLocationChoicePage extends WizardPage
-{
- protected Button radioButton1;
- protected Button radioButton2;
-
- public XSDLocationChoicePage()
- {
- super("XSDLocationChoicePage");
-
- this.setTitle(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_TITLE"));
- this.setDescription(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_DESC"));
- }
-
- public boolean isPageComplete()
- {
- return true;
- }
-
- public void createControl(Composite parent)
- {
- Composite base = new Composite(parent, SWT.NONE);
- base.setLayout(new GridLayout());
-
- ViewUtility.createLabel(base, XSDEditorPlugin.getXSDString("_UI_LABEL_INCLUDE_URL_FILE"));
- Composite radioButtonsGroup = ViewUtility.createComposite(base, 1, true);
-
- radioButton1 = ViewUtility.createRadioButton(radioButtonsGroup,
- XSDEditorPlugin.getXSDString("_UI_RADIO_FILE"));
-
- radioButton2 = ViewUtility.createRadioButton(radioButtonsGroup,
- XSDEditorPlugin.getXSDString("_UI_RADIO_URL"));
-
- radioButton1.setSelection(true);
-
- setControl(base);
- }
-
- // actions on finish
- public boolean performFinish()
- {
- return true;
- }
-
- public boolean isURL()
- {
- return radioButton2.getSelection();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java
deleted file mode 100644
index b31a91568e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.wizards;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-
-public class XSDNewFilePage extends WizardNewFileCreationPage
-{
- public XSDNewFilePage(IStructuredSelection selection)
- {
- super(XSDEditorPlugin.getXSDString("_UI_CREATEXSD"), selection);
- setTitle(XSDEditorPlugin.getXSDString("_UI_NEW_XML_SCHEMA_TITLE"));
- setDescription(XSDEditorPlugin.getXSDString("_UI_CREATE_A_NEW_XML_SCHEMA_DESC"));
- }
-
- public void createControl(Composite parent)
- {
- // inherit default container and name specification widgets
- super.createControl(parent);
-
- this.setFileName(computeDefaultFileName());
-
- setPageComplete(validatePage());
- }
-
- protected boolean validatePage()
- {
- Path newName = new Path(getFileName());
- String fullFileName = getFileName();
- String extension = newName.getFileExtension();
- if (extension == null || !extension.equalsIgnoreCase("xsd"))
- {
- setErrorMessage(XSDEditorPlugin.getXSDString("_ERROR_FILENAME_MUST_END_XSD"));
- return false;
- }
- else
- {
- setErrorMessage(null);
- }
-
- // check for file should be case insensitive
- String sameName = existsFileAnyCase(fullFileName);
- if (sameName != null)
- {
- setErrorMessage(XSDEditorPlugin.getPlugin().getString("_ERROR_FILE_ALREADY_EXISTS", sameName)); //$NON-NLS-1$
- return false;
- }
-
- return super.validatePage();
- }
-
- public String defaultName = "NewXMLSchema"; //$NON-NLS-1$
- public String defaultFileExtension = ".xsd"; //$NON-NLS-1$
- public String[] filterExtensions = { "*.xsd"}; //$NON-NLS-1$
-
- protected String computeDefaultFileName()
- {
- int count = 0;
- String fileName = defaultName + defaultFileExtension;
- IPath containerFullPath = getContainerFullPath();
- if (containerFullPath != null)
- {
- while (true)
- {
- IPath path = containerFullPath.append(fileName);
- if (ResourcesPlugin.getWorkspace().getRoot().exists(path))
- {
- count++;
- fileName = defaultName + count + defaultFileExtension;
- }
- else
- {
- break;
- }
- }
- }
- return fileName;
- }
-
- // returns true if file of specified name exists in any case for selected container
- protected String existsFileAnyCase(String fileName)
- {
- if ( (getContainerFullPath() != null) && (getContainerFullPath().isEmpty() == false)
- && (fileName.compareTo("") != 0))
- {
- //look through all resources at the specified container - compare in upper case
- IResource parent = ResourcesPlugin.getWorkspace().getRoot().findMember(getContainerFullPath());
- if (parent instanceof IContainer)
- {
- IContainer container = (IContainer) parent;
- try
- {
- IResource[] members = container.members();
- String enteredFileUpper = fileName.toUpperCase();
- for (int i=0; i<members.length; i++)
- {
- String resourceUpperName = members[i].getName().toUpperCase();
- if (resourceUpperName.equals(enteredFileUpper))
- {
- return members[i].getName();
- }
- }
- }
- catch (CoreException e)
- {
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java
deleted file mode 100644
index 86e2bfd2e0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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.xsd.ui.internal.wizards;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.viewers.SelectSingleFilePage;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDParser;
-
-
-/**
- * Extend the base wizard to select a file from the project or outside the workbench
- * and add error handling
- */
-public class XSDSelectIncludeFileWizard extends Wizard implements INewWizard
-{
- boolean isInclude;
- XSDSchema mainSchema;
- XSDSchema externalSchema;
-
- XSDLocationChoicePage choicePage;
- XSDSelectSingleFilePage filePage;
- XSDURLPage urlPage;
-
- IFile resultFile;
- String resultURL;
- String namespace = "";
-
- public XSDSelectIncludeFileWizard(XSDSchema mainSchema, boolean isInclude,
- String title, String desc,
- ViewerFilter filter,
- IStructuredSelection selection)
- {
- super();
- setWindowTitle(title);
- setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(XSDEditorPlugin.class, "icons/NewXSD.gif"));
-
- setNeedsProgressMonitor(true);
-
- // Choice Page
- choicePage = new XSDLocationChoicePage();
-
- // Select File Page
- filePage = new XSDSelectSingleFilePage(PlatformUI.getWorkbench(), selection, true);
- filePage.setTitle(title);
- filePage.setDescription(desc);
- filePage.addFilter(filter);
-
- // URL Page
- urlPage = new XSDURLPage();
- urlPage.setTitle(title);
- urlPage.setDescription(XSDEditorPlugin.getXSDString("_UI_FILEDIALOG_SELECT_XML_URL"));
-
- this.mainSchema = mainSchema;
- this.isInclude = isInclude;
- }
-
- public void init(IWorkbench aWorkbench, IStructuredSelection aSelection)
- {
- }
-
- public void addPages()
- {
- addPage(choicePage);
- addPage(filePage);
- addPage(urlPage);
- }
-
- public IWizardPage getNextPage(IWizardPage currentPage)
- {
- WizardPage nextPage = null;
-
- if (currentPage == choicePage)
- {
- if (choicePage.isURL())
- {
- nextPage = urlPage;
- }
- else
- {
- nextPage = filePage;
- }
- }
- return nextPage;
- }
-
- public boolean canFinish()
- {
- if (!choicePage.isURL())
- {
- return filePage.isPageComplete();
- }
- return true;
- }
-
- public boolean performFinish()
- {
- if (choicePage.isURL())
- {
- try
- {
- getContainer().run(false, true, urlPage.getRunnable());
- resultURL = urlPage.getURL();
- }
- catch (Exception e)
- {
- return false;
- }
- return true;
- }
- else
- {
- resultFile = filePage.getFile();
- }
- return true;
- }
-
- /**
- * Get the MOF object that represents the external file
- */
- public XSDSchema getExternalSchema()
- {
- return externalSchema;
- }
-
- public IFile getResultFile()
- {
- return resultFile;
- }
-
- public String getURL()
- {
- return resultURL;
- }
-
- public String getNamespace()
- {
- return namespace;
- }
-
- /**
- * Create a MOF model for the imported file
- */
- protected String doLoadExternalModel(IProgressMonitor monitor, String xsdModelFile, String xsdFileName)
- {
- String errorMessage = null;
- String currentNameSpace = mainSchema.getTargetNamespace();
-
- monitor.beginTask("Loading XML Schema", 100);
- monitor.worked(50);
-
- XSDParser parser = new XSDParser();
- parser.parse(xsdModelFile);
-
- externalSchema = parser.getSchema();
- if (externalSchema != null)
- {
- String extNamespace = externalSchema.getTargetNamespace();
- namespace = extNamespace;
-
- if (externalSchema.getDiagnostics() != null &&
- externalSchema.getDiagnostics().size() > 0)
- {
- errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdFileName);
- }
- else
- {
- if (isInclude)
- {
- // Check the namespace to make sure they are the same as current file
- if (extNamespace != null)
- {
- if (currentNameSpace != null && !extNamespace.equals(currentNameSpace))
- {
- errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_DIFFERENT_NAME_SPACE", xsdFileName);
- }
- }
- }
- else
- {
- // Check the namespace to make sure they are different from the current file
- if (extNamespace != null)
- {
- if (currentNameSpace != null && extNamespace.equals(currentNameSpace))
- {
- errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_SAME_NAME_SPACE", xsdFileName);
- }
- }
- }
- }
- }
- else
- {
- errorMessage = XSDEditorPlugin.getPlugin().getString("_UI_INCORRECT_XML_SCHEMA", xsdFileName);
- }
-
- monitor.subTask("Finish Loading");
- monitor.worked(80);
-
- return errorMessage;
- }
-
-
- /**
- * URL page
- */
- class XSDURLPage extends WizardPage
- {
- Text urlField;
- String saveString;
-
- public XSDURLPage()
- {
- super("URLPage");
- }
-
- public void createControl(Composite parent)
- {
- Composite client = ViewUtility.createComposite(parent,2);
- ViewUtility.setComposite(client);
-
- ViewUtility.createLabel(client, XSDEditorPlugin.getXSDString("_UI_LABEL_URL"));
- ViewUtility.createLabel(client, "");
-
- urlField = ViewUtility.createTextField(client, 50);
- saveString = "http://";
- urlField.setText(saveString);
-
- setControl(client);
- }
-
- public String getURL()
- {
- return urlField.getText();
- }
-
- private boolean openExternalSchema(IProgressMonitor monitor)
- {
- String text = urlField.getText();
-// if (text.equals(saveString))
-// {
-// return false;
-// }
-// saveString = text;
-
- if (text.equals(""))
- {
- setErrorMessage(XSDEditorPlugin.getXSDString("_UI_SPECIFY_URL"));
- return false;
- }
-
- if ( !text.startsWith("http://") )
- {
- setErrorMessage(XSDEditorPlugin.getXSDString("_UI_URL_START_WITH"));
- return false;
- }
-
- setErrorMessage(null);
- String errorMessage = doLoadExternalModel(monitor, text, text);
- if (errorMessage != null)
- {
- setErrorMessage(errorMessage);
- return false;
- }
- else
- {
- return true;
- }
- }
-
- public IRunnableWithProgress getRunnable()
- {
- return new IRunnableWithProgress()
- {
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException
- {
- if (monitor == null)
- {
- monitor= new NullProgressMonitor();
- }
- monitor.beginTask("", 6);
-
- boolean ok = openExternalSchema(monitor);
-
- if (!ok)
- {
- throw new InvocationTargetException(new java.lang.Error());
- }
-
- monitor.done();
- }
- };
- }
- }
-
- /**
- * Select XML Schema File
- */
- class XSDSelectSingleFilePage extends SelectSingleFilePage
- {
- public XSDSelectSingleFilePage(IWorkbench workbench, IStructuredSelection selection, boolean isFileMandatory)
- {
- super(workbench,selection,isFileMandatory);
- }
-
- private boolean openExternalSchema()
- {
- // Get the fully-qualified file name
- IFile iFile = getFile();
- if (iFile == null)
- return false;
-
- setErrorMessage(null);
-
- String xsdModelFile = iFile.getLocation().toOSString();
- String xsdFileName = iFile.getName();
- String errorMessage = doLoadExternalModel(new NullProgressMonitor(), xsdModelFile, xsdFileName);
-
- if (errorMessage != null)
- {
- setErrorMessage(errorMessage);
- return false;
- }
- else
- {
- return true;
- }
- }
-
- public boolean isPageComplete()
- {
- if (choicePage.isURL())
- {
- return true;
- }
-
- if (super.isPageComplete())
- {
- return openExternalSchema();
- }
- return super.isPageComplete();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/AddFieldAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/AddFieldAction.java
deleted file mode 100644
index d41124077a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/AddFieldAction.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.contentoutline.ContentOutline;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.common.commands.BaseCommand;
-
-
-public class AddFieldAction extends BaseSelectionAction
-{
- public static String ID = "AddFieldAction"; //$NON-NLS-1$
-
- public AddFieldAction(IWorkbenchPart part)
- {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_ADD_FIELD);
- }
-
- public void run()
- {
- if (getSelectedObjects().size() > 0)
- {
- Object o = getSelectedObjects().get(0);
- IComplexType type = null;
-
- if (o instanceof IComplexType)
- {
- type = (IComplexType)o;
- }
- else if (o instanceof IField)
- {
- IField field = (IField)o;
- type = field.getContainerType();
- }
- if (type != null)
- {
- Command command = type.getAddNewFieldCommand(""); //$NON-NLS-1$
- if (command != null)
- {
- getCommandStack().execute(command);
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(((BaseCommand)command).getAddedComponent());
- selectAddedComponent(adapter);
- }
- else
- {
- //TODO ... pop up a command not implemented message
- }
- }
- }
- }
-
- protected void doEdit(Object obj, IWorkbenchPart part)
- {
- if (obj instanceof BaseFieldEditPart)
- {
- BaseFieldEditPart editPart = (BaseFieldEditPart)obj;
- editPart.doEditName(!(part instanceof ContentOutline));
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseDirectEditAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseDirectEditAction.java
deleted file mode 100644
index 70141bec15..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseDirectEditAction.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.actions;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.ui.actions.DirectEditAction;
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-
-
-public class BaseDirectEditAction extends DirectEditAction {
- protected ISelectionProvider provider;
-
- /**
- * Same as {@link #DirectEditAction(IWorkbenchPart)}.
- * @param editor the editor
- */
- public BaseDirectEditAction(IEditorPart editor) {
- super((IWorkbenchPart)editor);
- }
-
- /**
- * Constructs a DirectEditAction using the specified part.
- * @param part the workbench part
- */
- public BaseDirectEditAction(IWorkbenchPart part) {
- super(part);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.actions.SelectionAction#getSelection()
- */
- protected ISelection getSelection()
- {
- // always get selection from selection provider first
- if (provider!=null) {
- Object selection = provider.getSelection();
- if (selection instanceof StructuredSelection) {
- Object object = ((StructuredSelection) selection).getFirstElement();
- if (object instanceof XSDBaseAdapter) {
- // We need to return an EditPart as the selection.
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- Object graphicalViewer = editor.getAdapter(GraphicalViewer.class);
- if (graphicalViewer instanceof AbstractEditPartViewer) {
- AbstractEditPartViewer viewer = (AbstractEditPartViewer) graphicalViewer;
- EditPart editPart = (EditPart)viewer.getEditPartRegistry().get(object);
- return new StructuredSelection(editPart);
- }
- }
- }
- }
-
- return super.getSelection();
- }
-
- protected boolean calculateEnabled() {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter) {
- return !((XSDBaseAdapter) selection).isReadOnly();
- }
-
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.ui.actions.SelectionAction#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
- */
- public void setSelectionProvider(ISelectionProvider provider)
- {
- super.setSelectionProvider(provider);
- this.provider = provider;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java
deleted file mode 100644
index d654e323a7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-public class DeleteAction extends BaseSelectionAction
-{
- public final static String ID = "org.eclipse.wst.xsd.ui.internal.editor.DeleteAction"; //$NON-NLS-1$
- public DeleteAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_DELETE);
- setId(ID);
- setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/delete_obj.gif") ); //$NON-NLS-1$
- }
-
- public void run()
- {
- for (Iterator i = ((IStructuredSelection) getSelection()).iterator(); i.hasNext(); )
- {
- Object selection = i.next();
- Command command = null;
- boolean doReselect = false;
- IModel model = null;
- if (selection instanceof IComplexType)
- {
- command = ((IComplexType)selection).getDeleteCommand();
- model = ((IComplexType)selection).getModel();
- doReselect = true;
- }
- else if (selection instanceof IField)
- {
- model = ((IField)selection).getModel();
- if ( ((IField)selection).isGlobal())
- {
- doReselect = true;
- }
- command = ((IField)selection).getDeleteCommand();
- }
- else if (selection instanceof IStructure)
- {
- // Fallback for model groups and attribute groups.
- IStructure structure = (IStructure)selection;
- model = structure.getModel();
- command = structure.getDeleteCommand();
- }
-
- if (command != null)
- {
- command.execute();
- if (model != null && doReselect)
- provider.setSelection(new StructuredSelection(model));
- }
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java
deleted file mode 100644
index 60b4e69618..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.actions;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-
-public class SetInputToGraphView extends BaseSelectionAction
-{
- public static String ID = "SetAsFocus"; //$NON-NLS-1$
- IEditorPart editorPart;
- Object input;
-
- public SetInputToGraphView(IWorkbenchPart part)
- {
- this(part, null);
- }
-
- public SetInputToGraphView(IWorkbenchPart part, Object input)
- {
- super(part);
- this.input = input;
- setId(ID);
- setText(Messages._UI_ACTION_SET_AS_FOCUS);
- if (part instanceof IEditorPart)
- {
- editorPart = (IEditorPart)part;
- }
- }
-
- protected boolean calculateEnabled()
- {
- return true;
- }
-
- public void run()
- {
- Object selection = input;
- if (selection == null)
- {
- selection = ((IStructuredSelection) getSelection()).getFirstElement();
- }
- Object adapter = getWorkbenchPart().getAdapter(GraphicalViewer.class);
-
- if (selection instanceof IADTObject)
- {
- IADTObject obj = (IADTObject) selection;
- if (adapter instanceof DesignViewGraphicalViewer)
- {
- DesignViewGraphicalViewer graphicalViewer = (DesignViewGraphicalViewer) adapter;
- EditPart editPart = graphicalViewer.getInputEditPart();
- if (editPart instanceof RootContentEditPart)
- {
- if (editorPart != null)
- {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getNavigationHistory().markLocation(editorPart);
- }
- graphicalViewer.setInput(obj);
- //((RootContentEditPart) editPart).refresh();
- if (editorPart != null)
- {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getNavigationHistory().markLocation(editorPart);
- }
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/ShowPropertiesViewAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/ShowPropertiesViewAction.java
deleted file mode 100644
index e3d232f072..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/ShowPropertiesViewAction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-
-/**
- * Show the properties view in the current perspective.
- */
-public class ShowPropertiesViewAction extends BaseSelectionAction
-{
- public static final String ID = "org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction"; //$NON-NLS-1$
- public static final String PROPERTIES_VIEW_ID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
-
- protected static ImageDescriptor enabledImage, disabledImage;
-
- public ShowPropertiesViewAction(IWorkbenchPart part)
- {
- super(part);
- setId(ID);
- setText(Messages._UI_ACTION_SHOW_PROPERTIES);
- setToolTipText(getText());
- setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/elcl16/showproperties_obj.gif") ); //$NON-NLS-1$
- setDisabledImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/dlcl16/showproperties_obj.gif") ); //$NON-NLS-1$
- }
-
- protected boolean calculateEnabled()
- {
- return true;
- }
-
- public void run()
- {
- try
- {
- getWorkbenchPart().getSite().getPage().showView(PROPERTIES_VIEW_ID);
- }
- catch (PartInitException pie)
- {
-
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java
deleted file mode 100644
index 75b04323ab..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design;
-
-import org.eclipse.gef.ContextMenuProvider;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ContextMenuParticipant;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager;
-
-
-public class DesignViewContextMenuProvider extends ContextMenuProvider
-{
- IEditorPart editor;
- ISelectionProvider selectionProvider;
-
- /**
- * Constructor for GraphContextMenuProvider.
- *
- * @param selectionProvider
- * @param editor
- */
- public DesignViewContextMenuProvider(IEditorPart editor, EditPartViewer viewer, ISelectionProvider selectionProvider)
- {
- super(viewer);
- this.editor = editor;
- this.selectionProvider = selectionProvider;
- }
-
- /**
- * @see org.eclipse.gef.ui.parts.ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager,
- * org.eclipse.gef.EditPartViewer)
- */
- public void buildContextMenu(IMenuManager menu)
- {
- IMenuManager currentMenu = menu;
-
- EditorModeManager manager = (EditorModeManager)editor.getAdapter(EditorModeManager.class);
- ContextMenuParticipant contextMenuParticipant = manager != null ? manager.getCurrentMode().getContextMenuParticipant() : null;
-
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- ActionRegistry registry = getEditorActionRegistry();
- ISelection selection = selectionProvider.getSelection();
-
- if (selection != null)
- {
- Object selectedObject = ((StructuredSelection) selection).getFirstElement();
-
- // Convert editparts to model objects as selections
- if (selectedObject instanceof EditPart)
- {
- selectedObject = ((EditPart)selectedObject).getModel();
- }
-
- if (selectedObject instanceof IActionProvider)
- {
- IActionProvider actionProvider = (IActionProvider) selectedObject;
-
- String[] actions = actionProvider.getActions(null);
- for (int i = 0; i < actions.length; i++)
- {
- String id = actions[i];
- if (contextMenuParticipant == null || contextMenuParticipant.isApplicable(selectedObject, id))
- {
- if (id.startsWith(BaseSelectionAction.SUBMENU_START_ID))
- {
- String text = id.substring(BaseSelectionAction.SUBMENU_START_ID.length());
- IMenuManager subMenu = new MenuManager(text);
- currentMenu.add(subMenu);
- currentMenu = subMenu;
- }
- else if (id.startsWith(BaseSelectionAction.SUBMENU_END_ID))
- {
- currentMenu = getParentMenu(menu, currentMenu);
- }
- else if (id.equals(BaseSelectionAction.SEPARATOR_ID))
- {
- currentMenu.add(new Separator());
- }
- else
- {
- IAction action = registry.getAction(id);
- if (action != null)
- {
- action.isEnabled();
- currentMenu.add(action);
- }
- }
- }
- }
- menu.add(new Separator());
- menu.add(new Separator("refactoring-slot")); //$NON-NLS-1$
- menu.add(new Separator());
- menu.add(new Separator("search-slot")); //$NON-NLS-1$
- menu.add(new Separator());
- }
- }
- menu.add(new Separator());
- //menu.add(registry.getAction("org.eclipse.wst.xsd.DeleteAction"));
- //menu.add(new Separator());
- //ShowPropertiesViewAction showPropertiesAction = (ShowPropertiesViewAction) registry.getAction(ShowPropertiesViewAction.ACTION_ID);
- //showPropertiesAction.setPage(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage());
- //menu.add(showPropertiesAction);
- }
-
- protected IMenuManager getParentMenu(IMenuManager root, IMenuManager child) {
- IMenuManager parent = null;
-
- IContributionItem[] kids = root.getItems();
- int index = 0;
- while (index < kids.length && parent == null) {
- IContributionItem item = kids[index];
- if (item.equals(child)) {
- parent = root;
- }
- else {
- if (item instanceof IMenuManager) {
- parent = getParentMenu((IMenuManager) item, child);
- }
- }
- index++;
- }
-
- return parent;
- }
-
- protected ActionRegistry getEditorActionRegistry()
- {
- return (ActionRegistry) editor.getAdapter(ActionRegistry.class);
- }
- protected CommandStack commandStack;
-
- protected CommandStack getCommandStack()
- {
- if (commandStack == null)
- commandStack = getViewer().getEditDomain().getCommandStack();
- return commandStack;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/FlatCCombo.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/FlatCCombo.java
deleted file mode 100644
index 5ef6034405..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/FlatCCombo.java
+++ /dev/null
@@ -1,1493 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.adt.design;
-
-/*******************************************************************************
- * Copyright (c) 2000, 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
- *******************************************************************************/
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlAdapter;
-import org.eclipse.swt.accessibility.AccessibleControlEvent;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.accessibility.AccessibleTextAdapter;
-import org.eclipse.swt.accessibility.AccessibleTextEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.TypedListener;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-
-/**
- * The CCombo class represents a selectable user interface object
- * that combines a text field and a list and issues notification
- * when an item is selected from the list.
- * <p>
- * Note that although this class is a subclass of <code>Composite</code>,
- * it does not make sense to add children to it, or set a layout on it.
- * </p>
- * <dl>
- * <dt><b>Styles:</b>
- * <dd>BORDER, READ_ONLY, FLAT</dd>
- * <dt><b>Events:</b>
- * <dd>Selection</dd>
- * </dl>
- */
-public final class FlatCCombo extends Composite {
-
- Text text;
- List list;
- int visibleItemCount = 5;
- Shell popup;
- Label arrow;
- boolean hasFocus;
- Listener listener, filter;
- Color foreground, background;
- Font font;
-
-/**
- * Constructs a new instance of this class given its parent
- * and a style value describing its behavior and appearance.
- * <p>
- * The style value is either one of the style constants defined in
- * class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
- * (that is, using the <code>int</code> "|" operator) two or more
- * of those <code>SWT</code> style constants. The class description
- * lists the style constants that are applicable to the class.
- * Style bits are also inherited from superclasses.
- * </p>
- *
- * @param parent a widget which will be the parent of the new instance (cannot be null)
- * @param style the style of widget to construct
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
- * </ul>
- *
- * @see SWT#BORDER
- * @see SWT#READ_ONLY
- * @see SWT#FLAT
- * @see Widget#getStyle()
- */
-public FlatCCombo (Composite parent, int style) {
- super (parent, style = checkStyle (style));
-
- int textStyle = SWT.SINGLE;
- if ((style & SWT.READ_ONLY) != 0) textStyle |= SWT.READ_ONLY;
- if ((style & SWT.FLAT) != 0) textStyle |= SWT.FLAT;
- text = new Text (this, textStyle);
- int arrowStyle = SWT.ARROW | SWT.DOWN;
- if ((style & SWT.FLAT) != 0) arrowStyle |= SWT.FLAT;
- arrow = new Label(this, SWT.FLAT);
- arrow.setImage(XSDEditorPlugin.getXSDImage("icons/TriangleToolBar.gif")); //$NON-NLS-1$
-
- listener = new Listener () {
- public void handleEvent (Event event) {
- if (popup == event.widget) {
- popupEvent (event);
- return;
- }
- if (text == event.widget) {
- textEvent (event);
- return;
- }
- if (list == event.widget) {
- listEvent (event);
- return;
- }
- if (arrow == event.widget) {
- arrowEvent (event);
- return;
- }
- if (FlatCCombo.this == event.widget) {
- comboEvent (event);
- return;
- }
- if (getShell () == event.widget) {
- handleFocus (SWT.FocusOut);
- }
- }
- };
- filter = new Listener() {
- public void handleEvent(Event event) {
- Shell shell = ((Control)event.widget).getShell ();
- if (shell == FlatCCombo.this.getShell ()) {
- handleFocus (SWT.FocusOut);
- }
- }
- };
-
- int [] comboEvents = {SWT.Dispose, SWT.Move, SWT.Resize};
- for (int i=0; i<comboEvents.length; i++) this.addListener (comboEvents [i], listener);
-
- int [] textEvents = {SWT.KeyDown, SWT.KeyUp, SWT.MenuDetect, SWT.Modify, SWT.MouseDown, SWT.MouseUp, SWT.Traverse, SWT.FocusIn};
- for (int i=0; i<textEvents.length; i++) text.addListener (textEvents [i], listener);
-
- int [] arrowEvents = {SWT.MouseDown, SWT.Selection, SWT.FocusIn};
- for (int i=0; i<arrowEvents.length; i++) arrow.addListener (arrowEvents [i], listener);
-
- createPopup(null, -1);
- initAccessible();
-}
-static int checkStyle (int style) {
- int mask = SWT.BORDER | SWT.READ_ONLY | SWT.FLAT | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
- return style & mask;
-}
-/**
- * Adds the argument to the end of the receiver's list.
- *
- * @param string the new item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #add(String,int)
- */
-public void add (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.add (string);
-}
-/**
- * Adds the argument to the receiver's list at the given
- * zero-relative index.
- * <p>
- * Note: To add an item at the end of the list, use the
- * result of calling <code>getItemCount()</code> as the
- * index or use <code>add(String)</code>.
- * </p>
- *
- * @param string the new item
- * @param index the index for the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #add(String)
- */
-public void add (String string, int index) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.add (string, index);
-}
-/**
- * Adds the listener to the collection of listeners who will
- * be notified when the receiver's text is modified, by sending
- * it one of the messages defined in the <code>ModifyListener</code>
- * interface.
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see ModifyListener
- * @see #removeModifyListener
- */
-public void addModifyListener (ModifyListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener (listener);
- addListener (SWT.Modify, typedListener);
-}
-/**
- * Adds the listener to the collection of listeners who will
- * be notified when the receiver's selection changes, by sending
- * it one of the messages defined in the <code>SelectionListener</code>
- * interface.
- * <p>
- * <code>widgetSelected</code> is called when the combo's list selection changes.
- * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed the combo's text area.
- * </p>
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see SelectionListener
- * @see #removeSelectionListener
- * @see SelectionEvent
- */
-public void addSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener (listener);
- addListener (SWT.Selection,typedListener);
- addListener (SWT.DefaultSelection,typedListener);
-}
-void arrowEvent (Event event) {
- switch (event.type) {
- case SWT.FocusIn: {
- handleFocus (SWT.FocusIn);
- break;
- }
- case SWT.Selection: {
- dropDown (!isDropped ());
- break;
- }
- case SWT.MouseDown: {
- dropDown (!isDropped ());
- break;
- }
- }
-}
-/**
- * Sets the selection in the receiver's text field to an empty
- * selection starting just before the first character. If the
- * text field is editable, this has the effect of placing the
- * i-beam at the start of the text.
- * <p>
- * Note: To clear the selected items in the receiver's list,
- * use <code>deselectAll()</code>.
- * </p>
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #deselectAll
- */
-public void clearSelection () {
- checkWidget ();
- text.clearSelection ();
- list.deselectAll ();
-}
-void comboEvent (Event event) {
- switch (event.type) {
- case SWT.Dispose:
- if (popup != null && !popup.isDisposed ()) {
- list.removeListener (SWT.Dispose, listener);
- popup.dispose ();
- }
- Shell shell = getShell ();
- shell.removeListener (SWT.Deactivate, listener);
- Display display = getDisplay ();
- display.removeFilter (SWT.FocusIn, filter);
- popup = null;
- text = null;
- list = null;
- arrow = null;
- break;
- case SWT.Move:
- dropDown (false);
- break;
- case SWT.Resize:
- internalLayout (false);
- break;
- }
-}
-
-public Point computeSize (int wHint, int hHint, boolean changed) {
- checkWidget ();
- int width = 0, height = 0;
- String[] items = list.getItems ();
- int textWidth = 0;
- GC gc = new GC (text);
- int spacer = gc.stringExtent (" ").x; //$NON-NLS-1$
- for (int i = 0; i < items.length; i++) {
- textWidth = Math.max (gc.stringExtent (items[i]).x, textWidth);
- }
- gc.dispose();
- Point textSize = text.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
- // Point arrowSize = arrow.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
- Point arrowSize = new Point(16, 16);
- Point listSize = list.computeSize (SWT.DEFAULT, SWT.DEFAULT, changed);
- int borderWidth = getBorderWidth ();
-
- height = Math.max (textSize.y, arrowSize.y);
- width = Math.max (textWidth + 2*spacer + arrowSize.x + 2*borderWidth, listSize.x);
- if (wHint != SWT.DEFAULT) width = wHint;
- if (hHint != SWT.DEFAULT) height = hHint;
- return new Point (width + 2*borderWidth, height + 2*borderWidth);
-}
-void createPopup(String[] items, int selectionIndex) {
- // create shell and list
- popup = new Shell (getShell (), SWT.NO_TRIM | SWT.ON_TOP);
- int style = getStyle ();
- int listStyle = SWT.SINGLE | SWT.V_SCROLL;
- if ((style & SWT.FLAT) != 0) listStyle |= SWT.FLAT;
- if ((style & SWT.RIGHT_TO_LEFT) != 0) listStyle |= SWT.RIGHT_TO_LEFT;
- if ((style & SWT.LEFT_TO_RIGHT) != 0) listStyle |= SWT.LEFT_TO_RIGHT;
- list = new List (popup, listStyle);
- if (font != null) list.setFont (font);
- if (foreground != null) list.setForeground (foreground);
- if (background != null) list.setBackground (background);
-
- int [] popupEvents = {SWT.Close, SWT.Paint, SWT.Deactivate};
- for (int i=0; i<popupEvents.length; i++) popup.addListener (popupEvents [i], listener);
- int [] listEvents = {SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.Dispose};
- for (int i=0; i<listEvents.length; i++) list.addListener (listEvents [i], listener);
-
- if (items != null) list.setItems (items);
- if (selectionIndex != -1) list.setSelection (selectionIndex);
-}
-/**
- * Deselects the item at the given zero-relative index in the receiver's
- * list. If the item at the index was already deselected, it remains
- * deselected. Indices that are out of range are ignored.
- *
- * @param index the index of the item to deselect
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void deselect (int index) {
- checkWidget ();
- list.deselect (index);
-}
-/**
- * Deselects all selected items in the receiver's list.
- * <p>
- * Note: To clear the selection in the receiver's text field,
- * use <code>clearSelection()</code>.
- * </p>
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #clearSelection
- */
-public void deselectAll () {
- checkWidget ();
- list.deselectAll ();
-}
-void dropDown (boolean drop) {
- if (drop == isDropped ()) return;
- if (!drop) {
- popup.setVisible (false);
- if (!isDisposed ()&& arrow.isFocusControl()) {
- text.setFocus();
- }
- return;
- }
-
- if (getShell() != popup.getParent ()) {
- String[] items = list.getItems ();
- int selectionIndex = list.getSelectionIndex ();
- list.removeListener (SWT.Dispose, listener);
- popup.dispose();
- popup = null;
- list = null;
- createPopup (items, selectionIndex);
- }
-
- Point size = getSize ();
- int itemCount = list.getItemCount ();
- itemCount = (itemCount == 0) ? visibleItemCount : Math.min(visibleItemCount, itemCount);
- int itemHeight = list.getItemHeight () * itemCount;
- Point listSize = list.computeSize (SWT.DEFAULT, itemHeight, false);
- list.setBounds (1, 1, Math.max (size.x - 2, listSize.x), listSize.y);
-
- int index = list.getSelectionIndex ();
- if (index != -1) list.setTopIndex (index);
- Display display = getDisplay ();
- Rectangle listRect = list.getBounds ();
- Rectangle parentRect = display.map (getParent (), null, getBounds ());
- Point comboSize = getSize ();
- Rectangle displayRect = getMonitor ().getClientArea ();
- int width = Math.max (comboSize.x, listRect.width + 2);
- int height = listRect.height + 2;
- int x = parentRect.x;
- int y = parentRect.y + comboSize.y;
- if (y + height > displayRect.y + displayRect.height) y = parentRect.y - height;
- if (x + width > displayRect.x + displayRect.width) x = displayRect.x + displayRect.width - listRect.width;
- popup.setBounds (x, y, width, height);
- popup.setVisible (true);
- list.setFocus ();
-}
-/*
- * Return the lowercase of the first non-'&' character following
- * an '&' character in the given string. If there are no '&'
- * characters in the given string, return '\0'.
- */
-char _findMnemonic (String string) {
- if (string == null) return '\0';
- int index = 0;
- int length = string.length ();
- do {
- while (index < length && string.charAt (index) != '&') index++;
- if (++index >= length) return '\0';
- if (string.charAt (index) != '&') return Character.toLowerCase (string.charAt (index));
- index++;
- } while (index < length);
- return '\0';
-}
-/*
- * Return the Label immediately preceding the receiver in the z-order,
- * or null if none.
- */
-Label getAssociatedLabel () {
- Control[] siblings = getParent ().getChildren ();
- for (int i = 0; i < siblings.length; i++) {
- if (siblings [i] == this) {
- if (i > 0 && siblings [i-1] instanceof Label) {
- return (Label) siblings [i-1];
- }
- }
- }
- return null;
-}
-public Control [] getChildren () {
- return super.getChildren();
-}
-/**
- * Gets the editable state.
- *
- * @return whether or not the receiver is editable
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public boolean getEditable () {
- checkWidget ();
- return text.getEditable();
-}
-/**
- * Returns the item at the given, zero-relative index in the
- * receiver's list. Throws an exception if the index is out
- * of range.
- *
- * @param index the index of the item to return
- * @return the item at the given index
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public String getItem (int index) {
- checkWidget();
- return list.getItem (index);
-}
-/**
- * Returns the number of items contained in the receiver's list.
- *
- * @return the number of items
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getItemCount () {
- checkWidget ();
- return list.getItemCount ();
-}
-/**
- * Returns the height of the area which would be used to
- * display <em>one</em> of the items in the receiver's list.
- *
- * @return the height of one item
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getItemHeight () {
- checkWidget ();
- return list.getItemHeight ();
-}
-/**
- * Returns an array of <code>String</code>s which are the items
- * in the receiver's list.
- * <p>
- * Note: This is not the actual structure used by the receiver
- * to maintain its list of items, so modifying the array will
- * not affect the receiver.
- * </p>
- *
- * @return the items in the receiver's list
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public String [] getItems () {
- checkWidget ();
- return list.getItems ();
-}
-public Menu getMenu() {
- return text.getMenu();
-}
-/**
- * Returns a <code>Point</code> whose x coordinate is the start
- * of the selection in the receiver's text field, and whose y
- * coordinate is the end of the selection. The returned values
- * are zero-relative. An "empty" selection as indicated by
- * the the x and y coordinates having the same value.
- *
- * @return a point representing the selection start and end
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public Point getSelection () {
- checkWidget ();
- return text.getSelection ();
-}
-/**
- * Returns the zero-relative index of the item which is currently
- * selected in the receiver's list, or -1 if no item is selected.
- *
- * @return the index of the selected item
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getSelectionIndex () {
- checkWidget ();
- return list.getSelectionIndex ();
-}
-public int getStyle () {
- int style = super.getStyle ();
- style &= ~SWT.READ_ONLY;
- if (!text.getEditable()) style |= SWT.READ_ONLY;
- return style;
-}
-/**
- * Returns a string containing a copy of the contents of the
- * receiver's text field.
- *
- * @return the receiver's text
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public String getText () {
- checkWidget ();
- return text.getText ();
-}
-/**
- * Returns the height of the receivers's text field.
- *
- * @return the text height
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getTextHeight () {
- checkWidget ();
- return text.getLineHeight ();
-}
-/**
- * Returns the maximum number of characters that the receiver's
- * text field is capable of holding. If this has not been changed
- * by <code>setTextLimit()</code>, it will be the constant
- * <code>Combo.LIMIT</code>.
- *
- * @return the text limit
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getTextLimit () {
- checkWidget ();
- return text.getTextLimit ();
-}
-/**
- * Gets the number of items that are visible in the drop
- * down portion of the receiver's list.
- *
- * @return the number of items that are visible
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public int getVisibleItemCount () {
- checkWidget ();
- return visibleItemCount;
-}
-void handleFocus (int type) {
- if (isDisposed ()) return;
- switch (type) {
- case SWT.FocusIn: {
- if (hasFocus) return;
- if (getEditable ()) text.selectAll ();
- hasFocus = true;
- Shell shell = getShell ();
- shell.removeListener (SWT.Deactivate, listener);
- shell.addListener (SWT.Deactivate, listener);
- Display display = getDisplay ();
- display.removeFilter (SWT.FocusIn, filter);
- display.addFilter (SWT.FocusIn, filter);
- Event e = new Event ();
- notifyListeners (SWT.FocusIn, e);
- break;
- }
- case SWT.FocusOut: {
- if (!hasFocus) return;
- Control focusControl = getDisplay ().getFocusControl ();
- if (focusControl == arrow || focusControl == list || focusControl == text) return;
- hasFocus = false;
- Shell shell = getShell ();
- shell.removeListener(SWT.Deactivate, listener);
- Display display = getDisplay ();
- display.removeFilter (SWT.FocusIn, filter);
- Event e = new Event ();
- notifyListeners (SWT.FocusOut, e);
- break;
- }
- }
-}
-/**
- * Searches the receiver's list starting at the first item
- * (index 0) until an item is found that is equal to the
- * argument, and returns the index of that item. If no item
- * is found, returns -1.
- *
- * @param string the search item
- * @return the index of the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int indexOf (String string) {
- checkWidget ();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return list.indexOf (string);
-}
-/**
- * Searches the receiver's list starting at the given,
- * zero-relative index until an item is found that is equal
- * to the argument, and returns the index of that item. If
- * no item is found or the starting index is out of range,
- * returns -1.
- *
- * @param string the search item
- * @param start the zero-relative index at which to begin the search
- * @return the index of the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int indexOf (String string, int start) {
- checkWidget ();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return list.indexOf (string, start);
-}
-
-void initAccessible() {
- AccessibleAdapter accessibleAdapter = new AccessibleAdapter () {
- public void getName (AccessibleEvent e) {
- String name = null;
- Label label = getAssociatedLabel ();
- if (label != null) {
- name = stripMnemonic (label.getText());
- }
- e.result = name;
- }
- public void getKeyboardShortcut(AccessibleEvent e) {
- String shortcut = null;
- Label label = getAssociatedLabel ();
- if (label != null) {
- String text = label.getText ();
- if (text != null) {
- char mnemonic = _findMnemonic (text);
- if (mnemonic != '\0') {
- shortcut = "Alt+"+mnemonic; //$NON-NLS-1$
- }
- }
- }
- e.result = shortcut;
- }
- public void getHelp (AccessibleEvent e) {
- e.result = getToolTipText ();
- }
- };
- getAccessible ().addAccessibleListener (accessibleAdapter);
- text.getAccessible ().addAccessibleListener (accessibleAdapter);
- list.getAccessible ().addAccessibleListener (accessibleAdapter);
-
- arrow.getAccessible ().addAccessibleListener (new AccessibleAdapter() {
- public void getName (AccessibleEvent e) {
- e.result = isDropped () ? SWT.getMessage ("SWT_Close") : SWT.getMessage ("SWT_Open"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- public void getKeyboardShortcut (AccessibleEvent e) {
- e.result = "Alt+Down Arrow"; //$NON-NLS-1$
- }
- public void getHelp (AccessibleEvent e) {
- e.result = getToolTipText ();
- }
- });
-
- getAccessible().addAccessibleTextListener (new AccessibleTextAdapter() {
- public void getCaretOffset (AccessibleTextEvent e) {
- e.offset = text.getCaretPosition ();
- }
- public void getSelectionRange(AccessibleTextEvent e) {
- Point sel = text.getSelection();
- e.offset = sel.x;
- e.length = sel.y - sel.x;
- }
- });
-
- getAccessible().addAccessibleControlListener (new AccessibleControlAdapter() {
- public void getChildAtPoint (AccessibleControlEvent e) {
- Point testPoint = toControl (e.x, e.y);
- if (getBounds ().contains (testPoint)) {
- e.childID = ACC.CHILDID_SELF;
- }
- }
-
- public void getLocation (AccessibleControlEvent e) {
- Rectangle location = getBounds ();
- Point pt = toDisplay (location.x, location.y);
- e.x = pt.x;
- e.y = pt.y;
- e.width = location.width;
- e.height = location.height;
- }
-
- public void getChildCount (AccessibleControlEvent e) {
- e.detail = 0;
- }
-
- public void getRole (AccessibleControlEvent e) {
- e.detail = ACC.ROLE_COMBOBOX;
- }
-
- public void getState (AccessibleControlEvent e) {
- e.detail = ACC.STATE_NORMAL;
- }
-
- public void getValue (AccessibleControlEvent e) {
- e.result = getText ();
- }
- });
-
- text.getAccessible ().addAccessibleControlListener (new AccessibleControlAdapter () {
- public void getRole (AccessibleControlEvent e) {
- e.detail = text.getEditable () ? ACC.ROLE_TEXT : ACC.ROLE_LABEL;
- }
- });
-
- arrow.getAccessible ().addAccessibleControlListener (new AccessibleControlAdapter() {
- public void getDefaultAction (AccessibleControlEvent e) {
- e.result = isDropped () ? SWT.getMessage ("SWT_Close") : SWT.getMessage ("SWT_Open"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- });
-}
-boolean isDropped () {
- return popup.getVisible ();
-}
-public boolean isFocusControl () {
- checkWidget();
- if (text.isFocusControl () || arrow.isFocusControl () || list.isFocusControl () || popup.isFocusControl ()) {
- return true;
- }
- return super.isFocusControl ();
-}
-void internalLayout (boolean changed) {
- if (isDropped ()) dropDown (false);
- Rectangle rect = getClientArea ();
- int width = rect.width;
- int height = rect.height;
- // Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed);
- // text.setBounds (0, 0, width - arrowSize.x, height);
- text.setBounds (0, 0, width - 16, height);
- // arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
- arrow.setBounds (width - 16, 0, 16, 16);
-}
-void listEvent (Event event) {
- switch (event.type) {
- case SWT.Dispose:
- if (getShell () != popup.getParent ()) {
- String[] items = list.getItems ();
- int selectionIndex = list.getSelectionIndex ();
- popup = null;
- list = null;
- createPopup (items, selectionIndex);
- }
- break;
- case SWT.FocusIn: {
- handleFocus (SWT.FocusIn);
- break;
- }
- case SWT.MouseUp: {
- if (event.button != 1) return;
- dropDown (false);
- break;
- }
- case SWT.Selection: {
- int index = list.getSelectionIndex ();
- if (index == -1) return;
- text.setText (list.getItem (index));
- text.selectAll ();
- list.setSelection (index);
- Event e = new Event ();
- e.time = event.time;
- e.stateMask = event.stateMask;
- e.doit = event.doit;
- notifyListeners (SWT.Selection, e);
- event.doit = e.doit;
- break;
- }
- case SWT.Traverse: {
- switch (event.detail) {
- case SWT.TRAVERSE_RETURN:
- case SWT.TRAVERSE_ESCAPE:
- case SWT.TRAVERSE_ARROW_PREVIOUS:
- case SWT.TRAVERSE_ARROW_NEXT:
- event.doit = false;
- break;
- }
- Event e = new Event ();
- e.time = event.time;
- e.detail = event.detail;
- e.doit = event.doit;
- e.character = event.character;
- e.keyCode = event.keyCode;
- notifyListeners (SWT.Traverse, e);
- event.doit = e.doit;
- event.detail = e.detail;
- break;
- }
- case SWT.KeyUp: {
- Event e = new Event ();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.KeyUp, e);
- break;
- }
- case SWT.KeyDown: {
- if (event.character == SWT.ESC) {
- // Escape key cancels popup list
- dropDown (false);
- }
- if ((event.stateMask & SWT.ALT) != 0 && (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN)) {
- dropDown (false);
- }
- if (event.character == SWT.CR) {
- // Enter causes default selection
- dropDown (false);
- Event e = new Event ();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.DefaultSelection, e);
- }
- // At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed ()) break;
- Event e = new Event();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners(SWT.KeyDown, e);
- break;
-
- }
- }
-}
-
-void popupEvent(Event event) {
- switch (event.type) {
- case SWT.Paint:
- // draw black rectangle around list
- Rectangle listRect = list.getBounds();
- Color black = getDisplay().getSystemColor(SWT.COLOR_BLACK);
- event.gc.setForeground(black);
- event.gc.drawRectangle(0, 0, listRect.width + 1, listRect.height + 1);
- break;
- case SWT.Close:
- event.doit = false;
- dropDown (false);
- break;
- case SWT.Deactivate:
- dropDown (false);
- break;
- }
-}
-public void redraw () {
- super.redraw();
- text.redraw();
- arrow.redraw();
- if (popup.isVisible()) list.redraw();
-}
-public void redraw (int x, int y, int width, int height, boolean all) {
- super.redraw(x, y, width, height, true);
-}
-
-/**
- * Removes the item from the receiver's list at the given
- * zero-relative index.
- *
- * @param index the index for the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void remove (int index) {
- checkWidget();
- list.remove (index);
-}
-/**
- * Removes the items from the receiver's list which are
- * between the given zero-relative start and end
- * indices (inclusive).
- *
- * @param start the start of the range
- * @param end the end of the range
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void remove (int start, int end) {
- checkWidget();
- list.remove (start, end);
-}
-/**
- * Searches the receiver's list starting at the first item
- * until an item is found that is equal to the argument,
- * and removes that item from the list.
- *
- * @param string the item to remove
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void remove (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- list.remove (string);
-}
-/**
- * Removes all of the items from the receiver's list and clear the
- * contents of receiver's text field.
- * <p>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void removeAll () {
- checkWidget();
- text.setText (""); //$NON-NLS-1$
- list.removeAll ();
-}
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when the receiver's text is modified.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see ModifyListener
- * @see #addModifyListener
- */
-public void removeModifyListener (ModifyListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- removeListener(SWT.Modify, listener);
-}
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when the receiver's selection changes.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see SelectionListener
- * @see #addSelectionListener
- */
-public void removeSelectionListener (SelectionListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- removeListener(SWT.Selection, listener);
- removeListener(SWT.DefaultSelection,listener);
-}
-/**
- * Selects the item at the given zero-relative index in the receiver's
- * list. If the item at the index was already selected, it remains
- * selected. Indices that are out of range are ignored.
- *
- * @param index the index of the item to select
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void select (int index) {
- checkWidget();
- if (index == -1) {
- list.deselectAll ();
- text.setText (""); //$NON-NLS-1$
- return;
- }
- if (0 <= index && index < list.getItemCount()) {
- if (index != getSelectionIndex()) {
- text.setText (list.getItem (index));
- text.selectAll ();
- list.select (index);
- list.showSelection ();
- }
- }
-}
-public void setBackground (Color color) {
- super.setBackground(color);
- background = color;
- if (text != null) text.setBackground(color);
- if (list != null) list.setBackground(color);
- if (arrow != null) arrow.setBackground(color);
-}
-/**
- * Sets the editable state.
- *
- * @param editable the new editable state
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public void setEditable (boolean editable) {
- checkWidget ();
- text.setEditable(editable);
-}
-public void setEnabled (boolean enabled) {
- super.setEnabled(enabled);
- if (popup != null) popup.setVisible (false);
- if (text != null) text.setEnabled(enabled);
- if (arrow != null) arrow.setEnabled(enabled);
-}
-public boolean setFocus () {
- checkWidget();
- return text.setFocus ();
-}
-public void setFont (Font font) {
- super.setFont (font);
- this.font = font;
- text.setFont (font);
- list.setFont (font);
- internalLayout (true);
-}
-public void setForeground (Color color) {
- super.setForeground(color);
- foreground = color;
- if (text != null) text.setForeground(color);
- if (list != null) list.setForeground(color);
- if (arrow != null) arrow.setForeground(color);
-}
-/**
- * Sets the text of the item in the receiver's list at the given
- * zero-relative index to the string argument. This is equivalent
- * to <code>remove</code>'ing the old item at the index, and then
- * <code>add</code>'ing the new item at that index.
- *
- * @param index the index for the item
- * @param string the new text for the item
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setItem (int index, String string) {
- checkWidget();
- list.setItem (index, string);
-}
-/**
- * Sets the receiver's list to be the given array of items.
- *
- * @param items the array of items
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the items array is null</li>
- * <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setItems (String [] items) {
- checkWidget ();
- list.setItems (items);
- if (!text.getEditable ()) text.setText (""); //$NON-NLS-1$
-}
-/**
- * Sets the layout which is associated with the receiver to be
- * the argument which may be null.
- * <p>
- * Note: No Layout can be set on this Control because it already
- * manages the size and position of its children.
- * </p>
- *
- * @param layout the receiver's new layout or null
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setLayout (Layout layout) {
- checkWidget ();
- return;
-}
-public void setMenu(Menu menu) {
- text.setMenu(menu);
-}
-/**
- * Sets the selection in the receiver's text field to the
- * range specified by the argument whose x coordinate is the
- * start of the selection and whose y coordinate is the end
- * of the selection.
- *
- * @param selection a point representing the new selection start and end
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setSelection (Point selection) {
- checkWidget();
- if (selection == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- text.setSelection (selection.x, selection.y);
-}
-
-/**
- * Sets the contents of the receiver's text field to the
- * given string.
- * <p>
- * Note: The text field in a <code>Combo</code> is typically
- * only capable of displaying a single line of text. Thus,
- * setting the text to a string containing line breaks or
- * other special characters will probably cause it to
- * display incorrectly.
- * </p>
- *
- * @param string the new text
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setText (String string) {
- checkWidget();
- if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- int index = list.indexOf (string);
- if (index == -1) {
- list.deselectAll ();
- text.setText (string);
- return;
- }
- text.setText (string);
- text.selectAll ();
- list.setSelection (index);
- list.showSelection ();
-}
-/**
- * Sets the maximum number of characters that the receiver's
- * text field is capable of holding to be the argument.
- *
- * @param limit new text limit
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public void setTextLimit (int limit) {
- checkWidget();
- text.setTextLimit (limit);
-}
-
-public void setToolTipText (String string) {
- checkWidget();
- super.setToolTipText(string);
- arrow.setToolTipText (string);
- text.setToolTipText (string);
-}
-
-public void setVisible (boolean visible) {
- super.setVisible(visible);
- if (!visible) popup.setVisible(false);
-}
-/**
- * Sets the number of items that are visible in the drop
- * down portion of the receiver's list.
- *
- * @param count the new number of items to be visible
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.0
- */
-public void setVisibleItemCount (int count) {
- checkWidget ();
- if (count < 0) return;
- visibleItemCount = count;
-}
-String stripMnemonic (String string) {
- int index = 0;
- int length = string.length ();
- do {
- while ((index < length) && (string.charAt (index) != '&')) index++;
- if (++index >= length) return string;
- if (string.charAt (index) != '&') {
- return string.substring(0, index-1) + string.substring(index, length);
- }
- index++;
- } while (index < length);
- return string;
-}
-void textEvent (Event event) {
- switch (event.type) {
- case SWT.FocusIn: {
- handleFocus (SWT.FocusIn);
- break;
- }
- case SWT.KeyDown: {
- if (event.character == SWT.CR) {
- dropDown (false);
- Event e = new Event ();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.DefaultSelection, e);
- }
- //At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed ()) break;
-
- if (event.keyCode == SWT.ARROW_UP || event.keyCode == SWT.ARROW_DOWN) {
- event.doit = false;
- if ((event.stateMask & SWT.ALT) != 0) {
- boolean dropped = isDropped ();
- text.selectAll ();
- if (!dropped) setFocus ();
- dropDown (!dropped);
- break;
- }
-
- int oldIndex = getSelectionIndex ();
- if (event.keyCode == SWT.ARROW_UP) {
- select (Math.max (oldIndex - 1, 0));
- } else {
- select (Math.min (oldIndex + 1, getItemCount () - 1));
- }
- if (oldIndex != getSelectionIndex ()) {
- Event e = new Event();
- e.time = event.time;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.Selection, e);
- }
- //At this point the widget may have been disposed.
- // If so, do not continue.
- if (isDisposed ()) break;
- }
-
- // Further work : Need to add support for incremental search in
- // pop up list as characters typed in text widget
-
- Event e = new Event ();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.KeyDown, e);
- break;
- }
- case SWT.KeyUp: {
- Event e = new Event ();
- e.time = event.time;
- e.character = event.character;
- e.keyCode = event.keyCode;
- e.stateMask = event.stateMask;
- notifyListeners (SWT.KeyUp, e);
- break;
- }
- case SWT.MenuDetect: {
- Event e = new Event ();
- e.time = event.time;
- notifyListeners (SWT.MenuDetect, e);
- break;
- }
- case SWT.Modify: {
- list.deselectAll ();
- Event e = new Event ();
- e.time = event.time;
- notifyListeners (SWT.Modify, e);
- break;
- }
- case SWT.MouseDown: {
- if (event.button != 1) return;
- if (text.getEditable ()) return;
- boolean dropped = isDropped ();
- text.selectAll ();
- if (!dropped) setFocus ();
- dropDown (!dropped);
- break;
- }
- case SWT.MouseUp: {
- if (event.button != 1) return;
- if (text.getEditable ()) return;
- text.selectAll ();
- break;
- }
- case SWT.Traverse: {
- switch (event.detail) {
- case SWT.TRAVERSE_RETURN:
- case SWT.TRAVERSE_ARROW_PREVIOUS:
- case SWT.TRAVERSE_ARROW_NEXT:
- // The enter causes default selection and
- // the arrow keys are used to manipulate the list contents so
- // do not use them for traversal.
- event.doit = false;
- break;
- }
-
- Event e = new Event ();
- e.time = event.time;
- e.detail = event.detail;
- e.doit = event.doit;
- e.character = event.character;
- e.keyCode = event.keyCode;
- notifyListeners (SWT.Traverse, e);
- event.doit = e.doit;
- event.detail = e.detail;
- break;
- }
- }
-}
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IAnnotationProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IAnnotationProvider.java
deleted file mode 100644
index 226d4357d8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IAnnotationProvider.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design;
-
-public interface IAnnotationProvider
-{
- String getNameAnnotationString();
- String getNameAnnotationToolTipString();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java
deleted file mode 100644
index 68642c5161..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.directedit;
-
-import java.text.MessageFormat;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-
-/*
- * This is a copy of ComboBoxCellEditor.
- * We need to apply and deactivate the combo on a single click (not on a double click like
- * the ComboBoxCellEditor).
- */
-public class ADTComboBoxCellEditor extends CellEditor
-{
-
- /**
- * The list of items to present in the combo box.
- */
- private String[] items;
-
- /**
- * The zero-based index of the selected item.
- */
- int selection;
-
- /**
- * The custom combo box control.
- */
- CCombo comboBox;
-
- /**
- * Used to determine if the value should be applied to the cell.
- */
- private boolean continueApply;
-
- private Object selectedValue;
- //private Object setObject;
- private ComponentReferenceEditManager componentReferenceEditManager;
-
- /**
- * Default ComboBoxCellEditor style
- */
- private static final int defaultStyle = SWT.NONE;
-
-
- /**
- * Creates a new cell editor with a combo containing the given list of choices
- * and parented under the given control. The cell editor value is the
- * zero-based index of the selected item. Initially, the cell editor has no
- * cell validator and the first item in the list is selected.
- *
- * @param parent
- * the parent control
- * @param items
- * the list of strings for the combo box
- */
- public ADTComboBoxCellEditor(Composite parent, String[] items, ComponentReferenceEditManager editManager)
- {
- super(parent, defaultStyle);
- setItems(items);
- componentReferenceEditManager = editManager;
- }
-
- /**
- * Returns the list of choices for the combo box
- *
- * @return the list of choices for the combo box
- */
- public String[] getItems()
- {
- return this.items;
- }
-
- /**
- * Sets the list of choices for the combo box
- *
- * @param items
- * the list of choices for the combo box
- */
- public void setItems(String[] items)
- {
- Assert.isNotNull(items);
- this.items = items;
- populateComboBoxItems();
- }
-
- /*
- * (non-Javadoc) Method declared on CellEditor.
- */
- protected Control createControl(Composite parent)
- {
-
- comboBox = new CCombo(parent, getStyle() | SWT.READ_ONLY);
- comboBox.setFont(parent.getFont());
-
- comboBox.addKeyListener(new KeyAdapter()
- {
- // hook key pressed - see PR 14201
- public void keyPressed(KeyEvent e)
- {
- keyReleaseOccured(e);
- }
- });
-
- comboBox.addSelectionListener(new SelectionAdapter()
- {
- public void widgetDefaultSelected(SelectionEvent event)
- {
- applyEditorValueAndDeactivate();
- }
-
- public void widgetSelected(SelectionEvent event)
- {
- Object newValue = null;
- continueApply = true;
- selection = comboBox.getSelectionIndex();
- String stringSelection = items[selection];
-
- if (stringSelection.equals(Messages._UI_ACTION_BROWSE))
- {
- newValue = invokeDialog(componentReferenceEditManager.getBrowseDialog());
- }
- else if (stringSelection.equals(Messages._UI_ACTION_NEW))
- {
- newValue = invokeDialog(componentReferenceEditManager.getNewDialog());
- }
-
- if (continueApply)
- {
- if (newValue == null)
- {
- int index = comboBox.getSelectionIndex();
- if (index != -1)
- {
- selectedValue = comboBox.getItem(index);
- }
- }
- else
- {
- selectedValue = newValue;
- }
-
- applyEditorValueAndDeactivate();
- }
- else{
- focusLost();
- }
- }
- });
-
- comboBox.addTraverseListener(new TraverseListener()
- {
- public void keyTraversed(TraverseEvent e)
- {
- if (e.detail == SWT.TRAVERSE_ESCAPE || e.detail == SWT.TRAVERSE_RETURN)
- {
- e.doit = false;
- }
- }
- });
-
- comboBox.addFocusListener(new FocusAdapter()
- {
- public void focusLost(FocusEvent e)
- {
- ADTComboBoxCellEditor.this.focusLost();
- }
- });
- return comboBox;
- }
-
- private Object invokeDialog(IComponentDialog dialog)
- {
- Object newValue = null;
-
- if (dialog == null)
- {
- return null;
- }
-
- //dialog.setInitialComponent(setObject);
- if (dialog.createAndOpen() == Window.OK)
- {
- newValue = dialog.getSelectedComponent();
- }
- else
- {
- continueApply = false;
- }
-
- return newValue;
- }
-
- /**
- * The <code>ComboBoxCellEditor</code> implementation of this
- * <code>CellEditor</code> framework method returns the zero-based index of
- * the current selection.
- *
- * @return the zero-based index of the current selection wrapped as an
- * <code>Integer</code>
- */
- protected Object doGetValue()
- {
- return new Integer(selection);
- }
-
- /*
- * (non-Javadoc) Method declared on CellEditor.
- */
- protected void doSetFocus()
- {
- comboBox.setFocus();
- }
-
- /**
- * The <code>ComboBoxCellEditor</code> implementation of this
- * <code>CellEditor</code> framework method sets the minimum width of the
- * cell. The minimum width is 10 characters if <code>comboBox</code> is not
- * <code>null</code> or <code>disposed</code> eles it is 60 pixels to make
- * sure the arrow button and some text is visible. The list of CCombo will be
- * wide enough to show its longest item.
- */
- public LayoutData getLayoutData()
- {
- LayoutData layoutData = super.getLayoutData();
- if ((comboBox == null) || comboBox.isDisposed())
- layoutData.minimumWidth = 60;
- else
- {
- // make the comboBox 10 characters wide
- GC gc = new GC(comboBox);
- layoutData.minimumWidth = (gc.getFontMetrics().getAverageCharWidth() * 10) + 10;
- gc.dispose();
- }
- return layoutData;
- }
-
- /**
- * The <code>ComboBoxCellEditor</code> implementation of this
- * <code>CellEditor</code> framework method accepts a zero-based index of a
- * selection.
- *
- * @param value
- * the zero-based index of the selection wrapped as an
- * <code>Integer</code>
- */
- protected void doSetValue(Object value)
- {
- Assert.isTrue(comboBox != null && (value instanceof Integer));
- selection = ((Integer) value).intValue();
- comboBox.select(selection);
- }
-
- /**
- * Updates the list of choices for the combo box for the current control.
- */
- private void populateComboBoxItems()
- {
- if (comboBox != null && items != null)
- {
- comboBox.removeAll();
- for (int i = 0; i < items.length; i++)
- comboBox.add(items[i], i);
-
- setValueValid(true);
- selection = 0;
- }
- }
-
- /**
- * Applies the currently selected value and deactiavates the cell editor
- */
- void applyEditorValueAndDeactivate()
- {
- // must set the selection before getting value
- selection = comboBox.getSelectionIndex();
- Object newValue = doGetValue();
- markDirty();
- boolean isValid = isCorrect(newValue);
- setValueValid(isValid);
- if (!isValid)
- {
- // try to insert the current value into the error message.
- setErrorMessage(MessageFormat.format(getErrorMessage(), new Object[] { items[selection] }));
- }
- fireApplyEditorValue();
- deactivate();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.CellEditor#focusLost()
- */
- protected void focusLost()
- {
- if (isActivated())
- {
- applyEditorValueAndDeactivate();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.CellEditor#keyReleaseOccured(org.eclipse.swt.events.KeyEvent)
- */
- protected void keyReleaseOccured(KeyEvent keyEvent)
- {
- if (keyEvent.character == '\u001b')
- { // Escape character
- fireCancelEditor();
- }
- else if (keyEvent.character == '\t')
- { // tab key
- applyEditorValueAndDeactivate();
- }
- }
-
- //public void setSetObject(Object object)
- //{
- // setObject = object;
- //}
-
- public Object getSelectedValue()
- {
- return selectedValue;
- }
-
- /*
- * TODO: rmah: This should be moved to WSDLEditorPlugin.java
- */
-// private IEditorPart getActiveEditor()
-// {
-// IWorkbench workbench = XSDEditorPlugin.getDefault().getWorkbench();
-// IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
-// IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
-//
-// return editorPart;
-// }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ComboBoxCellEditorManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ComboBoxCellEditorManager.java
deleted file mode 100644
index c840f2199e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ComboBoxCellEditorManager.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.directedit;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-public abstract class ComboBoxCellEditorManager extends DirectEditManager// implements
- // DirectEditPolicyDelegate
-{
- protected Label label;
-
- public ComboBoxCellEditorManager(GraphicalEditPart source, Label label)
- {
- super(source, ComboBoxCellEditor.class, new InternalCellEditorLocator(label));
- this.label = label;
- }
-
- protected void initCellEditor()
- {
- String initialLabelText = label.getText();
-
- CCombo combo = (CCombo) getCellEditor().getControl();
- combo.setFont(label.getFont());
- combo.setForeground(label.getForegroundColor());
- combo.setBackground(label.getBackgroundColor());
- combo.setVisibleItemCount(20);
-
- /*
- * combo.addKeyListener(new KeyAdapter() { // hook key pressed - see PR
- * 14201 public void keyPressed(KeyEvent keyEvent) { if (keyEvent.character ==
- * 'z') { getCellEditor().applyEditorValue(); } } });
- */
- ICellEditorListener cellEditorListener = new ICellEditorListener()
- {
- public void cancelEditor()
- {
- }
-
- public void applyEditorValue()
- {
- }
-
- public void editorValueChanged(boolean old, boolean newState)
- {
- }
- };
- getCellEditor().addListener(cellEditorListener);
-
- String[] item = combo.getItems();
- for (int i = 0; i < item.length; i++)
- {
- if (item[i].equals(initialLabelText))
- {
- getCellEditor().setValue(new Integer(i));
- break;
- }
- }
- }
-
- // hack... for some reason the ComboBoxCellEditor does't fire an
- // editorValueChanged to set the dirty flag
- // unless we overide this method to return true, the manager is not notified
- // of changes made in the cell editor
- protected boolean isDirty()
- {
- return true;
- }
-
- protected CellEditor createCellEditorOn(Composite composite)
- {
- boolean isLabelTextInList = false;
- List list = computeComboContent();
- for (Iterator i = list.iterator(); i.hasNext();)
- {
- String string = (String) i.next();
- if (string.equals(label.getText()))
- {
- isLabelTextInList = true;
- break;
- }
- }
-
- if (!isLabelTextInList)
- {
- list.add(label.getText());
- }
-
- List sortedList = computeSortedList(list);
- String[] stringArray = new String[sortedList.size()];
- for (int i = 0; i < stringArray.length; i++)
- {
- stringArray[i] = (String) sortedList.get(i);
- }
- return createCellEditor(composite, stringArray);
- }
-
- protected CellEditor createCellEditor(Composite composite, String[] stringArray)
- {
- return new ComboBoxCellEditor(composite, stringArray);
- }
-
- protected List computeSortedList(List list)
- {
- return list;
- }
-
- protected abstract List computeComboContent();
-
- protected abstract void performModify(Object value);
-
- public static class InternalCellEditorLocator implements CellEditorLocator
- {
- protected Label label;
-
- public InternalCellEditorLocator(Label label)
- {
- this.label = label;
- }
-
- public void relocate(CellEditor celleditor)
- {
- CCombo combo = (CCombo) celleditor.getControl();
-
- // TODO: We're pulling a fast one here..... This is assuming we're using a
- // CCombo as our widget
- // Our eventual 'Combo' may not even use CCombo so this will most likely
- // get replaced.
- // int dropDownButtonSizeX = 16;
-
- Rectangle labelParentBounds = label.getBounds().getCopy();
- label.translateToAbsolute(labelParentBounds);
-
- int x = labelParentBounds.x;
- int y = labelParentBounds.y;
- int widthK = labelParentBounds.width;
- int height = labelParentBounds.height;
- combo.setBounds(x, y + 1, widthK, height - 2);
- }
- }
-
- // implements DirectEditPolicyDelegate
- //
- public void performEdit(CellEditor cellEditor)
- {
- ADTComboBoxCellEditor comboCellEditor = (ADTComboBoxCellEditor) cellEditor;
- CCombo combo = (CCombo) getCellEditor().getControl();
- int index = combo.getSelectionIndex();
- if (index != -1)
- {
- Object value = combo.getItem(index);
- if (comboCellEditor.getSelectedValue() != null)
- {
- value = comboCellEditor.getSelectedValue();
- }
-
- performModify(value);
- }
- else
- {
- String typedValue = combo.getText();
- if (combo.indexOf(typedValue) != -1)
- {
- performModify(typedValue);
- }
- else
- {
- String closeMatch = getCloseMatch(typedValue, combo.getItems());
- if (closeMatch != null)
- {
- performModify(closeMatch);
- }
- else
- {
- Display.getCurrent().beep();
- }
- }
- }
- }
-
- protected String getCloseMatch(String value, String[] items)
- {
- int matchIndex = -1;
-
- for (int i = 0; i < items.length; i++)
- {
- String item = items[i];
- String a = getLocalName(value);
- String b = getLocalName(item);
- if (a.equalsIgnoreCase(b))
- {
- matchIndex = i;
- break;
- }
- }
- return matchIndex != -1 ? items[matchIndex] : null;
- }
-
- protected String getLocalName(String string)
- {
- int index = string.indexOf(":"); //$NON-NLS-1$
- return (index != -1) ? string.substring(index + 1) : string;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ElementReferenceDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ElementReferenceDirectEditManager.java
deleted file mode 100644
index f8c775a19f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ElementReferenceDirectEditManager.java
+++ /dev/null
@@ -1,179 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.adt.design.directedit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDElementReferenceEditManager;
-
-public class ElementReferenceDirectEditManager extends ComboBoxCellEditorManager
-{
- protected AbstractGraphicalEditPart editPart;
- protected IField setObject;
-
- public ElementReferenceDirectEditManager(IField parameter, AbstractGraphicalEditPart source, Label label)
- {
- super(source, label);
- editPart = source;
- setObject = parameter;
- }
-
- protected CellEditor createCellEditorOn(Composite composite)
- {
- return super.createCellEditorOn(composite);
- }
-
- protected List computeComboContent()
- {
- List list = new ArrayList();
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null)
- {
- list.add(Messages._UI_ACTION_BROWSE);
- list.add(Messages._UI_ACTION_NEW);
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- list.add(componentSpecification.getName());
- }
- }
- ComponentSpecification[] history = editManager.getHistory();
- if (history != null)
- {
- for (int i=0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- list.add(componentSpecification.getName());
- }
- }
- }
- return list;
- }
-
- protected ComponentSpecification getComponentSpecificationForValue(String value)
- {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null)
- {
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- ComponentSpecification[] history = editManager.getHistory();
- if (history != null)
- {
- for (int i=0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- }
- return null;
- }
-
- public void performModify(Object value)
- {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager == null)
- {
- return;
- }
-
- // our crude combo box can only work with 'String' objects
- // if we get a String back we need to do some clever mapping to get the ComponentSpecification
- //
- if (value instanceof String)
- {
- value = getComponentSpecificationForValue((String)value);
- }
- // we assume the selected value is always of the form of a ComponentSpecification
- //
- if (value instanceof ComponentSpecification)
- {
- // we need to perform an asyncExec here since the 'host' editpart may be
- // removed as a side effect of performing the action
- DelayedSetElementReferenceRunnable runnable = new DelayedSetElementReferenceRunnable(editManager, setObject, (ComponentSpecification)value);
- //runnable.run();
- Display.getCurrent().asyncExec(runnable);
- }
- }
-
- protected List computeSortedList(List list)
- {
- // return TypesHelper.sortList(list);
- return list;
- }
-
- protected CellEditor createCellEditor(Composite composite, String[] stringArray)
- {
- ADTComboBoxCellEditor cellEditor = new ADTComboBoxCellEditor(composite, stringArray, getComponentReferenceEditManager());
- //((ADTComboBoxCellEditor) cellEditor).setObjectToModify(setObject);
- return cellEditor;
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager()
- {
- ComponentReferenceEditManager result = null;
- IEditorPart editor = getActiveEditor();
- if (editor != null)
- {
- result = (ComponentReferenceEditManager)editor.getAdapter(XSDElementReferenceEditManager.class);
- }
- return result;
- }
-
- private IEditorPart getActiveEditor()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- return editorPart;
- }
-
- protected static class DelayedSetElementReferenceRunnable implements Runnable
- {
- protected ComponentReferenceEditManager componentReferenceEditManager;
- protected ComponentSpecification newValue;
- protected IField field;
-
- public DelayedSetElementReferenceRunnable(ComponentReferenceEditManager componentReferenceEditManager,
- IField setObject, ComponentSpecification selectedValue)
- {
- this.componentReferenceEditManager = componentReferenceEditManager;
- newValue = selectedValue;
- field = setObject;
- }
-
- public void run()
- {
- componentReferenceEditManager.modifyComponentReference(field, newValue);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelCellEditorLocator.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelCellEditorLocator.java
deleted file mode 100644
index 0b34f8e404..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelCellEditorLocator.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.directedit;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseFieldEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.INamedEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFieldFigure;
-
-public class LabelCellEditorLocator implements CellEditorLocator
-{
- protected INamedEditPart namedEditPart;
- protected Point cursorLocation;
-
- public LabelCellEditorLocator(INamedEditPart namedEditPart, Point cursorLocation)
- {
- this.namedEditPart = namedEditPart;
- this.cursorLocation = cursorLocation;
- }
-
- public void relocate(CellEditor celleditor)
- {
- Text text = (Text) celleditor.getControl();
-
- Label label = namedEditPart.getNameLabelFigure();
- if (text.getBounds().x <= 0)
- {
- int widthToRemove = 0;
- // HACK
- if (namedEditPart instanceof BaseFieldEditPart)
- {
- BaseFieldEditPart field = (BaseFieldEditPart)namedEditPart;
- IFieldFigure fieldFigure = field.getFieldFigure();
- widthToRemove = fieldFigure.getTypeLabel().getBounds().width;
- //TODO: !! perhaps the IFieldFigure should just have a method to compute this?
- //Label typeAnnotationLabel = ((FieldFigure) field.getFigure()).getTypeAnnotationLabel();
- //Label nameAnnotationLabel = ((FieldFigure) field.getFigure()).getNameAnnotationLabel();
- //widthToRemove = typeLabel.getBounds().width + typeAnnotationLabel.getBounds().width + nameAnnotationLabel.getBounds().width;
- }
-
- Rectangle boundingRect = label.getTextBounds();
-
- // Reduce the width by the amount we shifted along the x-axis
- int delta = Math.abs(boundingRect.x - label.getParent().getBounds().x);
-
- label.getParent().translateToAbsolute(boundingRect);
- org.eclipse.swt.graphics.Rectangle trim = text.computeTrim(0, 0, 0, 0);
- boundingRect.translate(trim.x, trim.y);
- boundingRect.height = boundingRect.height - trim.y;
-
- boundingRect.width = label.getParent().getBounds().width - delta - widthToRemove;
- text.setBounds(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height);
-
- // Translate point
- if (cursorLocation != null) {
- Point translatedPoint = new Point(cursorLocation.x - boundingRect.x, cursorLocation.y - boundingRect.y);
-
- // Calculate text offset corresponding to the translated point
- text.setSelection(0, 0);
- int xCaret = text.getCaretLocation().x;
- int offset = text.getCaretPosition();
- while (xCaret < translatedPoint.x)
- {
- text.setSelection(offset + 1, offset + 1);
- xCaret = text.getCaretLocation().x;
- int newOffset = text.getCaretPosition();
- if (newOffset == offset)
- {
- break;
- }
- offset++;
- }
- text.setSelection(offset, offset);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java
deleted file mode 100644
index 317a5ba0e7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.directedit;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.CellEditorActionHandler;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.INamedEditPart;
-
-public class LabelEditManager extends DirectEditManager {
-
- private IActionBars actionBars;
- private CellEditorActionHandler actionHandler;
- private IAction copy, cut, paste, undo, redo, find, selectAll, delete;
- private Font scaledFont;
-
- public LabelEditManager(GraphicalEditPart source, CellEditorLocator locator) {
- super(source, null, locator);
- }
-
- /**
- * @see org.eclipse.gef.tools.DirectEditManager#bringDown()
- */
- protected void bringDown() {
- if (actionHandler != null) {
- actionHandler.dispose();
- actionHandler = null;
- }
- if (actionBars != null) {
- restoreSavedActions(actionBars);
- actionBars.updateActionBars();
- actionBars = null;
- }
-
- Font disposeFont = scaledFont;
- scaledFont = null;
- super.bringDown();
- if (disposeFont != null)
- disposeFont.dispose();
- }
-
- public void showFeedback() {
-// super.showFeedback();
- getEditPart().showSourceFeedback(getDirectEditRequest());
- }
-
- protected CellEditor createCellEditorOn(Composite composite) {
- return new TextCellEditor(composite, SWT.SINGLE | SWT.WRAP);
- }
-
- protected void initCellEditor() {
- Text text = (Text)getCellEditor().getControl();
- Label label = ((INamedEditPart) getEditPart()).getNameLabelFigure();
-
- if (label != null) {
- scaledFont = label.getFont();
-
- Color color = label.getBackgroundColor();
- text.setBackground(color);
-
- String initialLabelText = label.getText();
- getCellEditor().setValue(initialLabelText);
- }
- else {
- scaledFont = label.getParent().getFont();
- text.setBackground(label.getParent().getBackgroundColor());
- }
-
- FontData data = scaledFont.getFontData()[0];
- Dimension fontSize = new Dimension(0, data.getHeight());
- label.getParent().translateToAbsolute(fontSize);
- data.setHeight(fontSize.height);
- scaledFont = new Font(null, data);
-
- text.setFont(scaledFont);
-// text.selectAll();
-
- // Hook the cell editor's copy/paste actions to the actionBars so that they can
- // be invoked via keyboard shortcuts.
- actionBars = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .getActiveEditor().getEditorSite().getActionBars();
- saveCurrentActions(actionBars);
- actionHandler = new CellEditorActionHandler(actionBars);
- actionHandler.addCellEditor(getCellEditor());
- actionBars.updateActionBars();
- }
-
- private void restoreSavedActions(IActionBars actionBars){
- actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
- actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
- actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
- actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
- actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
- actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undo);
- actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redo);
- }
-
- private void saveCurrentActions(IActionBars actionBars) {
- copy = actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
- paste = actionBars.getGlobalActionHandler(ActionFactory.PASTE.getId());
- delete = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
- selectAll = actionBars.getGlobalActionHandler(ActionFactory.SELECT_ALL.getId());
- cut = actionBars.getGlobalActionHandler(ActionFactory.CUT.getId());
- find = actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
- undo = actionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
- redo = actionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/TypeReferenceDirectEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/TypeReferenceDirectEditManager.java
deleted file mode 100644
index c781c670df..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/TypeReferenceDirectEditManager.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.directedit;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager;
-
-public class TypeReferenceDirectEditManager extends ComboBoxCellEditorManager
-{
- protected AbstractGraphicalEditPart editPart;
- protected IField setObject;
-
- public TypeReferenceDirectEditManager(IField parameter, AbstractGraphicalEditPart source, Label label)
- {
- super(source, label);
- editPart = source;
- setObject = parameter;
- }
-
- protected CellEditor createCellEditorOn(Composite composite)
- {
- return super.createCellEditorOn(composite);
- }
-
- protected List computeComboContent()
- {
- List list = new ArrayList();
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null)
- {
- list.add(Messages._UI_ACTION_BROWSE);
- list.add(Messages._UI_ACTION_NEW);
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- list.add(componentSpecification.getName());
- }
- }
- ComponentSpecification[] history = editManager.getHistory();
- if (history != null)
- {
- for (int i=0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- list.add(componentSpecification.getName());
- }
- }
- }
- return list;
- }
-
- protected ComponentSpecification getComponentSpecificationForValue(String value)
- {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager != null)
- {
- ComponentSpecification[] quickPicks = editManager.getQuickPicks();
- if (quickPicks != null)
- {
- for (int i=0; i < quickPicks.length; i++)
- {
- ComponentSpecification componentSpecification = quickPicks[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- ComponentSpecification[] history = editManager.getHistory();
- if (history != null)
- {
- for (int i=0; i < history.length; i++)
- {
- ComponentSpecification componentSpecification = history[i];
- if (value.equals(componentSpecification.getName()))
- {
- return componentSpecification;
- }
- }
- }
- }
- return null;
- }
-
- public void performModify(Object value)
- {
- ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
- if (editManager == null)
- {
- return;
- }
-
- // our crude combo box can only work with 'String' objects
- // if we get a String back we need to do some clever mapping to get the ComponentSpecification
- //
- if (value instanceof String)
- {
- value = getComponentSpecificationForValue((String)value);
- }
- // we assume the selected value is always of the form of a ComponentSpecification
- //
- if (value instanceof ComponentSpecification)
- {
- // we need to perform an asyncExec here since the 'host' editpart may be
- // removed as a side effect of performing the action
- DelayedSetTypeRunnable runnable = new DelayedSetTypeRunnable(editManager, setObject, (ComponentSpecification)value);
- //runnable.run();
- Display.getCurrent().asyncExec(runnable);
- }
- }
-
- protected List computeSortedList(List list)
- {
- // return TypesHelper.sortList(list);
- return list;
- }
-
- protected CellEditor createCellEditor(Composite composite, String[] stringArray)
- {
- ADTComboBoxCellEditor cellEditor = new ADTComboBoxCellEditor(composite, stringArray, getComponentReferenceEditManager());
- //((ADTComboBoxCellEditor) cellEditor).setObjectToModify(setObject);
- return cellEditor;
- }
-
- protected ComponentReferenceEditManager getComponentReferenceEditManager()
- {
- ComponentReferenceEditManager result = null;
- IEditorPart editor = getActiveEditor();
- if (editor != null)
- {
- result = (ComponentReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class);
- }
- return result;
- }
-
- private IEditorPart getActiveEditor()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- return editorPart;
- }
-
- protected static class DelayedSetTypeRunnable implements Runnable
- {
- protected ComponentReferenceEditManager componentReferenceEditManager;
- protected ComponentSpecification newValue;
- protected IField field;
-
- public DelayedSetTypeRunnable(ComponentReferenceEditManager componentReferenceEditManager, IField setObject, ComponentSpecification selectedValue)
- {
- this.componentReferenceEditManager = componentReferenceEditManager;
- newValue = selectedValue;
- field = setObject;
- }
-
- public void run()
- {
- componentReferenceEditManager.modifyComponentReference(field, newValue);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTEditPartFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTEditPartFactory.java
deleted file mode 100644
index e89271e4ae..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTEditPartFactory.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Compartment;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.FocusTypeColumn;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-
-public class ADTEditPartFactory implements EditPartFactory
-{
- public EditPart createEditPart(EditPart context, Object model)
- {
- EditPart child = doCreateEditPart(context, model);
- checkChild(child, model);
- return child;
- }
-
- protected EditPart doCreateEditPart(EditPart context, Object model)
- {
- EditPart child = null;
- if (model instanceof Compartment)
- {
- child = new CompartmentEditPart();
- }
- else if (model instanceof AbstractModelCollection)
- {
- child = new ColumnEditPart();
- if (model instanceof FocusTypeColumn)
- {
- ColumnEditPart columnEditPart = (ColumnEditPart)child;
- columnEditPart.setSpacing(60);
- columnEditPart.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
- }
- }
- else if (model instanceof IComplexType)
- {
- child = new ComplexTypeEditPart();
- }
- else if (model instanceof IStructure)
- {
- child = new StructureEditPart();
- }
- else if (model instanceof IField)
- {
- if (context instanceof CompartmentEditPart)
- {
- child = new FieldEditPart();
- }
- else
- {
- child = new TopLevelFieldEditPart();
- }
- }
- else if (model instanceof IModel)
- {
- child = new RootContentEditPart();
- }
- return child;
- }
-
- /**
- * Subclasses can override and not check for null
- *
- * @param child
- * @param model
- */
- protected void checkChild(EditPart child, Object model)
- {
- if (child == null)
- {
- // Thread.dumpStack();
- }
- Assert.isNotNull(child);
- child.setModel(model);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java
deleted file mode 100644
index 85949f3955..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gef.editparts.ScalableRootEditPart;
-import org.eclipse.gef.editparts.ZoomListener;
-import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IActionProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IFigureFactory;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-
-public abstract class BaseEditPart extends AbstractGraphicalEditPart implements IActionProvider, IADTObjectListener, IFeedbackHandler
-{
- protected static final String[] EMPTY_ACTION_ARRAY = {};
- protected boolean isSelected = false;
-
- public IFigureFactory getFigureFactory()
- {
- EditPartFactory factory = getViewer().getEditPartFactory();
- Assert.isTrue(factory instanceof IFigureFactory, "EditPartFactory must be an instanceof of IFigureFactory"); //$NON-NLS-1$
- return (IFigureFactory)factory;
- }
-
- public String[] getActions(Object object)
- {
- Object model = getModel();
- if (model instanceof IActionProvider)
- {
- return ((IActionProvider)model).getActions(object);
- }
- return EMPTY_ACTION_ARRAY;
- }
-
- protected void addActionsToList(List list, IAction[] actions)
- {
- for (int i = 0; i < actions.length; i++)
- {
- list.add(actions[i]);
- }
- }
-
- public void activate()
- {
- super.activate();
- Object model = getModel();
- if (model instanceof IADTObject)
- {
- IADTObject object = (IADTObject)model;
- object.registerListener(this);
- }
-
- if (getZoomManager() != null)
- getZoomManager().addZoomListener(zoomListener);
-
- }
-
- public void deactivate()
- {
- try
- {
- Object model = getModel();
- if (model instanceof IADTObject)
- {
- IADTObject object = (IADTObject)model;
- object.unregisterListener(this);
- }
-
- if (getZoomManager() != null)
- getZoomManager().removeZoomListener(zoomListener);
- }
- finally
- {
- super.deactivate();
- }
- }
-
- public void propertyChanged(Object object, String property)
- {
- refresh();
- }
-
- public void refresh() {
- super.refresh();
-
- // Tell our children to refresh (note, this is NOT the function of
- // refreshChildren(), strangely enough)
- for(Iterator i = getChildren().iterator(); i.hasNext(); )
- {
- Object obj = i.next();
- if (obj instanceof BaseEditPart)
- {
- ((BaseEditPart)obj).refresh();
- }
- else if (obj instanceof AbstractGraphicalEditPart)
- {
- ((AbstractGraphicalEditPart)obj).refresh();
- }
-
- }
- }
-
- public void addFeedback()
- {
- isSelected = true;
- refreshVisuals();
- }
-
- public void removeFeedback()
- {
- isSelected = false;
- refreshVisuals();
- }
-
- public ZoomManager getZoomManager()
- {
- return ((ScalableRootEditPart)getRoot()).getZoomManager();
- }
-
- public Rectangle getZoomedBounds(Rectangle r)
- {
- double factor = getZoomManager().getZoom();
- int x = (int)Math.round(r.x * factor);
- int y = (int)Math.round(r.y * factor);
- int width = (int)Math.round(r.width * factor);
- int height = (int)Math.round(r.height * factor);
-
- return new Rectangle(x, y, width, height);
- }
-
- private ZoomListener zoomListener = new ZoomListener()
- {
- public void zoomChanged(double zoom)
- {
- handleZoomChanged();
- }
- };
-
- protected void handleZoomChanged()
- {
- refreshVisuals();
- }
-
- public IEditorPart getEditorPart()
- {
- IEditorPart editorPart = null;
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null)
- {
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- if (workbenchWindow.getActivePage() != null)
- {
- editorPart = workbenchWindow.getActivePage().getActiveEditor();
- }
- }
- }
-// Assert.isNotNull(editorPart);
- return editorPart;
- }
-
- protected void createEditPolicies()
- {
- installEditPolicy(KeyBoardAccessibilityEditPolicy.KEY, new KeyBoardAccessibilityEditPolicy()
- {
- public EditPart getRelativeEditPart(EditPart editPart, int direction)
- {
- return doGetRelativeEditPart(editPart, direction);
- }
- });
- }
-
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java
deleted file mode 100644
index ef02699e73..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.Iterator;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.IADTUpdateCommand;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-
-/**
- * This class provides some base function to enable drawing connections to a referenced type
- *
- */
-public abstract class BaseTypeConnectingEditPart extends BaseEditPart implements IFeedbackHandler, IConnectionContainer
-{
- private TypeReferenceConnection connectionFigure;
-
- public void activate()
- {
- super.activate();
- }
-
- public void deactivate()
- {
- deactivateConnection();
- super.deactivate();
- }
-
- public void refreshConnections()
- {
- deactivateConnection();
- activateConnection();
- }
-
- protected void activateConnection()
- {
- // If appropriate, create our connectionFigure and add it to the appropriate layer
- if (connectionFigure == null && shouldDrawConnection())
- {
- //System.out.println("activateeConnection()-pre:" + getClass().getName());
- connectionFigure = createConnectionFigure();
- if (connectionFigure != null)
- {
- // Add our editpolicy as a listener on the connection, so it can stay in synch
- //connectionFigure.addPropertyChangeListener((AttributeSelectionFeedbackPolicy) getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE));
- //connectionFigure.addMouseListener(this);
- getLayer(LayerConstants.CONNECTION_LAYER).add(connectionFigure);
- }
- }
- }
-
- protected void deactivateConnection()
- {
- // if we have a connection, remove it
- if (connectionFigure != null)
- {
- getLayer(LayerConstants.CONNECTION_LAYER).remove(connectionFigure);
- // Remove our editpolicy listener(s)
- //connectionFigure.removePropertyChangeListener((AttributeSelectionFeedbackPolicy) getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE));
- //connectionFigure.removeMouseListener(this);
- connectionFigure = null;
- }
- }
-
- protected boolean shouldDrawConnection()
- {
- return true;
- }
-
- public abstract TypeReferenceConnection createConnectionFigure();
-
- public void addFeedback()
- {
- if (connectionFigure != null)
- {
- connectionFigure.setHighlight(true);
- }
- }
-
- public void removeFeedback()
- {
- if (connectionFigure != null)
- {
- connectionFigure.setHighlight(false);
- }
- }
-
- protected class NameUpdateCommandWrapper extends Command implements IADTUpdateCommand
- {
- Command command;
- protected DirectEditRequest request;
-
- public NameUpdateCommandWrapper()
- {
- super(Messages._UI_ACTION_UPDATE_NAME);
- }
-
- public void setRequest(DirectEditRequest request)
- {
- this.request = request;
- }
-
- public void execute()
- {
- IType iType = (IType)getModel();
- Object newValue = request.getCellEditor().getValue();
- if (newValue instanceof String)
- {
- command = iType.getUpdateNameCommand((String)newValue);
- }
- if (command != null)
- command.execute();
- }
- }
-
- public boolean hitTest(IFigure target, Point location)
- {
- Rectangle b = target.getBounds().getCopy();
- target.translateToAbsolute(b);
- return b.contains(location);
- }
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- EditPart result = null;
- if (direction == PositionConstants.WEST)
- {
- result = getSourceConnectionEditPart();
- }
- return result;
- }
-
-
- private EditPart getSourceConnectionEditPart()
- {
- // find the first connection that targets this editPart
- // navigate backward along the connection (to the left) to find the sourc edit part
- EditPart result = null;
- for (Iterator i = getLayer(LayerConstants.CONNECTION_LAYER).getChildren().iterator(); i.hasNext(); )
- {
- Figure figure = (Figure)i.next();
- if (figure instanceof TypeReferenceConnection)
- {
- TypeReferenceConnection typeReferenceConnection = (TypeReferenceConnection)figure;
- ConnectionAnchor targetAnchor = typeReferenceConnection.getTargetAnchor();
- if (targetAnchor.getOwner() == getFigure())
- {
- ConnectionAnchor sourceAnchor = typeReferenceConnection.getSourceAnchor();
- IFigure sourceFigure = sourceAnchor.getOwner();
- EditPart part = null;
- while (part == null && sourceFigure != null)
- {
- part = (EditPart)getViewer().getVisualPartMap().get(sourceFigure);
- sourceFigure = sourceFigure.getParent();
- }
- result = part;
- break;
- }
- }
- }
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BoxEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BoxEditPart.java
deleted file mode 100644
index 89a85deaae..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BoxEditPart.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.List;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Compartment;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.SimpleDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.outline.ITreeElement;
-import org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.BoxFigure;
-
-public abstract class BoxEditPart extends BaseTypeConnectingEditPart //IFeedbackHandler
-{
- protected List compartmentList = null;
- protected SimpleDirectEditPolicy simpleDirectEditPolicy = new SimpleDirectEditPolicy();
-
- protected Compartment[] getCompartments()
- {
- return null;
- }
-
- protected IFigure createFigure()
- {
- BoxFigure figure = new BoxFigure();
- LineBorder boxLineBorder = new LineBorder(1);
- figure.setBorder(boxLineBorder);
- ToolbarLayout toolbarLayout = new ToolbarLayout();
- toolbarLayout.setStretchMinorAxis(true);
- figure.setLayoutManager(toolbarLayout);
- // we should organize ITreeElement and integrate it with the facade
- if (getModel() instanceof ITreeElement)
- {
- figure.getNameLabel().setIcon(((ITreeElement)getModel()).getImage());
- }
- return figure;
- }
-
- public IFigure getContentPane()
- {
- return ((BoxFigure)getFigure()).getContentPane();
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, simpleDirectEditPolicy);
- }
-
-
- public void addFeedback()
- {
- BoxFigure boxFigure = (BoxFigure)figure;
- LineBorder boxFigureLineBorder = (LineBorder)boxFigure.getBorder();
- boxFigureLineBorder.setWidth(2);
- boxFigureLineBorder.setColor(ColorConstants.darkBlue);
- boxFigure.getHeadingFigure().setSelected(true);
- figure.repaint();
- super.addFeedback();
- }
-
- public void removeFeedback()
- {
- BoxFigure boxFigure = (BoxFigure)figure;
- LineBorder boxFigureLineBorder = (LineBorder)boxFigure.getBorder();
- boxFigureLineBorder.setWidth(1);
- boxFigureLineBorder.setColor(ColorConstants.black);
- boxFigure.getHeadingFigure().setSelected(false);
- figure.repaint();
- super.removeFeedback();
- }
-
- protected ActionRegistry getEditorActionRegistry(IEditorPart editor)
- {
- return (ActionRegistry) editor.getAdapter(ActionRegistry.class);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ColumnEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ColumnEditPart.java
deleted file mode 100644
index 00333edddb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ColumnEditPart.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.AbstractModelCollection;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.ReferencedTypeColumn;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-
-public class ColumnEditPart extends BaseEditPart
-{
- protected int spacing = 20;
- protected int minorAlignment = -1;
-
- protected IFigure createFigure()
- {
- Figure figure = new Figure();
- ToolbarLayout layout = new ToolbarLayout(false);
- if (minorAlignment != -1)
- {
- layout.setMinorAlignment(minorAlignment);
- }
- layout.setStretchMinorAxis(false);
- layout.setSpacing(spacing);
- figure.setLayoutManager(layout);
- return figure;
- }
-
- public void setSpacing(int spacing)
- {
- this.spacing = spacing;
- if (figure != null)
- {
- ((ToolbarLayout)figure.getLayoutManager()).setSpacing(spacing);
- }
- }
-
- public IComplexType getComplexType()
- {
- return (IComplexType)getModel();
- }
-
- protected void createEditPolicies()
- {
- // TODO Auto-generated method stub
- }
-
- protected List getModelChildren()
- {
- AbstractModelCollection collection = (AbstractModelCollection)getModel();
- return collection.getChildren();
- }
-
- public int getMinorAlignment()
- {
- return minorAlignment;
- }
-
- public void setMinorAlignment(int minorAlignment)
- {
- this.minorAlignment = minorAlignment;
- }
-
- protected void refreshChildren()
- {
- super.refreshChildren();
- if (getModel() instanceof ReferencedTypeColumn)
- {
- if (getParent().getChildren().size() > 0)
- {
- EditPart editPart = (EditPart)getParent().getChildren().get(0);
- refreshConnections(editPart);
- }
- }
- else
- {
- refreshConnections(this);
- }
- }
-
-
- public void refreshConnections(EditPart parent)
- {
- for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
- {
- EditPart editPart = (EditPart)i.next();
- //System.out.println("class " + editPart.getClass().getName());
- if (editPart instanceof BaseTypeConnectingEditPart)
- {
- BaseTypeConnectingEditPart connectingEditPart = (BaseTypeConnectingEditPart)editPart;
- connectingEditPart.refreshConnections();
- }
- refreshConnections(editPart);
- }
- }
-}
-
-
-
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/EditPartNavigationHandlerUtil.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/EditPartNavigationHandlerUtil.java
deleted file mode 100644
index c234b65f5c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/EditPartNavigationHandlerUtil.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-import java.util.List;
-import org.eclipse.gef.EditPart;
-
-
-public class EditPartNavigationHandlerUtil
-{
- public static EditPart getFirstChild(EditPart editPart)
- {
- EditPart result = null;
- if (editPart.getChildren().size() > 0)
- {
- result = (EditPart)editPart.getChildren().get(0);
- }
- return result;
- }
-
- public static EditPart getLastChild(EditPart editPart)
- {
- EditPart result = null;
- int size = editPart.getChildren().size();
- if (size > 0)
- {
- result = (EditPart)editPart.getChildren().get(size - 1);
- }
- return result;
- }
-
- public static EditPart getNextSibling(EditPart editPart)
- {
- EditPart result = null;
- EditPart parent = editPart.getParent();
- if (parent != null)
- {
- List children = parent.getChildren();
- int index = children.indexOf(editPart);
- if (index + 1 < children.size())
- {
- result = (EditPart)children.get(index + 1);
- }
- }
- return result;
- }
-
- public static EditPart getPrevSibling(EditPart editPart)
- {
- EditPart result = null;
- EditPart parent = editPart.getParent();
- if (parent != null)
- {
- List children = parent.getChildren();
- int index = children.indexOf(editPart);
- if (index - 1 >= 0)
- {
- // if this is the first child
- //
- result = (EditPart)children.get(index - 1);
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/FieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/FieldEditPart.java
deleted file mode 100644
index f17dd39853..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/FieldEditPart.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-
-public class FieldEditPart extends BaseFieldEditPart
-{
- public void addNotify()
- {
- super.addNotify();
- getFieldFigure().editPartAttached(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IConnectionContainer.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IConnectionContainer.java
deleted file mode 100644
index eb5086e276..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IConnectionContainer.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.adt.design.editparts;
-
-public interface IConnectionContainer
-{
- public void refreshConnections();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/INamedEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/INamedEditPart.java
deleted file mode 100644
index b186c28124..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/INamedEditPart.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-
-public interface INamedEditPart
-{
- public Label getNameLabelFigure();
-
- public void performDirectEdit(Point cursorLocation);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java
deleted file mode 100644
index f509c7dc70..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.FocusTypeColumn;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.ReferencedTypeColumn;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-import org.eclipse.wst.xsd.ui.internal.design.layouts.ContainerLayout;
-
-public class RootContentEditPart extends AbstractGraphicalEditPart
-{
- List collections = null;
- Figure contentPane;
-
- protected IFigure createFigure()
- {
- Panel panel = new Panel();
- // why do we need to use a container layout? can we just set a
- // margin border and get the same effect?
- ContainerLayout clayout = new ContainerLayout();
- clayout.setBorder(60);
- panel.setLayoutManager(clayout);
-
- contentPane = new Figure();
- panel.add(contentPane);
-
- ToolbarLayout layout = new ToolbarLayout(true);
- layout.setStretchMinorAxis(false);
- layout.setSpacing(100);
- contentPane.setLayoutManager(layout);
- return panel;
- }
-
- public IFigure getContentPane()
- {
- return contentPane;
- }
-
-
- public IComplexType getSelectedComplexType()
- {
- IComplexType result = null;
- IModel model = (IModel)getModel();
- List types = model.getTypes();
- if (types.size() > 0)
- {
- if (types.get(0) instanceof IComplexType)
- result = (IComplexType)types.get(0);
- }
- return result;
- }
-
- protected void createEditPolicies()
- {
- // TODO Auto-generated method stub
- }
-
- protected List getModelChildren()
- {
- collections = new ArrayList();
- if (getModel() != null)
- {
- Object obj = getModel();
- IADTObject focusObject = null;
- if (obj instanceof IStructure)
- {
- if (obj instanceof IGraphElement)
- {
- if (((IGraphElement)obj).isFocusAllowed())
- focusObject = (IStructure)obj;
- }
- }
- else if (obj instanceof IField)
- {
- focusObject = (IField)obj;
- }
- else if (obj instanceof IModel)
- {
- focusObject = (IModel)obj;
- collections.add(focusObject);
- return collections;
- }
- else if (obj instanceof IType)
- {
- if (obj instanceof IGraphElement)
- {
- if (((IGraphElement)obj).isFocusAllowed())
- {
- focusObject = (IType)obj;
- }
- }
- }
- if (focusObject != null)
- {
- collections.add(new FocusTypeColumn(focusObject));
- collections.add(new ReferencedTypeColumn(focusObject));
- }
- }
- return collections;
- }
-
-
- /**
- * @deprecated Don't call this method. Use DesignViewGraphicalViewer.setInput() instead.
- */
- public void setInput(Object component)
- {
- setModel(component);
- refresh();
- }
-
- /**
- * @deprecated Don't call this method. Use DesignViewGraphicalViewer.getInput() instead.
- */
- public Object getInput()
- {
- return getModel();
- }
-
- public void refresh()
- {
- super.refresh();
- /*
- // once we're done refreshing we can assume all of the child editparts
- // now we iteratre thru the list again and tell the children to update
- // their connections
- for (Iterator i = getChildren().iterator(); i.hasNext(); )
- {
- Object obj = i.next();
- if (obj instanceof IConnectionContainer)
- {
- ((IConnectionContainer)obj).refreshConnections();
- }
- }*/
-
- for(Iterator i = getChildren().iterator(); i.hasNext(); )
- {
- Object obj = i.next();
- if (obj instanceof AbstractGraphicalEditPart)
- {
- ((AbstractGraphicalEditPart)obj).refresh();
- }
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java
deleted file mode 100644
index db1f68c0b5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.requests.LocationRequest;
-import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.Compartment;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTDirectEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.KeyBoardAccessibilityEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.figures.IStructureFigure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDSchema;
-
-public class StructureEditPart extends BaseTypeConnectingEditPart implements INamedEditPart
-{
- protected List compartmentList = null;
- protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
-
- /**
- * TODO cs... I'm sure this has something to do with the way we wanted to rework compartment creation
- * I suppose we could have subclasses override this method instead of getModelChildren()
- *
- * @deprecated
- */
- protected Compartment[] getCompartments()
- {
- return null;
- }
-
- protected IFigure createFigure()
- {
- IStructureFigure figure = getFigureFactory().createStructureFigure(getModel());
- return figure;
- }
-
- public IStructureFigure getStructureFigure()
- {
- return (IStructureFigure)getFigure();
- }
-
- public IFigure getContentPane()
- {
- return getStructureFigure().getContentPane();
- }
-
-
- public EditPart doGetRelativeEditPart(EditPart editPart, int direction)
- {
- EditPart result = null;
- if (direction == KeyBoardAccessibilityEditPolicy.IN_TO_FIRST_CHILD)
- {
- for (Iterator i = getChildren().iterator(); i.hasNext();)
- {
- CompartmentEditPart compartment = (CompartmentEditPart)i.next();
- if (compartment.hasContent())
- {
- result = (EditPart)compartment.getChildren().get(0);
- break;
- }
- }
- }
- else
- {
- return super.doGetRelativeEditPart(editPart, direction);
- }
- return result;
- }
-
- protected void createEditPolicies()
- {
- super.createEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ADTSelectionFeedbackEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, adtDirectEditPolicy);
- }
-
- protected IStructure getStructure()
- {
- return (IStructure)getModel();
- }
-
- protected List getModelChildren()
- {
- if (compartmentList == null)
- {
- compartmentList = new ArrayList();
-
- // TODO.. this needs to be moved to the xsd specific version of this class
- compartmentList.add(new Compartment(getStructure(), "attribute")); //$NON-NLS-1$
- compartmentList.add(new Compartment(getStructure(), "element")); //$NON-NLS-1$
- }
- return compartmentList;
- }
-
- protected void refreshChildren()
- {
- super.refreshChildren();
- //getFigure().invalidateTree();
- }
-
- protected void refreshVisuals()
- {
- super.refreshVisuals();
- getStructureFigure().refreshVisuals(getModel());
- }
-
- public void addFeedback()
- {
- getStructureFigure().addSelectionFeedback();
- super.addFeedback();
- }
-
- public void removeFeedback()
- {
- getStructureFigure().removeSelectionFeedback();
- super.removeFeedback();
- }
-
- public Label getNameLabelFigure()
- {
- return getStructureFigure().getNameLabel();
- }
-
- public void performDirectEdit(Point cursorLocation)
- {
-
- }
-
- public void performRequest(Request request)
- {
- if (request.getType() == RequestConstants.REQ_DIRECT_EDIT ||
- request.getType() == RequestConstants.REQ_OPEN)
- {
-
- Object model = getModel();
- if (request instanceof LocationRequest)
- {
- LocationRequest locationRequest = (LocationRequest)request;
- Point p = locationRequest.getLocation();
-// uncomment for direct edit of name (add else)
-// if (hitTest(getNameLabelFigure(), p))
-// {
-// LabelEditManager manager = new LabelEditManager(this, new LabelCellEditorLocator(this, p));
-// NameUpdateCommandWrapper wrapper = new NameUpdateCommandWrapper();
-// adtDirectEditPolicy.setUpdateCommand(wrapper);
-// manager.show();
-// }
-
-
- if (getStructureFigure().hitTestHeader(p))
- {
- // TODO: !!! This should be moved to the adt-xsd package
- //
- if (model instanceof XSDComplexTypeDefinitionAdapter)
- {
- XSDComplexTypeDefinitionAdapter adapter = (XSDComplexTypeDefinitionAdapter)model;
- XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)adapter.getTarget();
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- Object schema = editorPart.getAdapter(XSDSchema.class);
- ActionRegistry registry = getEditorActionRegistry(editorPart);
- if (registry != null)
- {
- if (schema == ct.getSchema())
- {
- IAction action = registry.getAction(SetInputToGraphView.ID);
- action.run();
- }
- else
- {
- IAction action = registry.getAction(OpenInNewEditor.ID);
- action.run();
- }
- }
- }
- }
- }
- }
- }
-
- protected ActionRegistry getEditorActionRegistry(IEditorPart editor)
- {
- return (ActionRegistry) editor.getAdapter(ActionRegistry.class);
- }
-
- protected boolean shouldDrawConnection()
- {
- return false;
- }
-
- public TypeReferenceConnection createConnectionFigure()
- {
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java
deleted file mode 100644
index b0d4c31ab2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionRouter;
-import org.eclipse.draw2d.ManhattanConnectionRouter;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.swt.graphics.Color;
-
-public class TypeReferenceConnection extends PolylineConnection
-{
- protected boolean highlight = false;
- protected static final Color activeConnection = ColorConstants.black;
- protected static final Color inactiveConnection = new Color(null, 198, 195, 198);
-
- /**
- * Default constructor
- */
- public TypeReferenceConnection()
- {
- super();
- setTargetDecoration(new PolygonDecoration());
- }
-
-
-
- public void setConnectionRouter(ConnectionRouter cr)
- {
- if (cr != null && getConnectionRouter() != null && !(getConnectionRouter() instanceof ManhattanConnectionRouter))
- super.setConnectionRouter(cr);
- }
-
- /**
- * @return Returns the current highlight status.
- */
- public boolean isHighlighted()
- {
- return highlight;
- }
-
- /**
- * @param highlight
- * The highlight to set.
- */
- public void setHighlight(boolean highlight)
- {
- this.highlight = highlight;
- // Update our connection to use the correct colouring
- setForegroundColor(highlight ? activeConnection : inactiveConnection);
- setOpaque(highlight);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/AbstractModelCollection.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/AbstractModelCollection.java
deleted file mode 100644
index 55905d1a86..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/AbstractModelCollection.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-
-public abstract class AbstractModelCollection implements IADTObject
-{
- IADTObject model;
- String kind;
-
- public AbstractModelCollection(IADTObject model, String kind)
- {
- this.model = model;
- this.kind = kind;
- }
-
- public Object getModel()
- {
- return model;
- }
-
- public void setModel(IADTObject model)
- {
- this.model = model;
- }
-
- public String getKind()
- {
- return kind;
- }
-
- public void setKind(String kind)
- {
- this.kind = kind;
- }
-
- public abstract List getChildren();
-
- public void registerListener(IADTObjectListener listener)
- {
- model.registerListener(listener);
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
- model.unregisterListener(listener);
- }
-
- public boolean isReadOnly()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Annotation.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Annotation.java
deleted file mode 100644
index 1f67a7fdd8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Annotation.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-
-public class Annotation
-{
- Compartment compartment;
- public Annotation()
- {
- super();
- }
-
- public void setCompartment(Compartment compartment)
- {
- this.compartment = compartment;
- }
-
- public Compartment getCompartment()
- {
- return compartment;
- }
-
- public IStructure getOwner()
- {
- return compartment.getOwner();
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Compartment.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Compartment.java
deleted file mode 100644
index 628cd4f8ef..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Compartment.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-
-public class Compartment implements IADTObject
-{
- String kind;
- IStructure owner;
-
- public Compartment(IStructure owner, String kind)
- {
- this.kind = kind;
- this.owner = owner;
- }
-
- public List getChildren()
- {
- List list = new ArrayList();
- for (Iterator i = owner.getFields().iterator(); i.hasNext();)
- {
- IField field = (IField) i.next();
- if (kind == null || kind.equals(field.getKind()))
- {
- list.add(field);
- }
- }
- return list;
- }
-
- public String getKind()
- {
- return kind;
- }
-
- public IStructure getOwner()
- {
- return owner;
- }
-
- public void registerListener(IADTObjectListener listener)
- {
- // really we want to listen to the owner
- owner.registerListener(listener);
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
- // really we want to listen to the owner
- owner.unregisterListener(listener);
- }
-
- public boolean isReadOnly()
- {
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/FocusTypeColumn.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/FocusTypeColumn.java
deleted file mode 100644
index 4618c279dc..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/FocusTypeColumn.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-
-public class FocusTypeColumn extends AbstractModelCollection
-{
- public FocusTypeColumn(IADTObject model)
- {
- super(model, "FocusTypeColumn"); //$NON-NLS-1$
- }
-
- public List getChildren()
- {
- List result = new ArrayList();
- if (model instanceof IType)
- {
- IType type = (IType)model;
- if (type.getSuperType() != null)
- {
- result.add(type.getSuperType());
- }
- result.add(type);
- }
- else if (model instanceof IField ||
- model instanceof IStructure)
- {
- result.add(model);
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IActionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IActionProvider.java
deleted file mode 100644
index d8443fa552..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IActionProvider.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-
-
-public interface IActionProvider
-{
- public String[] getActions(Object object);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IFeedbackHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IFeedbackHandler.java
deleted file mode 100644
index 18e860b330..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IFeedbackHandler.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-public interface IFeedbackHandler
-{
- public void addFeedback();
- public void removeFeedback();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java
deleted file mode 100644
index 1a9167ceb0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-public interface IGraphElement
-{
- boolean isFocusAllowed();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IModelProxy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IModelProxy.java
deleted file mode 100644
index f263c38dd6..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IModelProxy.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-
-public interface IModelProxy
-{
- IModel getModel();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/ReferencedTypeColumn.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/ReferencedTypeColumn.java
deleted file mode 100644
index 95f8970e0a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/ReferencedTypeColumn.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editparts.model;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IStructure;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
-
-public class ReferencedTypeColumn extends AbstractModelCollection
-{
- List listenerList = new ArrayList();
- InternalListener internalListener = new InternalListener();
-
- // todo... really this this model object should listen
- // to the parent of the IType
- //
- public ReferencedTypeColumn(IADTObject model)
- {
- super(model, "ReferencedTypeColumn"); //$NON-NLS-1$
- model.registerListener(internalListener);
- internalListener.recomputeSubListeners();
- }
-
- public List getChildren()
- {
- List result = new ArrayList();
- if (model instanceof IStructure)
- {
- IStructure structure = (IStructure)model;
- for (Iterator i = structure.getFields().iterator(); i.hasNext(); )
- {
- IField field = (IField)i.next();
- IType type = field.getType();
- if (type != null) // && type.isComplexType())
- {
- if (!result.contains(type))
- {
- if (type instanceof IGraphElement)
- {
- if (((IGraphElement)type).isFocusAllowed())
- result.add(type);
- }
- }
- }
- }
- }
- else if (model instanceof IField)
- {
- IField field = (IField)model;
- IType type = field.getType();
- if (type != null) // && type.isComplexType())
- {
- if (type instanceof IGraphElement)
- {
- if (((IGraphElement)type).isFocusAllowed())
- result.add(type);
- }
- }
- }
- return result;
- }
-
- public void registerListener(IADTObjectListener listener)
- {
- listenerList.add(listener);
- }
-
- public void unregisterListener(IADTObjectListener listener)
- {
- listenerList.remove(listener);
- }
-
- protected void notifyListeners(Object changedObject, String property)
- {
- List clonedListenerList = new ArrayList();
- clonedListenerList.addAll(listenerList);
- for (Iterator i = clonedListenerList.iterator(); i.hasNext(); )
- {
- IADTObjectListener listener = (IADTObjectListener)i.next();
- listener.propertyChanged(this, null);
- }
- }
-
- protected class InternalListener implements IADTObjectListener
- {
- List fields = new ArrayList();
-
- void recomputeSubListeners()
- {
- if (model instanceof IStructure)
- {
- // remove old ones
- for (Iterator i = fields.iterator(); i.hasNext();)
- {
- IField field = (IField) i.next();
- field.unregisterListener(this);
- }
- // add new ones
- fields.clear();
- IStructure complexType = (IStructure) model;
- for (Iterator i = complexType.getFields().iterator(); i.hasNext();)
- {
- IField field = (IField) i.next();
- fields.add(field);
- field.registerListener(this);
- }
- }
- }
-
- public void propertyChanged(Object object, String property)
- {
- if (object == model)
- {
- // we need to update the fields we're listening too
- // since these may have changed
- recomputeSubListeners();
- }
- else if (object instanceof IField)
- {
- }
- notifyListeners(object, property);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTDirectEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTDirectEditPolicy.java
deleted file mode 100644
index b7f22b30a5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTDirectEditPolicy.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.DirectEditPolicy;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.wst.xsd.ui.internal.adt.design.directedit.ComboBoxCellEditorManager;
-
-public class ADTDirectEditPolicy extends DirectEditPolicy
-{
- protected ComboBoxCellEditorManager delegate;
- protected IADTUpdateCommand command;
-
- public ADTDirectEditPolicy()
- {
- super();
- }
-
-
- public void setUpdateCommand(IADTUpdateCommand command)
- {
- this.command = command;
- }
-
- protected void showCurrentEditValue(DirectEditRequest request)
- {
- getHostFigure().getUpdateManager().performUpdate();
- }
-
- protected Command getDirectEditCommand(DirectEditRequest request)
- {
- command.setRequest(request);
- return (Command)command;
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java
deleted file mode 100644
index 4787127419..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler;
-
-public class ADTSelectionFeedbackEditPolicy extends SelectionEditPolicy
-{
-
- public ADTSelectionFeedbackEditPolicy()
- {
- super();
- }
-
- protected void hideSelection()
- {
- if (getHost() instanceof IFeedbackHandler)
- {
- ((IFeedbackHandler) getHost()).removeFeedback();
- }
- }
-
- protected void showSelection()
- {
- if (getHost() instanceof IFeedbackHandler)
- {
- ((IFeedbackHandler) getHost()).addFeedback();
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/DirectEditPolicyDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/DirectEditPolicyDelegate.java
deleted file mode 100644
index 151b493512..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/DirectEditPolicyDelegate.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.jface.viewers.CellEditor;
-
-public interface DirectEditPolicyDelegate
-{
- public void performEdit(CellEditor cellEditor);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/IADTUpdateCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/IADTUpdateCommand.java
deleted file mode 100644
index a4c4eb50bb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/IADTUpdateCommand.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.gef.requests.DirectEditRequest;
-
-public interface IADTUpdateCommand
-{
- void setRequest(DirectEditRequest request);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/KeyBoardAccessibilityEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/KeyBoardAccessibilityEditPolicy.java
deleted file mode 100644
index a1bf690c03..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/KeyBoardAccessibilityEditPolicy.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-
-public class KeyBoardAccessibilityEditPolicy extends GraphicalEditPolicy
-{
- public static String KEY = "KeyBoardAccessibilityEditPolicy";
-
- public static int OUT_TO_PARENT = PositionConstants.ALWAYS_LEFT;
- public static int IN_TO_FIRST_CHILD = PositionConstants.ALWAYS_RIGHT;
-
- public EditPart getRelativeEditPart(EditPart editPart, int direction)
- {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/SimpleDirectEditPolicy.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/SimpleDirectEditPolicy.java
deleted file mode 100644
index 4e38e39f6e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/SimpleDirectEditPolicy.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.editpolicies;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.DirectEditPolicy;
-import org.eclipse.gef.requests.DirectEditRequest;
-
-public class SimpleDirectEditPolicy extends DirectEditPolicy
-{
- protected DirectEditPolicyDelegate delegate;
-
- public void setDelegate(DirectEditPolicyDelegate delegate)
- {
- this.delegate = delegate;
- }
-
- protected org.eclipse.gef.commands.Command getDirectEditCommand(final DirectEditRequest request)
- {
- return new Command() //AbstractCommand()
- {
- public void execute()
- {
- if (delegate != null)
- {
- delegate.performEdit(request.getCellEditor());
- }
- }
-
- public void redo()
- {
- }
-
- public void undo()
- {
- }
-
- public boolean canExecute()
- {
- return true;
- }
- };
- }
-
- protected void showCurrentEditValue(DirectEditRequest request)
- {
- //hack to prevent async layout from placing the cell editor twice.
- getHostFigure().getUpdateManager().performUpdate();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IADTFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IADTFigure.java
deleted file mode 100644
index 284a26043b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IADTFigure.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-
-public interface IADTFigure extends IFigure
-{
- void editPartAttached(EditPart owner);
- void addSelectionFeedback();
- void removeSelectionFeedback();
- void refreshVisuals(Object model);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/ICompartmentFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/ICompartmentFigure.java
deleted file mode 100644
index 3e25deff34..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/ICompartmentFigure.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-
-public interface ICompartmentFigure extends IADTFigure
-{
- IFigure getContentPane();
- IFigure getAnnotationPane();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFieldFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFieldFigure.java
deleted file mode 100644
index efabeb0e68..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFieldFigure.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.figures;
-
-import org.eclipse.draw2d.Label;
-
-
-public interface IFieldFigure extends IADTFigure
-{
- Label getTypeLabel();
- Label getNameLabel();
- Label getNameAnnotationLabel();
- Label getTypeAnnotationLabel();
- void recomputeLayout();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFigureFactory.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFigureFactory.java
deleted file mode 100644
index d6efe614c4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFigureFactory.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.figures;
-
-public interface IFigureFactory
-{
- IFieldFigure createFieldFigure(Object model);
- IStructureFigure createStructureFigure(Object model);
- ICompartmentFigure createCompartmentFigure(Object model);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IStructureFigure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IStructureFigure.java
deleted file mode 100644
index 5a96af2019..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IStructureFigure.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.design.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-
-public interface IStructureFigure extends IADTFigure
-{
- IFigure getContentPane();
- Label getNameLabel();
- boolean hitTestHeader(Point point);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager.java
deleted file mode 100644
index 46ac99a38a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.edit;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider;
-
-public interface ComponentReferenceEditManager
-{
- public IComponentDialog getBrowseDialog();
- public IComponentDialog getNewDialog();
- public void modifyComponentReference(Object referencingObject, ComponentSpecification referencedComponent);
- public IComponentDescriptionProvider getComponentDescriptionProvider();
-
- public ComponentSpecification[] getQuickPicks();
- public ComponentSpecification[] getHistory();
- public void addToHistory(ComponentSpecification component);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/IComponentDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/IComponentDialog.java
deleted file mode 100644
index 4194f9b5b4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/IComponentDialog.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.edit;
-
-import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification;
-
-public interface IComponentDialog {
-
- /*
- * Set the Object being set
- */
- public void setInitialSelection(ComponentSpecification componentSpecification);
-
- /*
- * Return the Object which should be used as the type.
- */
- public ComponentSpecification getSelectedComponent();
-
- /*
- * Used to open the Dialog
- */
- public int createAndOpen();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonSelectionManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonSelectionManager.java
deleted file mode 100644
index 56ead67336..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonSelectionManager.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.editor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.part.MultiPageSelectionProvider;
-
-public class CommonSelectionManager extends MultiPageSelectionProvider implements ISelectionProvider, ISelectionChangedListener
-{
-
- public CommonSelectionManager(MultiPageEditorPart multiPageEditor)
- {
- super(multiPageEditor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
- */
- public ISelection getSelection()
- {
- return currentSelection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- listenerList.remove(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
- */
- public void setSelection(ISelection selection)
- {
- setSelection(selection, this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (enableNotify)
- {
- setSelection(event.getSelection(), event.getSelectionProvider());
- }
- }
-
-
- protected List listenerList = new ArrayList();
- protected ISelection currentSelection;
- protected boolean enableNotify = true;
-
- public boolean getEnableNotify()
- {
- return enableNotify;
- }
-
- public void setSelection(ISelection selection, ISelectionProvider source)
- {
- if (enableNotify)
- {
- currentSelection = selection;
- enableNotify = false;
- try
- {
- SelectionChangedEvent event = new SelectionChangedEvent(source, selection);
- List copyOfListenerList = new ArrayList(listenerList);
- for (Iterator i = copyOfListenerList.iterator(); i.hasNext(); )
- {
- ISelectionChangedListener listener = (ISelectionChangedListener)i.next();
- listener.selectionChanged(event);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- enableNotify = true;
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ContextMenuParticipant.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ContextMenuParticipant.java
deleted file mode 100644
index 9c1dfd5d1f..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ContextMenuParticipant.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.adt.editor;
-
-import org.eclipse.jface.action.IMenuManager;
-
-public class ContextMenuParticipant
-{
- public boolean isApplicable(Object object, String actionId)
- {
- return true;
- }
-
- public void contributeActions(Object object, IMenuManager menu)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IEditorModeListener.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IEditorModeListener.java
deleted file mode 100644
index 4ebfe8b052..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IEditorModeListener.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.eclipse.wst.xsd.ui.internal.adt.editor;
-
-public interface IEditorModeListener
-{
- void editorModeChanged(EditorMode newEditorMode);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java
deleted file mode 100644
index bacb0b93a5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.editor;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS
-{
- private static final String BUNDLE_NAME = "org.eclipse.wst.xsd.ui.internal.adt.editor.messages"; //$NON-NLS-1$
-
- private Messages()
- {
- }
-
- static
- {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
- public static String _UI_ACTION_SHOW_PROPERTIES;
- public static String _UI_ACTION_SET_AS_FOCUS;
- public static String _UI_ACTION_DELETE;
- public static String _UI_ACTION_ADD_FIELD;
- public static String _UI_ACTION_BROWSE;
- public static String _UI_ACTION_NEW;
- public static String _UI_ACTION_UPDATE_NAME;
- public static String _UI_ACTION_UPDATE_TYPE;
- public static String _UI_ACTION_UPDATE_ELEMENT_REFERENCE;
- public static String _UI_LABEL_DESIGN;
- public static String _UI_LABEL_SOURCE;
- public static String _UI_LABEL_VIEW;
- public static String _UI_HOVER_VIEW_MODE_DESCRIPTION;
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties
deleted file mode 100644
index 43cc2090fe..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2001, 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
-###############################################################################
-
-_UI_ACTION_SHOW_PROPERTIES=Show properties
-_UI_ACTION_SET_AS_FOCUS=Set As Focus
-_UI_ACTION_UPDATE_NAME=Update Name
-_UI_ACTION_UPDATE_TYPE=Update type
-_UI_ACTION_UPDATE_ELEMENT_REFERENCE=Update element reference
-_UI_ACTION_DELETE=Delete
-_UI_ACTION_BROWSE=Browse...
-_UI_LABEL_DESIGN=Design
-_UI_LABEL_SOURCE=Source
-_UI_ACTION_NEW=New...
-_UI_ACTION_ADD_FIELD=Add Field
-_UI_LABEL_VIEW=View:
-_UI_HOVER_VIEW_MODE_DESCRIPTION=Change the view mode of the editor \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObject.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObject.java
deleted file mode 100644
index bea4a836d9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObject.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.facade;
-
-public interface IADTObject
-{
- public void registerListener(IADTObjectListener listener);
- public void unregisterListener(IADTObjectListener listener);
- boolean isReadOnly();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObjectListener.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObjectListener.java
deleted file mode 100644
index afc8efb4fb..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObjectListener.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.facade;
-
-public interface IADTObjectListener
-{
- public void propertyChanged(Object object, String property);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java
deleted file mode 100644
index 38387ac6e5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.facade;
-
-
-
-public interface IComplexType extends IType, IStructure
-{
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java
deleted file mode 100644
index 59a628072e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.facade;
-
-import org.eclipse.gef.commands.Command;
-
-public interface IField extends IADTObject
-{
- String getKind();
- String getName();
- String getTypeName();
- String getTypeNameQualifier();
- IModel getModel();
- IType getType();
- IComplexType getContainerType();
- int getMinOccurs();
- int getMaxOccurs();
- boolean isGlobal();
- boolean isReference();
-
- Command getUpdateMinOccursCommand(int minOccurs);
- Command getUpdateMaxOccursCommand(int maxOccurs);
- Command getUpdateTypeNameCommand(String typeName, String quailifier);
- Command getUpdateNameCommand(String name);
- Command getDeleteCommand();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IModel.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IModel.java
deleted file mode 100644
index 4e42451d9a..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IModel.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.facade;
-
-import java.util.List;
-
-public interface IModel extends IADTObject
-{
- List getTypes();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IStructure.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IStructure.java
deleted file mode 100644
index 0c0d16e383..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IStructure.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.facade;
-
-import java.util.List;
-import org.eclipse.gef.commands.Command;
-
-public interface IStructure extends IADTObject
-{
- String getName();
- List getFields();
- IModel getModel();
- Command getAddNewFieldCommand(String fieldKind);
- Command getDeleteCommand();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java
deleted file mode 100644
index cdc553a449..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.facade;
-
-import org.eclipse.gef.commands.Command;
-
-public interface IType extends IADTObject
-{
- IType getSuperType();
- String getName();
- String getQualifier();
- boolean isComplexType();
-
- Command getUpdateNameCommand(String newName);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java
deleted file mode 100644
index f0b86ef29e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.outline;
-
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.part.MultiPageSelectionProvider;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewContextMenuProvider;
-import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IModelProxy;
-import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTMultiPageEditor;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class ADTContentOutlinePage extends ContentOutlinePage
-{
- protected ADTMultiPageEditor editor;
- protected int level = 0;
- protected Object model;
- protected ITreeContentProvider contentProvider;
- protected ILabelProvider labelProvider;
- protected MultiPageSelectionProvider selectionManager;
- protected SelectionManagerSelectionChangeListener selectionManagerSelectionChangeListener = new SelectionManagerSelectionChangeListener();
-// protected TreeSelectionChangeListener treeSelectionChangeListener = new TreeSelectionChangeListener();
-
- /**
- *
- */
- public ADTContentOutlinePage(ADTMultiPageEditor editor)
- {
- super();
- this.editor = editor;
- }
-
- public void setModel(Object newModel)
- {
- model = newModel;
- }
-
- public void setContentProvider(ITreeContentProvider contentProvider)
- {
- this.contentProvider = contentProvider;
- }
-
- public void setLabelProvider(ILabelProvider labelProvider)
- {
- this.labelProvider = labelProvider;
- }
-
- // expose
- public TreeViewer getTreeViewer()
- {
- return super.getTreeViewer();
- }
-
- public void createControl(Composite parent)
- {
- super.createControl(parent);
- getTreeViewer().setContentProvider(contentProvider);
- getTreeViewer().setLabelProvider(labelProvider);
- getTreeViewer().setInput(model);
- getTreeViewer().addSelectionChangedListener(this);
- MenuManager menuManager = new MenuManager("#popup");//$NON-NLS-1$
- menuManager.setRemoveAllWhenShown(true);
- Menu menu = menuManager.createContextMenu(getTreeViewer().getControl());
- getTreeViewer().getControl().setMenu(menu);
- setSelectionManager(editor.getSelectionManager());
-
- // Create menu...for now reuse graph's. Note edit part viewer = null
- DesignViewContextMenuProvider menuProvider = new DesignViewContextMenuProvider(editor, null, editor.getSelectionManager());
- menuManager.addMenuListener(menuProvider);
- getSite().registerContextMenu("org.eclipse.wst.xsd.ui.popup.outline", menuManager, editor.getSelectionManager()); //$NON-NLS-1$
-
- // enable popupMenus extension
- // getSite().registerContextMenu("org.eclipse.wst.xsdeditor.ui.popup.outline",
- // menuManager, xsdEditor.getSelectionManager());
-
- // cs... why are we doing this from the outline view?
- //
- // xsdTextEditor.getXSDEditor().getSelectionManager().setSelection(new
- // StructuredSelection(xsdTextEditor.getXSDSchema()));
- // drill down from outline view
- getTreeViewer().getControl().addMouseListener(new MouseAdapter()
- {
- public void mouseDoubleClick(MouseEvent e)
- {
- ISelection iSelection = getTreeViewer().getSelection();
- if (iSelection instanceof StructuredSelection)
- {
- StructuredSelection selection = (StructuredSelection) iSelection;
- Object obj = selection.getFirstElement();
- if (obj instanceof XSDConcreteComponent)
- {
- XSDConcreteComponent comp = (XSDConcreteComponent) obj;
- if (comp.getContainer() instanceof XSDSchema)
- {
- // getXSDEditor().getGraphViewer().setInput(obj);
- }
- }
- }
-
- }
- });
- }
-
- class XSDKeyListener extends KeyAdapter
- {
- }
-
- public void dispose()
- {
- contentProvider.dispose();
- super.dispose();
- }
-
- public void setExpandToLevel(int i)
- {
- level = i;
- }
-
- public void setInput(Object value)
- {
- getTreeViewer().setInput(value);
- getTreeViewer().expandToLevel(level);
- }
-
- // public ISelection getSelection()
- // {
- // if (getTreeViewer() == null)
- // return StructuredSelection.EMPTY;
- // return getTreeViewer().getSelection();
- // }
- public void setSelectionManager(MultiPageSelectionProvider newSelectionManager)
- {
-// TreeViewer treeViewer = getTreeViewer();
- // disconnect from old one
- if (selectionManager != null)
- {
- selectionManager.removeSelectionChangedListener(selectionManagerSelectionChangeListener);
-// treeViewer.removeSelectionChangedListener(treeSelectionChangeListener);
- }
- selectionManager = newSelectionManager;
- // connect to new one
- if (selectionManager != null)
- {
- selectionManager.addSelectionChangedListener(selectionManagerSelectionChangeListener);
-// treeViewer.addSelectionChangedListener(treeSelectionChangeListener);
- }
- }
-
- class SelectionManagerSelectionChangeListener implements ISelectionChangedListener
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- if (event.getSelectionProvider() != ADTContentOutlinePage.this) //getTreeViewer())
- {
- StructuredSelection selection = (StructuredSelection)event.getSelection();
- StructuredSelection currentSelection = (StructuredSelection) getTreeViewer().getSelection();
-
- // TODO: Hack to prevent losing a selection when the schema is selected in the
- // source. Fix is to prevent the source from firing off selection changes when
- // the selection source is not the source view.
- if (selection.getFirstElement() instanceof IModel)
- {
- if (!(currentSelection.getFirstElement() instanceof IModelProxy))
- {
- getTreeViewer().setSelection(event.getSelection(), true);
- }
- }
- else
- {
- getTreeViewer().setSelection(event.getSelection(), true);
- }
- }
- }
- }
-
-// class TreeSelectionChangeListener implements ISelectionChangedListener
-// {
-// public void selectionChanged(SelectionChangedEvent event)
-// {
-// if (selectionManager != null)
-// {
-// ISelection selection = event.getSelection();
-// if (selection instanceof IStructuredSelection)
-// {
-// IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-// Object o = structuredSelection.getFirstElement();
-// if (o != null)
-// {
-// selectionManager.setSelection(structuredSelection);
-// }
-// }
-// }
-// }
-// }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java
deleted file mode 100644
index 7f8697fa1d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.outline;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject;
-import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener;
-
-public class ADTContentOutlineProvider implements ITreeContentProvider, IADTObjectListener
-{
- protected Viewer viewer = null;
- protected Object oldInput, newInput;
-
- public ADTContentOutlineProvider()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object parentElement)
- {
- if (parentElement instanceof ITreeElement)
- {
- Object[] children = ((ITreeElement) parentElement).getChildren();
- if (children != null)
- {
- int length = children.length;
- for (int i = 0; i < length; i++)
- {
- Object child = children[i];
- if (child instanceof IADTObject)
- {
- ((IADTObject) child).registerListener(this);
- }
- }
- }
- return children;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- public Object getParent(Object element)
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- public boolean hasChildren(Object element)
- {
- if (element instanceof ITreeElement)
- {
- return ((ITreeElement) element).hasChildren();
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement)
- {
- return getChildren(inputElement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose()
- {
- Object input = viewer.getInput();
- if (input instanceof IADTObject)
- {
- removeListener((IADTObject) input);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- this.viewer = viewer;
- this.oldInput = oldInput;
- this.newInput = newInput;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener#propertyChanged(java.lang.Object, java.lang.String)
- */
- public void propertyChanged(Object object, String property)
- {
- if (viewer instanceof TreeViewer)
- {
- TreeViewer treeViewer = (TreeViewer) viewer;
- treeViewer.refresh(object);
- treeViewer.reveal(object);
- }
- }
-
- /**
- * @param model
- */
- private void removeListener(IADTObject model)
- {
- model.unregisterListener(this);
- Object[] children = getChildren(model);
- if (children != null)
- {
- int length = children.length;
- for (int i = 0; i < length; i++)
- {
- Object child = children[i];
- if (child instanceof IADTObject)
- {
- removeListener((IADTObject) child);
- }
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTLabelProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTLabelProvider.java
deleted file mode 100644
index 14a6d4d845..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTLabelProvider.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.outline;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-
-public class ADTLabelProvider implements ILabelProvider
-{
-
- public ADTLabelProvider()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element)
- {
- if (element instanceof ITreeElement)
- {
- return ((ITreeElement)element).getImage();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element)
- {
- if (element instanceof ITreeElement)
- {
- return ((ITreeElement)element).getText();
- }
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener)
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose()
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property)
- {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener)
- {
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ITreeElement.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ITreeElement.java
deleted file mode 100644
index a660d9a30b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ITreeElement.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.outline;
-
-import org.eclipse.swt.graphics.Image;
-
-public interface ITreeElement
-{
- public final static ITreeElement[] EMPTY_LIST = {};
- ITreeElement[] getChildren();
- ITreeElement getParent();
- boolean hasChildren();
- String getText();
- Image getImage();
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/properties/ADTTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/properties/ADTTabbedPropertySheetPage.java
deleted file mode 100644
index 9b5ec3fb57..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/properties/ADTTabbedPropertySheetPage.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.adt.properties;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-
-
-public class ADTTabbedPropertySheetPage extends TabbedPropertySheetPage
-{
- public ADTTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor)
- {
- super(tabbedPropertySheetPageContributor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-
-// Object selected = ((StructuredSelection)selection).getFirstElement();
-// if (selected instanceof EditPart)
-// {
-// Object model = ((EditPart)selected).getModel();
-// selection = new StructuredSelection(model);
-// }
- super.selectionChanged(part, selection);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyElementAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyElementAction.java
deleted file mode 100644
index 56e41d8a4c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyElementAction.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDAnyElementCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDWildcard;
-
-public class AddXSDAnyElementAction extends XSDBaseAction
-{
- public static String ID = "org.eclipse.wst.xsd.ui.AddXSDAnyElementAction"; //$NON-NLS-1$
-
- public AddXSDAnyElementAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_ADD_ANY_ELEMENT);
- setId(ID);
- }
-
- public void run()
- {
- XSDModelGroup modelGroup = getModelGroup();
- if (modelGroup != null)
- {
- AddXSDAnyElementCommand command = new AddXSDAnyElementCommand(getText(), modelGroup);
- getCommandStack().execute(command);
- }
- }
-
- private XSDModelGroup getModelGroup()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
- if (selection instanceof XSDModelGroup)
- {
- return (XSDModelGroup) selection;
- }
- return null;
- }
-
- protected boolean calculateEnabled()
- {
- boolean rc = super.calculateEnabled();
- if (rc)
- {
- XSDModelGroup modelGroup = getModelGroup();
- if (modelGroup != null)
- {
- boolean hasAnyElement = false;
- for (Iterator i = modelGroup.getContents().iterator(); i.hasNext();)
- {
- XSDParticle obj = (XSDParticle) i.next();
- if (obj.getContent() instanceof XSDWildcard)
- {
- hasAnyElement = true;
- break;
- }
- }
- return !hasAnyElement;
- }
- }
- return rc;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupAction.java
deleted file mode 100644
index 826334e1d4..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupAction.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDModelGroupCommand;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDCompositor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-
-public class AddXSDModelGroupAction extends XSDBaseAction
-{
- public static String SEQUENCE_ID = "AddXSDSequenceModelGroupAction"; //$NON-NLS-1$
- public static String CHOICE_ID = "AddXSDChoiceModelGroupAction"; //$NON-NLS-1$
- public static String ALL_ID = "AddXSDAllModelGroupAction"; //$NON-NLS-1$
- XSDCompositor xsdCompositor;
-
- public AddXSDModelGroupAction(IWorkbenchPart part, XSDCompositor compositor, String ID)
- {
- super(part);
- setText(getLabel(compositor));
- setId(ID);
- this.xsdCompositor = compositor;
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
- if (selection instanceof XSDBaseAdapter)
- {
- XSDConcreteComponent xsdComponent = (XSDConcreteComponent) ((XSDBaseAdapter) selection).getTarget();
- AddXSDModelGroupCommand command = null;
- if (xsdComponent instanceof XSDElementDeclaration)
- {
- XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration) xsdComponent;
-
- command = new AddXSDModelGroupCommand(getLabel(xsdCompositor), xsdElementDeclaration, xsdCompositor);
- getCommandStack().execute(command);
- }
- else if (xsdComponent instanceof XSDModelGroup)
- {
- XSDModelGroup xsdModelGroup = (XSDModelGroup) xsdComponent;
-
- command = new AddXSDModelGroupCommand(getLabel(xsdCompositor), xsdModelGroup, xsdCompositor);
- getCommandStack().execute(command);
- }
- else if (xsdComponent instanceof XSDComplexTypeDefinition)
- {
- command = new AddXSDModelGroupCommand(getLabel(xsdCompositor), xsdComponent, xsdCompositor);
- getCommandStack().execute(command);
- }
-
- if (command != null)
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(command.getAddedComponent());
- if (adapter != null)
- provider.setSelection(new StructuredSelection(adapter));
- }
-
- }
- }
-
- private String getLabel(XSDCompositor compositor)
- {
- String result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_SEQUENCE"); //$NON-NLS-1$
- if (compositor != null)
- {
- if (compositor == XSDCompositor.CHOICE_LITERAL)
- {
- result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_CHOICE"); //$NON-NLS-1$
- }
- else if (compositor == XSDCompositor.ALL_LITERAL)
- {
- result = XSDEditorPlugin.getXSDString("_UI_ACTION_ADD_ALL");//$NON-NLS-1$
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java
deleted file mode 100644
index a9d833ace2..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.actions;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDImportCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDIncludeCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDRedefineCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.BaseCommand;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddXSDSchemaDirectiveAction extends XSDBaseAction
-{
- public static String INCLUDE_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDIncludeAction"; //$NON-NLS-1$
- public static String IMPORT_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDImportAction"; //$NON-NLS-1$
- public static String REDEFINE_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDRedefineAction"; //$NON-NLS-1$
- String label;
-
- public AddXSDSchemaDirectiveAction(IWorkbenchPart part, String ID, String label)
- {
- super(part);
- setText(label);
- setId(ID);
- this.label = label;
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
-
- BaseCommand command = null;
- if (selection instanceof XSDSchema)
- {
- if (INCLUDE_ID.equals(getId()))
- {
- command = new AddXSDIncludeCommand(label, (XSDSchema) selection);
- }
- else if (IMPORT_ID.equals(getId()))
- {
- command = new AddXSDImportCommand(label, (XSDSchema) selection);
- }
- else if (REDEFINE_ID.equals(getId()))
- {
- command = new AddXSDRedefineCommand(label, (XSDSchema) selection);
- }
- getCommandStack().execute(command);
- }
-
- if (command != null)
- {
- Adapter adapter = XSDAdapterFactory.getInstance().adapt(command.getAddedComponent());
- if (adapter != null)
- provider.setSelection(new StructuredSelection(adapter));
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java
deleted file mode 100644
index ef66379880..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class DeleteXSDConcreteComponentAction extends XSDBaseAction
-{
- public static final String DELETE_XSD_COMPONENT_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction"; //$NON-NLS-1$
-
- public DeleteXSDConcreteComponentAction(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_DELETE);
- setId(DELETE_XSD_COMPONENT_ID);
- setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/delete_obj.gif") ); //$NON-NLS-1$
- }
-
- public void run()
- {
- for (Iterator i = ((IStructuredSelection) getSelection()).iterator(); i.hasNext();)
- {
- Object selection = i.next();
-
- if (selection instanceof XSDBaseAdapter)
- {
- selection = ((XSDBaseAdapter) selection).getTarget();
- }
-
- if (selection instanceof XSDConcreteComponent)
- {
- DeleteCommand command = new DeleteCommand(getText(), (XSDConcreteComponent) selection);
- getCommandStack().execute(command);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java
deleted file mode 100644
index 3fc2aecc35..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDComplexTypeDefinitionAdapter;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDSchemaDirectiveAdapter;
-import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor;
-import org.eclipse.wst.xsd.ui.internal.utils.OpenOnSelectionHelper;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDSchemaDirective;
-import org.eclipse.xsd.impl.XSDImportImpl;
-
-public class OpenInNewEditor extends BaseSelectionAction
-{
- public static final String ID = "OpenInNewEditor"; //$NON-NLS-1$
-
- public OpenInNewEditor(IWorkbenchPart part)
- {
- super(part);
- setText(Messages._UI_ACTION_OPEN_IN_NEW_EDITOR); //$NON-NLS-1$
- setId(ID);
- }
-
- protected boolean calculateEnabled()
- {
- return true;
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDComplexTypeDefinitionAdapter)
- {
- XSDComplexTypeDefinitionAdapter xsdAdapter = (XSDComplexTypeDefinitionAdapter) selection;
- XSDComplexTypeDefinition fComponent = (XSDComplexTypeDefinition) xsdAdapter.getTarget();
-
- if (fComponent.getSchema() != null)
- {
- String schemaLocation = URIHelper.removePlatformResourceProtocol(fComponent.getSchema().getSchemaLocation());
- IPath schemaPath = new Path(schemaLocation);
- IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath);
- if (schemaFile != null && schemaFile.exists())
- {
- IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (workbenchWindow != null)
- {
- IWorkbenchPage page = workbenchWindow.getActivePage();
- try
- {
- // TODO: Should use this to open in default editor
- // IEditorPart editorPart = IDE.openEditor(page, schemaFile, true);
- IEditorPart editorPart = page.openEditor(new FileEditorInput(schemaFile), "org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor", true); //$NON-NLS-1$
-
- if (editorPart instanceof InternalXSDMultiPageEditor)
- {
- InternalXSDMultiPageEditor xsdEditor = (InternalXSDMultiPageEditor) editorPart;
-
- xsdEditor.openOnGlobalReference(fComponent);
- }
-
- }
- catch (PartInitException pie)
- {
- }
- }
- }
- }
- }
- else if (selection instanceof XSDSchemaDirectiveAdapter)
- {
- XSDSchemaDirective dir = (XSDSchemaDirective)((XSDSchemaDirectiveAdapter)selection).getTarget();
- String schemaLocation = "";
- // force load of imported schema
- if (dir instanceof XSDImportImpl)
- {
- ((XSDImportImpl)dir).importSchema();
- }
- if (dir.getResolvedSchema() != null)
- {
- schemaLocation = URIHelper.removePlatformResourceProtocol(dir.getResolvedSchema().getSchemaLocation());
- if (schemaLocation != null)
- {
- OpenOnSelectionHelper.openXSDEditor(schemaLocation);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetMultiplicityAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetMultiplicityAction.java
deleted file mode 100644
index a33996a005..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetMultiplicityAction.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.SetMultiplicityCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-public class SetMultiplicityAction extends XSDBaseAction
-{
- public static String REQUIRED_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicity.REQUIRED_ID"; //$NON-NLS-1$
- public static String ZERO_OR_ONE_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicity.ZERO_OR_ONE_ID"; //$NON-NLS-1$
- public static String ZERO_OR_MORE_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicity.ZERO_OR_MORE_ID"; //$NON-NLS-1$
- public static String ONE_OR_MORE_ID = "org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicity.ONE_OR_MORE_ID"; //$NON-NLS-1$
-
- SetMultiplicityCommand command;
-
- public SetMultiplicityAction(IWorkbenchPart part, String label, String ID)
- {
- super(part);
- setText(label);
- setId(ID);
- command = new SetMultiplicityCommand(label);
- }
-
- public void setMaxOccurs(int i)
- {
- command.setMaxOccurs(i);
- }
-
- public void setMinOccurs(int i)
- {
- command.setMinOccurs(i);
- }
-
- protected boolean calculateEnabled()
- {
- boolean state = super.calculateEnabled();
- if (state)
- {
- XSDConcreteComponent xsdConcreteComponent = getXSDInput();
- if (xsdConcreteComponent instanceof XSDElementDeclaration)
- {
- return !((XSDElementDeclaration)xsdConcreteComponent).isGlobal();
- }
- else if (xsdConcreteComponent instanceof XSDModelGroup)
- {
- return !(((XSDModelGroup)xsdConcreteComponent).eContainer() instanceof XSDModelGroupDefinition);
- }
- }
- return state;
- }
-
- private XSDConcreteComponent getXSDInput()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- XSDConcreteComponent xsdConcreteComponent = null;
- if (selection instanceof XSDBaseAdapter)
- {
- xsdConcreteComponent = (XSDConcreteComponent)((XSDBaseAdapter) selection).getTarget();
- }
- return xsdConcreteComponent;
- }
-
- public void run()
- {
- XSDConcreteComponent xsdConcreteComponent = getXSDInput();
- if (xsdConcreteComponent != null)
- {
- command.setXSDConcreteComponent(xsdConcreteComponent);
- getCommandStack().execute(command);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java
deleted file mode 100644
index 6b879ad2b5..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter;
-import org.eclipse.wst.xsd.ui.internal.common.commands.SetTypeCommand;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-public class SetTypeAction extends XSDBaseAction
-{
- public static final String SET_NEW_TYPE_ID = "SetTypeAction_AddType"; //$NON-NLS-1$
- public static final String SELECT_EXISTING_TYPE_ID = "SetTypeAction_ExistingType"; //$NON-NLS-1$
-
- SetTypeCommand command;
-
- public SetTypeAction(String label, String ID, IWorkbenchPart part)
- {
- super(part);
- setText(label);
- setId(ID);
- }
-
- public void run()
- {
- Object selection = ((IStructuredSelection) getSelection()).getFirstElement();
-
- if (selection instanceof XSDBaseAdapter)
- {
- Object target = ((XSDBaseAdapter) selection).getTarget();
-
- if (target instanceof XSDConcreteComponent)
- {
- command = new SetTypeCommand(getText(), getId(), (XSDConcreteComponent) target);
- command.setAdapter((XSDBaseAdapter) selection);
- getCommandStack().execute(command);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionCommand.java
deleted file mode 100644
index 5672104048..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionCommand.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.SpecificationForExtensionsSchema;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public class AddExtensionCommand extends BaseCommand
-{
- protected SpecificationForExtensionsSchema extensionsSchemaSpec;
- protected XSDConcreteComponent component;
-
- protected AddExtensionCommand(String label)
- {
- super(label);
- }
-
- public void setSchemaProperties(SpecificationForExtensionsSchema appInfoSchemaSpec)
- {
- this.extensionsSchemaSpec = appInfoSchemaSpec;
- }
-
- public Object getNewObject()
- {
- return null;
- }
-
- public void execute()
- {
- if (component instanceof XSDSchema)
- {
- ensureSchemaElement((XSDSchema)component);
- }
-
- super.execute();
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSchemaDirectiveCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSchemaDirectiveCommand.java
deleted file mode 100644
index a4f9008868..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSchemaDirectiveCommand.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import java.util.Iterator;
-
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaDirective;
-
-public abstract class AddXSDSchemaDirectiveCommand extends BaseCommand
-{
- protected XSDSchema xsdSchema;
-
- public AddXSDSchemaDirectiveCommand(String label)
- {
- super(label);
- }
-
- public void undo()
- {
- super.undo();
- }
-
- protected boolean adopt(XSDConcreteComponent model)
- {
- return false;
- }
-
- protected int findNextPositionToInsert()
- {
- int index = 0;
- for (Iterator i = xsdSchema.getContents().iterator(); i.hasNext(); )
- {
- Object o = i.next();
- if (o instanceof XSDSchemaDirective)
- {
- index ++;
- }
- else
- {
- break;
- }
- }
- return index;
- }
-
- public void execute()
- {
- ensureSchemaElement(xsdSchema);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionAttributerCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionAttributerCommand.java
deleted file mode 100644
index a173a43def..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionAttributerCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * @deprecated
- */
-public class RemoveExtensionAttributerCommand extends Command
-{
- Element hostElement;
- Attr attr;
-
- public RemoveExtensionAttributerCommand(String label, Element hostElement, Attr attr)
- {
- super(label);
- this.hostElement = hostElement;
- this.attr = attr;
- }
-
- public void execute()
- {
- super.execute();
- hostElement.removeAttributeNode(attr);
- }
-
- public void undo()
- {
- super.undo();
- //TODO implement me
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionElementCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionElementCommand.java
deleted file mode 100644
index d33c756093..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionElementCommand.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.xsd.XSDAnnotation;
-import org.w3c.dom.Node;
-
-/**
- * @deprecated
- */
-public class RemoveExtensionElementCommand extends Command
-{
- XSDAnnotation xsdAnnotation;
- Node appInfo;
-
- public RemoveExtensionElementCommand(String label, XSDAnnotation xsdAnnotation, Node appInfo)
- {
- super(label);
- this.xsdAnnotation = xsdAnnotation;
- this.appInfo = appInfo;
- }
-
- public void execute()
- {
- super.execute();
- xsdAnnotation.getApplicationInformation().remove(appInfo);
- xsdAnnotation.getElement().removeChild(appInfo);
- xsdAnnotation.updateElement();
- }
-
- public void undo()
- {
- super.undo();
- xsdAnnotation.getApplicationInformation().add(appInfo);
- xsdAnnotation.getElement().appendChild(appInfo);
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java
deleted file mode 100644
index c90c0a99fa..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.SubContributionManager;
-import org.eclipse.jface.action.SubStatusLineManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDSchema;
-
-public abstract class AbstractSection extends AbstractPropertySection implements SelectionListener, Listener
-{
- protected Composite composite;
- protected PaintListener painter;
- protected XSDSchema xsdSchema;
- protected Object input;
- protected boolean isReadOnly;
- protected boolean listenerEnabled = true;
- protected boolean isSimple;
- protected CustomListener customListener = new CustomListener();
- protected IEditorPart owningEditor;
- private IStatusLineManager statusLine;
-
- public static final Image ICON_ERROR = XSDEditorPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
-
- public AbstractSection()
- {
- super();
- }
-
- public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage)
- {
- super.createControls(parent, aTabbedPropertySheetPage);
- isSimple = getIsSimple();
- createContents(parent);
- }
-
- protected abstract void createContents(Composite parent);
-
- protected PaintListener createPainter() {
- return new PaintListener() {
-
- public void paintControl(PaintEvent e) {
-// Rectangle bounds = composite.getClientArea();
- GC gc = e.gc;
-
- gc.setForeground(gc.getBackground());
- gc.setBackground(getWidgetFactory().getColors().getColor(
- FormColors.TB_BG));
-
-// gc.fillGradientRectangle(4 + bounds.width / 2, 0,
-// bounds.width / 2 - 9, bounds.height, false);
-
- gc.setForeground(getWidgetFactory().getColors().getColor(
- FormColors.TB_BORDER));
-// gc.drawLine(bounds.width - 5, 0, bounds.width - 5,
-// bounds.height);
- }
-
- };
-
- }
-
- public void dispose()
- {
- if (composite != null && ! composite.isDisposed() && painter != null)
- composite.removePaintListener(painter);
-
- super.dispose();
- }
-
- public void setInput(IWorkbenchPart part, ISelection selection) {
- super.setInput(part, selection);
- isSimple = getIsSimple();
- Object input = ((IStructuredSelection)selection).getFirstElement();
- this.input = input;
-
- if (input instanceof XSDConcreteComponent)
- {
- xsdSchema = ((XSDConcreteComponent)input).getSchema();
- }
-
- // set owning editor of this section
- if (part!=null)
- {
- if (part instanceof IEditorPart)
- {
- owningEditor = (IEditorPart)part;
- }
- else
- {
- owningEditor = part.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
- }
- }
- if (xsdSchema == owningEditor.getAdapter(XSDSchema.class))
- {
- isReadOnly = false;
- }
- else
- {
- isReadOnly = true;
- }
-
- }
-
- public void refresh()
- {
- super.refresh();
-
- if (isReadOnly)
- {
- composite.setEnabled(false);
- }
- else
- {
- composite.setEnabled(true);
- }
- }
-
- public void applyAllListeners(Control control)
- {
- control.addListener(SWT.Modify, customListener);
- control.addListener(SWT.FocusOut, customListener);
- control.addListener(SWT.KeyDown, customListener);
- }
-
- public void applyModifyListeners(Control control)
- {
- control.addListener(SWT.Modify, customListener);
- control.addListener(SWT.FocusOut, customListener);
- }
-
- public void applyKeyListener(Control control)
- {
- control.addListener(SWT.KeyDown, customListener);
- }
-
- public void removeListeners(Control control)
- {
- control.removeListener(SWT.Modify, customListener);
- control.removeListener(SWT.FocusOut, customListener);
- control.removeListener(SWT.KeyDown, customListener);
- }
-
- public void doWidgetDefaultSelected(SelectionEvent e)
- {}
-
- public void doWidgetSelected(SelectionEvent e)
- {}
-
- public void widgetSelected(SelectionEvent e)
- {
- if (isListenerEnabled() &&
- input != null &&
- !isReadOnly)
- {
- doWidgetSelected(e);
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
- if (isListenerEnabled() &&
- input != null &&
- !isReadOnly)
- {
- doWidgetDefaultSelected(e);
- }
- }
-
- /**
- * 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;
- }
-
- /**
- * Sent when an event that the receiver has registered for occurs.
- *
- * @param event the event which occurred
- */
- public void handleEvent(Event event)
- {
- if (isListenerEnabled() && !isReadOnly)
- {
- doHandleEvent(event);
- }
- }
-
- /**
- * Subclasses should override
- * @param event
- */
- protected void doHandleEvent(Event event)
- {
- }
-
- protected IEditorPart getActiveEditor()
- {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor();
- this.owningEditor = editorPart;
- return editorPart;
- }
-
- public CommandStack getCommandStack()
- {
- Object commandStack = owningEditor.getAdapter(CommandStack.class);
-
- if (commandStack==null)
- return null;
- else
- return (CommandStack)commandStack;
- }
-
- public boolean getIsSimple()
- {
- return false;
- }
-
-
-
- /**
- * Intended to display error messages.
- * @return
- */
- private IStatusLineManager getStatusLineManager()
- {
- if (statusLine==null && getPart()!=null)
- {
- if(getPart().getSite() instanceof IEditorSite)
- statusLine = ((IEditorSite)getPart().getSite()).getActionBars().getStatusLineManager();
- else if (getPart().getSite() instanceof IViewSite)
- statusLine = ((IViewSite)getPart().getSite()).getActionBars().getStatusLineManager();
-
- /*
- * We must manually set the visibility of the status line since the action bars are from the editor
- * which means the status line only shows up when the editor is in focus (by default).
- * Note only a SubStatusLineManager can set the visibility.
- */
- if (statusLine instanceof SubStatusLineManager)
- ((SubStatusLineManager)statusLine).setVisible(true);
- }
-
- return statusLine;
- }
-
- /**
- * Display an error message in the status line.
- * Call setErrorMessage(null) to clear the status line.
- * @param text
- */
- public void setErrorMessage(String text)
- {
- IStatusLineManager statusLine = getStatusLineManager();
-
- if (statusLine!=null)
- {
- if (text==null || text.length()<1)
- statusLine.setErrorMessage(null);
- else
- statusLine.setErrorMessage(ICON_ERROR, text);
-
- // ensure our message gets displayed
- if (statusLine instanceof SubContributionManager)
- ((SubContributionManager)statusLine).setVisible(true);
-
- statusLine.update(true);
- }
- }
-
-
- protected EObject getModel()
- {
- return (XSDComponent)input;
- }
-
-
- class CustomListener implements Listener
- {
- boolean handlingEvent = false;
- public void handleEvent(Event event)
- {
- if (isListenerEnabled() && !isReadOnly)
- {
- switch (event.type)
- {
- case SWT.KeyDown :
- {
- if (event.character == SWT.CR)
- {
- if (!handlingEvent)
- {
- handlingEvent = true;
- doHandleEvent(event);
- handlingEvent = false;
- }
- }
- break;
- }
- case SWT.FocusOut :
- {
- if (!handlingEvent)
- {
- handlingEvent = true;
- doHandleEvent(event);
- handlingEvent = false;
- }
- break;
- }
- }
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSectionDescriptor.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSectionDescriptor.java
deleted file mode 100644
index e0b33bb5c0..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSectionDescriptor.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IFilter;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.ISection;
-import org.eclipse.ui.views.properties.tabbed.ISectionDescriptor;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.w3c.dom.Element;
-
-public class AbstractSectionDescriptor implements ISectionDescriptor
-{
- /**
- *
- */
- public AbstractSectionDescriptor()
- {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getId()
- */
- public String getId()
- {
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getFilter()
- */
- public IFilter getFilter()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getInputTypes()
- */
- public List getInputTypes()
- {
- List list = new ArrayList();
- list.add(XSDConcreteComponent.class);
- return list;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getSectionClass()
- */
- public ISection getSectionClass()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getTargetTab()
- */
- public String getTargetTab()
- {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#appliesTo(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public boolean appliesTo(IWorkbenchPart part, ISelection selection)
- {
- Object object = null;
- if (selection instanceof StructuredSelection)
- {
- StructuredSelection structuredSelection = (StructuredSelection)selection;
- object = structuredSelection.getFirstElement();
- if (object instanceof XSDConcreteComponent || object instanceof Element)
- {
- return true;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.ISectionDescriptor#getAfterSection()
- */
- public String getAfterSection()
- {
- return ""; //$NON-NLS-1$
- }
-
-
- public int getEnablesFor()
- {
- return ENABLES_FOR_ANY;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/CommonDirectivesSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/CommonDirectivesSection.java
deleted file mode 100644
index e9ddefe5fa..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/CommonDirectivesSection.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.xsd.XSDInclude;
-import org.eclipse.xsd.XSDRedefine;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDParser;
-
-public abstract class CommonDirectivesSection extends AbstractSection
-{
- Text schemaLocationText;
- Button wizardButton;
- StyledText errorText;
- Color red;
-
- // TODO: common up code with XSDSelectIncludeFileWizard
- public void doHandleEvent(Event event)
- {
- errorText.setText(""); //$NON-NLS-1$
-
- if (event.widget == schemaLocationText)
- {
- String errorMessage = ""; //$NON-NLS-1$
- boolean isValidSchemaLocation = true;
- String xsdModelFile = schemaLocationText.getText();
- String namespace = ""; //$NON-NLS-1$
- XSDSchema externalSchema = null;
-
- if (xsdModelFile.length() == 0)
- {
- handleSchemaLocationChange(xsdModelFile, "", null); //$NON-NLS-1$
- return;
- }
-
- try
- {
- IFile currentIFile = ((IFileEditorInput)getActiveEditor().getEditorInput()).getFile();
-
- URI newURI = URI.createURI(xsdModelFile);
- String xsdFile = URIHelper.getRelativeURI(newURI.toString(), currentIFile.getFullPath().toString());
- final String normalizedXSDFile = URIHelper.normalize(xsdFile, currentIFile.getLocation().toString(), ""); //$NON-NLS-1$
-
- XSDParser parser = new XSDParser();
- parser.parse(normalizedXSDFile);
-
- externalSchema = parser.getSchema();
-
- if (externalSchema != null)
- {
- String extNamespace = externalSchema.getTargetNamespace();
- if (extNamespace == null) extNamespace = ""; //$NON-NLS-1$
- namespace = extNamespace;
-
- if (externalSchema.getDiagnostics() != null &&
- externalSchema.getDiagnostics().size() > 0)
- {
- isValidSchemaLocation = false;
- errorMessage = XSDEditorPlugin.getResourceString("_UI_INCORRECT_XML_SCHEMA", xsdModelFile); //$NON-NLS-1$
- }
- else
- {
- String currentNameSpace = xsdSchema.getTargetNamespace();
- if (input instanceof XSDInclude || input instanceof XSDRedefine)
- {
- // Check the namespace to make sure they are the same as current file
- if (extNamespace != null)
- {
- if (currentNameSpace != null && !extNamespace.equals(currentNameSpace))
- {
- errorMessage = XSDEditorPlugin.getResourceString("_UI_DIFFERENT_NAME_SPACE", xsdModelFile); //$NON-NLS-1$
- isValidSchemaLocation = false;
- }
- }
- }
- else
- {
- // Check the namespace to make sure they are different from the current file
- if (extNamespace != null)
- {
- if (currentNameSpace != null && extNamespace.equals(currentNameSpace))
- {
- errorMessage = XSDEditorPlugin.getResourceString("_UI_SAME_NAME_SPACE", xsdModelFile); //$NON-NLS-1$
- isValidSchemaLocation = false;
- }
- }
- }
- }
- }
- else
- {
- errorMessage = Messages._UI_ERROR_INVALID_FILE;
- isValidSchemaLocation = false;
- }
- }
- catch(Exception e)
- {
- errorMessage = Messages._UI_ERROR_INVALID_FILE;
- isValidSchemaLocation = false;
- }
- finally
- {
- if (!isValidSchemaLocation)
- {
- errorText.setText(errorMessage);
- int length = errorText.getText().length();
- red = new Color(null, 255, 0, 0);
- StyleRange style = new StyleRange(0, length, red, schemaLocationText.getBackground());
- errorText.setStyleRange(style);
- }
- else
- {
- handleSchemaLocationChange(xsdModelFile, namespace, externalSchema);
- }
- }
- }
- }
-
- protected void handleSchemaLocationChange(String schemaFileString, String namespace, XSDSchema externalSchema)
- {
-
- }
-
-
- public void dispose()
- {
- super.dispose();
- if (red != null)
- {
- red.dispose();
- red = null;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java
deleted file mode 100644
index e33e4a18ac..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-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.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-import org.eclipse.wst.xsd.ui.internal.common.commands.AddEnumerationsCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.DeleteCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.SetXSDFacetValueCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.widgets.EnumerationsDialog;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDConstants;
-
-public class EnumerationsSection extends AbstractSection
-{
- private EnumerationsTableViewer enumerationsTable;
- private Button addButton;
- private Button addManyButton;
- private Button deleteButton;
-
- /**
- *
- */
- public EnumerationsSection()
- {
- super();
- }
-
- public void widgetSelected(SelectionEvent e)
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-
- if (e.widget == addButton)
- {
- List enumList = st.getEnumerationFacets();
- StringBuffer newName = new StringBuffer("value1"); //$NON-NLS-1$
- int suffix = 1;
- for (Iterator i = enumList.iterator(); i.hasNext();)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) i.next();
- String value = enumFacet.getLexicalValue();
- if (value != null)
- {
- if (value.equals(newName.toString()))
- {
- suffix++;
- newName = new StringBuffer("value" + String.valueOf(suffix)); //$NON-NLS-1$
- }
- }
- }
-
- AddEnumerationsCommand command = new AddEnumerationsCommand(Messages._UI_ACTION_ADD_ENUMERATION, (XSDSimpleTypeDefinition) input);
- command.setValue(newName.toString());
- getCommandStack().execute(command);
-
- enumerationsTable.refresh();
- int newItemIndex = enumerationsTable.getTable().getItemCount() - 1;
- enumerationsTable.editElement(enumerationsTable.getElementAt(newItemIndex), 0);
- }
- else if (e.widget == addManyButton)
- {
- Display display = Display.getCurrent();
- // if it is null, get the default one
- display = display == null ? Display.getDefault() : display;
- Shell parentShell = display.getActiveShell();
- EnumerationsDialog dialog = new EnumerationsDialog(parentShell);
- dialog.setBlockOnOpen(true);
- int result = dialog.open();
-
- if (result == Window.OK)
- {
- String text = dialog.getText();
- String delimiter = dialog.getDelimiter();
- StringTokenizer tokenizer = new StringTokenizer(text, delimiter);
- CompoundCommand compoundCommand = new CompoundCommand(Messages._UI_ACTION_ADD_ENUMERATIONS);
- while (tokenizer.hasMoreTokens())
- {
- String token = tokenizer.nextToken();
- if (dialog.isPreserveWhitespace() == false)
- {
- token = token.trim();
- }
- AddEnumerationsCommand command = new AddEnumerationsCommand(Messages._UI_ACTION_ADD_ENUMERATIONS, (XSDSimpleTypeDefinition) input);
- command.setValue(token);
- compoundCommand.add(command);
- }
- getCommandStack().execute(compoundCommand);
- }
- enumerationsTable.refresh();
- }
- else if (e.widget == deleteButton)
- {
- StructuredSelection selection = (StructuredSelection) enumerationsTable.getSelection();
- if (selection != null)
- {
- Iterator i = selection.iterator();
- CompoundCommand compoundCommand = new CompoundCommand(Messages._UI_ACTION_DELETE_ENUMERATION);
- while (i.hasNext())
- {
- Object obj = i.next();
- if (obj != null)
- {
- if (obj instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) obj;
-
- DeleteCommand deleteCommand = new DeleteCommand(Messages._UI_ACTION_DELETE_ENUMERATION, enumFacet);
- compoundCommand.add(deleteCommand);
- }
- }
- }
- getCommandStack().execute(compoundCommand);
- enumerationsTable.refresh();
- }
- }
- else if (e.widget == enumerationsTable.getTable())
- {
- StructuredSelection selection = (StructuredSelection) enumerationsTable.getSelection();
- if (selection.getFirstElement() != null)
- {
- deleteButton.setEnabled(true);
- }
- else
- {
- deleteButton.setEnabled(false);
- }
- }
-
- }
-
- public void widgetDefaultSelected(SelectionEvent e)
- {
-
- }
-
- public void createContents(Composite parent)
- {
- TabbedPropertySheetWidgetFactory factory = getWidgetFactory();
- composite = factory.createFlatFormComposite(parent);
-
- enumerationsTable = new EnumerationsTableViewer(getWidgetFactory().createTable(composite, SWT.MULTI | SWT.FULL_SELECTION));
- enumerationsTable.setInput(input);
- Table table = enumerationsTable.getTable();
- table.addSelectionListener(this);
-
- addButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL"), SWT.PUSH); //$NON-NLS-1$
- addManyButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_REGEX_WIZARD_ADD_BUTTON_LABEL") + "...", SWT.PUSH); //$NON-NLS-1$ //$NON-NLS-2$
- deleteButton = getWidgetFactory().createButton(composite, XSDEditorPlugin.getXSDString("_UI_ACTION_DELETE_INCLUDE"), SWT.PUSH); //$NON-NLS-1$
-
- FormData data2 = new FormData();
- data2.top = new FormAttachment(0, 0);
- data2.left = new FormAttachment(100, -100);
- data2.right = new FormAttachment(100, 0);
- // data2.width = 50;
- addButton.setLayoutData(data2);
- addButton.addSelectionListener(this);
-
- FormData data = new FormData();
- data.left = new FormAttachment(addButton, 0, SWT.LEFT);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(addButton, 0);
- addManyButton.setLayoutData(data);
- addManyButton.addSelectionListener(this);
-
- data = new FormData();
- data.left = new FormAttachment(addButton, 0, SWT.LEFT);
- data.right = new FormAttachment(100, 0);
- data.top = new FormAttachment(addManyButton, 0);
- deleteButton.setLayoutData(data);
- deleteButton.setEnabled(false);
- deleteButton.addSelectionListener(this);
-
- data = new FormData();
- data.top = new FormAttachment(0, 0);
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(addButton, 0);
- data.bottom = new FormAttachment(100, 0);
- data.width = 50;
- table.setLayoutData(data);
- table.addListener(SWT.Resize, this);
- }
-
- /*
- * @see org.eclipse.wst.common.ui.properties.internal.provisional.view.ITabbedPropertySection#refresh()
- */
- public void refresh()
- {
- if (isReadOnly)
- {
- composite.setEnabled(false);
- }
- else
- {
- composite.setEnabled(true);
- }
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) input;
-
- Iterator validFacets = st.getValidFacets().iterator();
-
- boolean isApplicable = false;
- while (validFacets.hasNext())
- {
- String aValidFacet = (String) validFacets.next();
- if (aValidFacet.equals(XSDConstants.ENUMERATION_ELEMENT_TAG))
- {
- isApplicable = true;
- }
- }
-
- if (isApplicable)
- {
- addButton.setEnabled(true);
- addManyButton.setEnabled(true);
- }
- else
- {
- addButton.setEnabled(false);
- addManyButton.setEnabled(false);
- }
- enumerationsTable.setInput(input);
- }
-
- public void handleEvent(Event event)
- {
- Table table = enumerationsTable.getTable();
- if (event.type == SWT.Resize && event.widget == table)
- {
- TableColumn tableColumn = table.getColumn(0);
- tableColumn.setWidth(table.getSize().x);
- }
- }
-
- public void dispose()
- {
- }
-
- public boolean shouldUseExtraSpace()
- {
- return true;
- }
-
- class EnumerationsTableViewer extends NavigableTableViewer implements ICellModifier
- {
- protected String[] columnProperties = { XSDConstants.ENUMERATION_ELEMENT_TAG };
-
- protected CellEditor[] cellEditors;
-
- Table table;
-
- public EnumerationsTableViewer(Table table)
- {
- super(table);
- table = getTable();
-
- table.setLinesVisible(true);
-
- setContentProvider(new EnumerationsTableContentProvider());
- setLabelProvider(new EnumerationsTableLabelProvider());
- setColumnProperties(columnProperties);
-
- setCellModifier(this);
-
- TableColumn column = new TableColumn(table, SWT.NONE, 0);
- column.setText(columnProperties[0]);
- column.setAlignment(SWT.LEFT);
- column.setResizable(true);
-
- cellEditors = new CellEditor[1];
-
- TableLayout layout = new TableLayout();
- ColumnWeightData data = new ColumnWeightData(100);
-
- layout.addColumnData(data);
- cellEditors[0] = new TextCellEditor(table);
-
- getTable().setLayout(layout);
- setCellEditors(cellEditors);
- }
-
- public boolean canModify(Object element, String property)
- {
- return true;
- }
-
- public void modify(Object element, String property, Object value)
- {
- if (element instanceof TableItem && (value != null))
- {
- TableItem item = (TableItem) element;
-
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) item.getData();
- SetXSDFacetValueCommand command = new SetXSDFacetValueCommand(Messages._UI_ACTION_SET_ENUMERATION_VALUE, enumFacet);
- command.setValue((String) value);
- getCommandStack().execute(command);
- item.setData(enumFacet);
- item.setText((String) value);
- }
- }
-
- public Object getValue(Object element, String property)
- {
- if (element instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
- String value = enumFacet.getLexicalValue();
- if (value == null)
- value = ""; //$NON-NLS-1$
- return value;
- }
- return ""; //$NON-NLS-1$
- }
-
- }
-
- class EnumerationsTableContentProvider implements IStructuredContentProvider
- {
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- }
-
- public java.lang.Object[] getElements(java.lang.Object inputElement)
- {
- java.util.List list = new ArrayList();
- if (inputElement instanceof XSDSimpleTypeDefinition)
- {
- XSDSimpleTypeDefinition st = (XSDSimpleTypeDefinition) inputElement;
- return st.getEnumerationFacets().toArray();
- }
- return list.toArray();
- }
-
- public void dispose()
- {
- }
- }
-
- class EnumerationsTableLabelProvider extends LabelProvider implements ITableLabelProvider
- {
- public EnumerationsTableLabelProvider()
- {
-
- }
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- return XSDEditorPlugin.getXSDImage("icons/XSDSimpleEnum.gif"); //$NON-NLS-1$
- }
-
- public String getColumnText(Object element, int columnIndex)
- {
- if (element instanceof XSDEnumerationFacet)
- {
- XSDEnumerationFacet enumFacet = (XSDEnumerationFacet) element;
- String value = enumFacet.getLexicalValue();
- if (value == null)
- value = ""; //$NON-NLS-1$
- return value;
- }
- return ""; //$NON-NLS-1$
- }
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/FacetViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/FacetViewer.java
deleted file mode 100644
index e13d74d745..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/FacetViewer.java
+++ /dev/null
@@ -1,559 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-//import java.util.ArrayList;
-//import java.util.Iterator;
-//import java.util.List;
-//
-//import org.eclipse.jface.viewers.CellEditor;
-//import org.eclipse.jface.viewers.ColumnWeightData;
-//import org.eclipse.jface.viewers.ICellModifier;
-//import org.eclipse.jface.viewers.ISelectionChangedListener;
-//import org.eclipse.jface.viewers.IStructuredContentProvider;
-//import org.eclipse.jface.viewers.ITableLabelProvider;
-//import org.eclipse.jface.viewers.LabelProvider;
-//import org.eclipse.jface.viewers.SelectionChangedEvent;
-//import org.eclipse.jface.viewers.StructuredSelection;
-//import org.eclipse.jface.viewers.TableLayout;
-//import org.eclipse.jface.viewers.TextCellEditor;
-//import org.eclipse.jface.viewers.Viewer;
-//import org.eclipse.swt.SWT;
-//import org.eclipse.swt.events.MouseEvent;
-//import org.eclipse.swt.events.MouseTrackAdapter;
-//import org.eclipse.swt.graphics.Image;
-//import org.eclipse.swt.graphics.Point;
-//import org.eclipse.swt.widgets.Composite;
-//import org.eclipse.swt.widgets.Table;
-//import org.eclipse.swt.widgets.TableColumn;
-//import org.eclipse.swt.widgets.TableItem;
-//import org.eclipse.wst.common.ui.internal.viewers.NavigableTableViewer;
-//import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-//import org.eclipse.wst.xsd.ui.internal.actions.DOMAttribute;
-//import org.eclipse.wst.xsd.ui.internal.properties.XSDComboBoxPropertyDescriptor;
-//import org.eclipse.wst.xsd.ui.internal.util.XSDDOMHelper;
-//import org.eclipse.xsd.XSDConstrainingFacet;
-//import org.eclipse.xsd.XSDFactory;
-//import org.eclipse.xsd.XSDMaxExclusiveFacet;
-//import org.eclipse.xsd.XSDMaxFacet;
-//import org.eclipse.xsd.XSDMaxInclusiveFacet;
-//import org.eclipse.xsd.XSDMinExclusiveFacet;
-//import org.eclipse.xsd.XSDMinFacet;
-//import org.eclipse.xsd.XSDMinInclusiveFacet;
-//import org.eclipse.xsd.XSDSimpleTypeDefinition;
-//import org.eclipse.xsd.util.XSDConstants;
-//import org.eclipse.xsd.util.XSDSchemaBuildingTools;
-//import org.w3c.dom.Element;
-
-public class FacetViewer //extends NavigableTableViewer implements ICellModifier
-{
-// public static final String FACET_NAME = XSDEditorPlugin.getXSDString("_UI_FACET_NAME"); // "Name";
-// public static final String FACET_VALUE = XSDEditorPlugin.getXSDString("_UI_FACET_VALUE"); // "Value";
-// public static final String FACET_OTHER = XSDEditorPlugin.getXSDString("_UI_FACET_FIXED"); // "Fixed";
-//
-// protected FacetsTableLabelProvider facetsTableLabelProvider = new FacetsTableLabelProvider();
-// protected FacetsTableContentProvider facetsTableContentProvider = new FacetsTableContentProvider();
-// protected String[] columnProperties = { FACET_NAME, FACET_VALUE, FACET_OTHER };
-// protected CellEditor[] cellEditors; // these cellEditors are used when
-// // non-whitespace facet is selected
-// protected CellEditor[] altCellEditors; // these cellEditors are used when
-// // whitespace facet is selected
-//
-// protected String[] whiteSpaceValues = new String[] { "", "preserve", "replace", "collapse" };
-// protected String[] trueFalseValues = new String[] { "", "false", "true" };
-//
-// /**
-// * @param parent
-// */
-// public FacetViewer(Composite parent)
-// {
-// super(new Table(parent, SWT.FULL_SELECTION | SWT.SINGLE));
-//
-// getTable().setLinesVisible(true);
-// getTable().setHeaderVisible(true);
-//
-// addSelectionChangedListener(new SelectionChangedListener());
-// getTable().addMouseTrackListener(new MyMouseTrackListener());
-//
-// setContentProvider(facetsTableContentProvider);
-// setLabelProvider(facetsTableLabelProvider);
-// setColumnProperties(columnProperties);
-//
-// setCellModifier(this);
-//
-// for (int i = 0; i < 3; i++)
-// {
-// TableColumn column = new TableColumn(getTable(), SWT.NONE, i);
-// column.setText(columnProperties[i]);
-// column.setAlignment(SWT.LEFT);
-// column.setResizable(true);
-// }
-//
-// cellEditors = new CellEditor[3];
-// altCellEditors = new CellEditor[3];
-//
-// TableLayout layout = new TableLayout();
-// ColumnWeightData data = new ColumnWeightData(60, 80, true);
-// layout.addColumnData(data);
-// cellEditors[0] = null;
-//
-// ColumnWeightData data2 = new ColumnWeightData(120, 80, true);
-// layout.addColumnData(data2);
-//
-// cellEditors[1] = new TextCellEditor(getTable());
-// XSDComboBoxPropertyDescriptor pd = new XSDComboBoxPropertyDescriptor("combo", "whitespace", whiteSpaceValues);
-// altCellEditors[1] = pd.createPropertyEditor(getTable());
-//
-// ColumnWeightData data3 = new ColumnWeightData(60, 60, true);
-// layout.addColumnData(data3);
-//
-// XSDComboBoxPropertyDescriptor pd2 = new XSDComboBoxPropertyDescriptor("combo", "other", trueFalseValues);
-// cellEditors[2] = pd2.createPropertyEditor(getTable());
-// altCellEditors[2] = pd2.createPropertyEditor(getTable());
-//
-// getTable().setLayout(layout);
-// setCellEditors(cellEditors);
-//
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object,
-// * java.lang.String)
-// */
-// public boolean canModify(Object element, String property)
-// {
-// return property.equals(FACET_VALUE) || property.equals(FACET_OTHER);
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object,
-// * java.lang.String)
-// */
-// public Object getValue(Object element, String property)
-// {
-// int column = 0;
-// if (property.equals(columnProperties[0]))
-// {
-// column = 0;
-// }
-// else if (property.equals(columnProperties[1]))
-// {
-// column = 1;
-// }
-// else if (property.equals(columnProperties[2]))
-// {
-// column = 2;
-// }
-//
-// return facetsTableLabelProvider.getColumnText(element, column);
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object,
-// * java.lang.String, java.lang.Object)
-// */
-// public void modify(Object element, String property, Object value)
-// {
-// XSDSimpleTypeDefinition xsdSimpleType = (XSDSimpleTypeDefinition) getInput();
-// TableItem item = (TableItem) element;
-// if (item != null)
-// {
-// Object o = item.getData();
-// if (o != null)
-// {
-// if (o instanceof String)
-// {
-// String facet = (String) o;
-//
-// Element simpleTypeElement = xsdSimpleType.getElement();
-// XSDDOMHelper xsdDOMHelper = new XSDDOMHelper();
-// Element derivedByElement = xsdDOMHelper.getDerivedByElement(simpleTypeElement);
-//
-// String prefix = simpleTypeElement.getPrefix();
-// prefix = (prefix == null) ? "" : (prefix + ":");
-//
-// Element childNodeElement = null;
-// DOMAttribute valueAttr = null;
-//
-// XSDConstrainingFacet targetFacet = getXSDConstrainingFacet(facet);
-//
-// String newValue = "";
-// if (value != null && value instanceof String)
-// {
-// newValue = (String) value;
-// }
-//
-// if (property.equals(columnProperties[1]))
-// {
-// if (targetFacet == null && newValue.length() > 0)
-// {
-// targetFacet = createFacet(facet);
-// childNodeElement = (derivedByElement.getOwnerDocument()).createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, prefix + facet);
-// valueAttr = new DOMAttribute(XSDConstants.VALUE_ATTRIBUTE, newValue);
-// childNodeElement.setAttribute(valueAttr.getName(), valueAttr.getValue());
-// // add and format child
-// derivedByElement.appendChild(childNodeElement);
-// targetFacet.setElement(childNodeElement);
-// XSDDOMHelper.formatChild(childNodeElement);
-//
-// // XSDSchemaHelper.updateElement(xsdSimpleType);
-// }
-// if (targetFacet == null)
-// {
-// return;
-// }
-//
-// if (newValue.length() > 0)
-// {
-// targetFacet.setLexicalValue(newValue);
-//
-// if (targetFacet instanceof XSDMaxFacet || targetFacet instanceof XSDMinFacet)
-// {
-// if (targetFacet instanceof XSDMaxFacet)
-// {
-// if (targetFacet instanceof XSDMaxExclusiveFacet)
-// {
-// XSDMaxInclusiveFacet xsdMaxInclusiveFacet = xsdSimpleType.getMaxInclusiveFacet();
-// if (xsdMaxInclusiveFacet != null)
-// {
-// Element xsdMaxInclusiveFacetElement = xsdMaxInclusiveFacet.getElement();
-// XSDDOMHelper.removeNodeAndWhitespace(xsdMaxInclusiveFacetElement);
-// }
-// }
-// else if (targetFacet instanceof XSDMaxInclusiveFacet)
-// {
-// XSDMaxExclusiveFacet xsdMaxExclusiveFacet = xsdSimpleType.getMaxExclusiveFacet();
-// if (xsdMaxExclusiveFacet != null)
-// {
-// Element xsdMaxExclusiveFacetElement = xsdMaxExclusiveFacet.getElement();
-// XSDDOMHelper.removeNodeAndWhitespace(xsdMaxExclusiveFacetElement);
-// }
-// }
-// }
-// else if (targetFacet instanceof XSDMinFacet)
-// {
-// if (targetFacet instanceof XSDMinExclusiveFacet)
-// {
-// XSDMinInclusiveFacet xsdMinInclusiveFacet = xsdSimpleType.getMinInclusiveFacet();
-// if (xsdMinInclusiveFacet != null)
-// {
-// Element xsdMinInclusiveFacetElement = xsdMinInclusiveFacet.getElement();
-// XSDDOMHelper.removeNodeAndWhitespace(xsdMinInclusiveFacetElement);
-// }
-// }
-// else if (targetFacet instanceof XSDMinInclusiveFacet)
-// {
-// XSDMinExclusiveFacet xsdMinExclusiveFacet = xsdSimpleType.getMinExclusiveFacet();
-// if (xsdMinExclusiveFacet != null)
-// {
-// Element xsdMinExclusiveFacetElement = xsdMinExclusiveFacet.getElement();
-// XSDDOMHelper.removeNodeAndWhitespace(xsdMinExclusiveFacetElement);
-// }
-// }
-// }
-// }
-// }
-// else
-// // newValue.length == 0
-// {
-// Element targetFacetElement = targetFacet.getElement();
-// XSDDOMHelper.removeNodeAndWhitespace(targetFacetElement);
-// }
-// }
-// else if (property.equals(columnProperties[2]))
-// {
-// if (targetFacet != null)
-// {
-// if (newValue.length() > 0)
-// {
-// targetFacet.getElement().setAttribute(XSDConstants.FIXED_ATTRIBUTE, newValue);
-// }
-// else
-// {
-// targetFacet.getElement().removeAttribute(XSDConstants.FIXED_ATTRIBUTE);
-// }
-// }
-// }
-// xsdSimpleType.setElement(simpleTypeElement);
-// // xsdSimpleType.updateElement();
-// refresh();
-// }
-// }
-// }
-// }
-//
-// private XSDConstrainingFacet getXSDConstrainingFacet(String facetString)
-// {
-// XSDSimpleTypeDefinition xsdSimpleType = (XSDSimpleTypeDefinition) getInput();
-// List list = xsdSimpleType.getFacetContents();
-// if (list == null)
-// {
-// return null;
-// }
-// Iterator iter = list.iterator();
-// XSDConstrainingFacet targetFacet = null;
-//
-// while (iter.hasNext())
-// {
-// XSDConstrainingFacet xsdConstrainingFacet = (XSDConstrainingFacet) iter.next();
-// if (xsdConstrainingFacet.getFacetName().equals(facetString))
-// {
-// targetFacet = xsdConstrainingFacet;
-// break;
-// }
-// }
-// return targetFacet;
-// }
-//
-// private XSDConstrainingFacet createFacet(String facet)
-// {
-// XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
-// XSDConstrainingFacet xsdFacet = null;
-// if (facet.equals("length"))
-// {
-// xsdFacet = factory.createXSDLengthFacet();
-// }
-// else if (facet.equals("minLength"))
-// {
-// xsdFacet = factory.createXSDMinLengthFacet();
-// }
-// else if (facet.equals("maxLength"))
-// {
-// xsdFacet = factory.createXSDMaxLengthFacet();
-// }
-// else if (facet.equals("minInclusive"))
-// {
-// xsdFacet = factory.createXSDMinInclusiveFacet();
-// }
-// else if (facet.equals("minExclusive"))
-// {
-// xsdFacet = factory.createXSDMinExclusiveFacet();
-// }
-// else if (facet.equals("maxInclusive"))
-// {
-// xsdFacet = factory.createXSDMaxInclusiveFacet();
-// }
-// else if (facet.equals("maxExclusive"))
-// {
-// xsdFacet = factory.createXSDMaxExclusiveFacet();
-// }
-//
-// else if (facet.equals("totalDigits"))
-// {
-// xsdFacet = factory.createXSDTotalDigitsFacet();
-// }
-// else if (facet.equals("fractionDigits"))
-// {
-// xsdFacet = factory.createXSDFractionDigitsFacet();
-// }
-// else if (facet.equals("whiteSpace"))
-// {
-// xsdFacet = factory.createXSDWhiteSpaceFacet();
-// }
-// return xsdFacet;
-// }
-//
-// /**
-// * Get the tooltip for the facet
-// */
-// public String getToolTip(String facet)
-// {
-// String key = "";
-// if (facet.equals("length"))
-// {
-// key = "_UI_TOOLTIP_LENGTH";
-// }
-// else if (facet.equals("minLength"))
-// {
-// key = "_UI_TOOLTIP_MIN_LEN";
-// }
-// else if (facet.equals("maxLength"))
-// {
-// key = "_UI_TOOLTIP_MAX_LEN";
-// }
-//
-// else if (facet.equals("minInclusive"))
-// {
-// key = "_UI_TOOLTIP_MIN_INCLUSIVE";
-// }
-// else if (facet.equals("minExclusive"))
-// {
-// key = "_UI_TOOLTIP_MIN_EXCLUSIVE";
-// }
-//
-// else if (facet.equals("maxInclusive"))
-// {
-// key = "_UI_TOOLTIP_MAX_INCLUSIVE";
-// }
-// else if (facet.equals("maxExclusive"))
-// {
-// key = "_UI_TOOLTIP_MAX_EXCLUSIVE";
-// }
-//
-// else if (facet.equals("totalDigits"))
-// {
-// key = "_UI_TOOLTIP_TOTAL_DIGITS";
-// }
-// else if (facet.equals("fractionDigits"))
-// {
-// key = "_UI_TOOLTIP_FRACTION_DIGITS";
-// }
-//
-// else if (facet.equals("whiteSpace"))
-// {
-// key = "_UI_TOOLTIP_WHITE_SPACE";
-// }
-//
-// return (key != null) ? XSDEditorPlugin.getXSDString(key) : "";
-// }
-//
-// /**
-// * This listener detects which row is selected and add a tool tip for that row
-// */
-// public class MyMouseTrackListener extends MouseTrackAdapter
-// {
-// public void mouseHover(MouseEvent e)
-// {
-// TableItem item = getTable().getItem(new Point(e.x, e.y));
-// if (item != null)
-// {
-// Object o = item.getData();
-// if (o != null)
-// {
-// String facetName = (String) o;
-// getTable().setToolTipText(getToolTip(facetName));
-// }
-// }
-// }
-// }
-//
-// /**
-// * Based on the selection, detects if it is a white space or not, and add the
-// * corresponding cell editors
-// */
-// public class SelectionChangedListener implements ISelectionChangedListener
-// {
-// public void selectionChanged(SelectionChangedEvent event)
-// {
-// Object selection = event.getSelection();
-// if (selection instanceof StructuredSelection)
-// {
-// Object o = ((StructuredSelection) selection).getFirstElement();
-// if (o != null)
-// {
-// String facet = (String) o;
-// if (facet.equals("whiteSpace"))
-// {
-// setCellEditors(altCellEditors);
-// }
-// else
-// {
-// setCellEditors(cellEditors);
-// }
-// }
-// }
-// }
-// }
-//
-// class FacetsTableContentProvider implements IStructuredContentProvider
-// {
-// protected String facet;
-//
-// public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
-// {
-// }
-//
-// public java.lang.Object[] getElements(java.lang.Object inputElement)
-// {
-// List v = new ArrayList();
-// XSDSimpleTypeDefinition inputXSDSimpleType = (XSDSimpleTypeDefinition) inputElement;
-// XSDSimpleTypeDefinition base = inputXSDSimpleType.getPrimitiveTypeDefinition();
-//
-// if (base != null)
-// {
-// Iterator validFacets = inputXSDSimpleType.getValidFacets().iterator();
-// while (validFacets.hasNext())
-// {
-// String aValidFacet = (String) validFacets.next();
-// if (!(aValidFacet.equals("pattern") || aValidFacet.equals("enumeration")))
-// {
-// v.add(aValidFacet);
-// }
-// }
-// }
-// return v.toArray();
-// }
-//
-// public void dispose()
-// {
-// }
-// }
-//
-// class FacetsTableLabelProvider extends LabelProvider implements ITableLabelProvider
-// {
-// public Image getColumnImage(Object element, int columnIndex)
-// {
-// return null;
-// }
-//
-// public String getColumnText(Object element, int columnIndex)
-// {
-// if (element instanceof String)
-// {
-// String value = null;
-// XSDConstrainingFacet targetFacet = getXSDConstrainingFacet((String) element);
-// switch (columnIndex)
-// {
-// case 0:
-// {
-// value = (String) element;
-// break;
-// }
-// case 1:
-// {
-// if (targetFacet == null)
-// {
-// value = "";
-// }
-// else
-// {
-// value = targetFacet.getLexicalValue();
-// }
-//
-// break;
-// }
-// case 2:
-// {
-// if (targetFacet == null)
-// {
-// value = "";
-// }
-// else
-// {
-// Element elem = targetFacet.getElement();
-// value = elem.getAttribute(XSDConstants.FIXED_ATTRIBUTE);
-// if (value == null)
-// value = "";
-// }
-// }
-// }
-// return value;
-// }
-// return "";
-// }
-// }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/IDocumentChangedNotifier.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/IDocumentChangedNotifier.java
deleted file mode 100644
index a72e632f4e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/IDocumentChangedNotifier.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-
-public interface IDocumentChangedNotifier
-{
- public void addListener(INodeAdapter adapter);
- public void removeListener(INodeAdapter adapter);
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java
deleted file mode 100644
index 94593d4068..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateMaxOccursCommand;
-import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateMinOccursCommand;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.xsd.XSDConcreteComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDParticleContent;
-import org.eclipse.xsd.util.XSDConstants;
-import org.w3c.dom.Element;
-
-
-public class MultiplicitySection extends RefactoringSection
-{
- protected CCombo minCombo, maxCombo;
-
- public MultiplicitySection()
- {
- super();
- }
-
- protected void createContents(Composite parent)
- {
- }
-
-
- public void doHandleEvent(Event event)
- {
- if (event.widget == minCombo)
- {
- updateMinAttribute();
- }
- else if (event.widget == maxCombo)
- {
- updateMaxAttribute();
- }
- }
-
- public void doWidgetSelected(SelectionEvent e)
- {
- if (e.widget == minCombo)
- {
- updateMinAttribute();
- }
- else if (e.widget == maxCombo)
- {
- updateMaxAttribute();
- }
- super.doWidgetSelected(e);
- }
-
- protected void updateMaxAttribute()
- {
- setErrorMessage(null);
- XSDParticle particle = null;
-
- if (input instanceof XSDParticleContent)
- {
- particle = getAssociatedParticle((XSDParticleContent) input);
- }
- if (particle != null)
- {
- String newValue = maxCombo.getText().trim();
-
- if (newValue.length() == 0)
- {
- particle.unsetMaxOccurs();
- return;
- }
- try
- {
- int newMax = 1;
- if (newValue.equals("unbounded") || newValue.equals("*")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- newMax = XSDParticle.UNBOUNDED;
- }
- else
- {
- if (newValue.length() > 0)
- {
- newMax = Integer.parseInt(newValue);
- }
- }
- setListenerEnabled(false);
- UpdateMaxOccursCommand command = new UpdateMaxOccursCommand(Messages._UI_ACTION_CHANGE_MAXIMUM_OCCURRENCE, particle, newMax);
- getCommandStack().execute(command);
- setListenerEnabled(true);
-
- }
- catch (NumberFormatException e)
- {
- setErrorMessage(Messages._UI_ERROR_INVALID_VALUE_FOR_MAXIMUM_OCCURRENCE);
- }
- }
- }
-
- protected void updateMinAttribute()
- {
- setErrorMessage(null);
- XSDParticle particle = null;
-
- if (input instanceof XSDParticleContent)
- {
- particle = getAssociatedParticle((XSDParticleContent) input);
- }
- if (particle != null)
- {
- String newValue = minCombo.getText();
- if (newValue.length() == 0)
- {
- particle.unsetMinOccurs();
- }
- try
- {
- int newMin = 1;
- if (newValue.equals("unbounded") || newValue.equals("*")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- newMin = XSDParticle.UNBOUNDED;
- }
- else
- {
- newMin = Integer.parseInt(newValue);
- }
- UpdateMinOccursCommand command = new UpdateMinOccursCommand(Messages._UI_ACTION_CHANGE_MINIMUM_OCCURRENCE, particle, newMin);
- getCommandStack().execute(command);
- }
- catch (NumberFormatException e)
- {
-
- }
- }
- }
-
- protected void refreshMinMax()
- {
- boolean refreshMinText = true;
- boolean refreshMaxText = true;
- if (minCombo.isFocusControl())
- {
- refreshMinText = false;
- }
- if (maxCombo.isFocusControl())
- {
- refreshMaxText = false;
- }
- if (refreshMinText)
- {
- minCombo.setText(""); //$NON-NLS-1$
- }
- if (refreshMaxText)
- {
- maxCombo.setText(""); //$NON-NLS-1$
- }
-
- if (input != null)
- {
- if (input instanceof XSDParticleContent)
- {
- XSDParticle particle = getAssociatedParticle((XSDParticleContent) input);
- if (particle != null)
- {
- // minText.setText(String.valueOf(particle.getMinOccurs()));
- // maxText.setText(String.valueOf(particle.getMaxOccurs()));
- Element element = particle.getElement();
- if (element != null)
- {
- String min = element.getAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
- String max = element.getAttribute(XSDConstants.MAXOCCURS_ATTRIBUTE);
- if (min != null && refreshMinText)
- {
- minCombo.setText(min);
- }
- if (max != null && refreshMaxText)
- {
- maxCombo.setText(max);
- }
- }
- }
- }
- }
- }
-
- protected XSDParticle getAssociatedParticle(XSDParticleContent particleContent)
- {
- XSDConcreteComponent xsdComp = particleContent.getContainer();
- if (xsdComp instanceof XSDParticle)
- {
- return (XSDParticle) xsdComp;
- }
- return null;
- }
-
- public void dispose()
- {
- if (minCombo != null && !minCombo.isDisposed())
- removeListeners(minCombo);
- if (maxCombo != null && !maxCombo.isDisposed())
- removeListeners(maxCombo);
- super.dispose();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java
deleted file mode 100644
index a209eb0a06..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java
+++ /dev/null
@@ -1,93 +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.xsd.ui.internal.common.properties.sections;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
-import org.eclipse.ui.forms.widgets.ImageHyperlink;
-import org.eclipse.wst.xsd.ui.internal.common.util.Messages;
-import org.eclipse.wst.xsd.ui.internal.editor.ISelectionMapper;
-import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
-import org.eclipse.wst.xsd.ui.internal.refactor.actions.RenameComponentAction;
-import org.eclipse.xsd.XSDSchema;
-
-public abstract class RefactoringSection extends AbstractSection implements IHyperlinkListener
-{
- /**
- * Clicking on it invokes the refactor->rename action.
- */
- private ImageHyperlink renameHyperlink;
-
- /**
- * Invokes the refactor->rename action on the current selection.
- */
- private void invokeRenameRefactoring()
- {
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- XSDSchema schema = (XSDSchema) editor.getAdapter(XSDSchema.class);
- ISelection selection = editor.getSite().getSelectionProvider().getSelection();
- ISelectionMapper mapper = (ISelectionMapper) editor.getAdapter(ISelectionMapper.class);
- selection = mapper != null ? mapper.mapSelection(selection) : selection;
- RenameComponentAction action = new RenameComponentAction(selection, schema);
- action.update(selection);
- action.run();
- }
-
- /**
- * Creates the refactor/rename hyperlink shown beside a component name.
- * Clicking on the hyperlink invokes the refactor/rename action.
- *
- * @param parent
- * the parent composite. Must not be null.
- */
- protected void createRenameHyperlink(Composite parent)
- {
- renameHyperlink = getWidgetFactory().createImageHyperlink(parent, SWT.NONE);
-
- renameHyperlink.setImage(XSDEditorPlugin.getXSDImage("icons/quickassist.gif")); //$NON-NLS-1$
- renameHyperlink.setToolTipText(Messages._UI_TOOLTIP_RENAME_REFACTOR);
- renameHyperlink.addHyperlinkListener(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent)
- */
- public void linkActivated(HyperlinkEvent e)
- {
- invokeRenameRefactoring();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent)
- */
- public void linkEntered(HyperlinkEvent e)
- {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkExited(org.eclipse.ui.forms.events.HyperlinkEvent)
- */
- public void linkExited(HyperlinkEvent e)
- {
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SimpleContentUnionMemberTypesDialog.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SimpleContentUnionMemberTypesDialog.java
deleted file mode 100644
index a090be1f09..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SimpleContentUnionMemberTypesDialog.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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