Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
blob: 8b4a9a5518a5f7d0393e3f3de27e1a4b1b41f5a3 (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
/*******************************************************************************
 * Copyright (c) 2006, 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo;

import java.util.StringTokenizer;

import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.wst.xsd.ui.internal.common.commands.ExtensibleAddExtensionCommand;
import org.eclipse.wst.xsd.ui.internal.common.commands.ExtensibleRemoveExtensionNodeCommand;
import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeFilter;

public class SpecificationForExtensionsSchema
{
  private String description;
  private String displayName;
  private String namespaceURI;
  private String location;
  private ILabelProvider labelProvider;
  private boolean isDefaultSchema = false;
  private ExtensibleAddExtensionCommand addCommand;
  private ExtensibleRemoveExtensionNodeCommand removeCommand;
  private NodeFilter nodeFilter;
  private String classification;
  
  /**
   * Either the workspace-relative path of the xsd file or the namespace
   * of the xsd file (if it come from the Catalog) 
   */
  private String sourceHint;
  private boolean fromCatalog;

  public SpecificationForExtensionsSchema()
  {
    super();
  }

  public SpecificationForExtensionsSchema(String desc) {
	StringTokenizer tokenizer = new StringTokenizer(desc, "\t");
	
	// we must be sure that each 'desc' contains info in correct format
	// no error checking here
	description = tokenizer.nextToken();
	displayName = tokenizer.nextToken();
	namespaceURI = tokenizer.nextToken();
	location = tokenizer.nextToken();
	isDefaultSchema = tokenizer.nextToken().equals("true");
	sourceHint = tokenizer.nextToken();
	fromCatalog = tokenizer.nextToken().equals("true");
  }

/**
   * @return Returns the description.
   */
  public String getDescription()
  {
    return description;
  }

  /**
   * @param description
   *          The description to set.
   */
  public void setDescription(String description)
  {
    this.description = description;
  }

  /**
   * @return Returns the displayName.
   */
  public String getDisplayName()
  {
    return displayName;
  }

  /**
   * @param name
   *          The displayName to set.
   */
  public void setDisplayName(String displayName)
  {
    this.displayName = displayName;
  }

  /**
   * @return Returns the namespaceURI.
   */
  public String getNamespaceURI()
  {
    return namespaceURI;
  }

  /**
   * @param namespaceURI
   *          The namespaceURI to set.
   */
  public void setNamespaceURI(String namespaceURI)
  {
    this.namespaceURI = namespaceURI;
  }

  /**
   * @return Returns the location of the xsd file.
   */
  public String getLocation()
  {
    return location;
  }

  /**
   * @param location
   *          The location to be set
   */
  public void setLocation(String location)
  {
    this.location = location;
  }

  public ILabelProvider getLabelProvider()
  {
    return labelProvider;
  }
  
  public void setLabelProvider(ILabelProvider labelProvider)
  {
    this.labelProvider = labelProvider;
  }

  public ExtensibleAddExtensionCommand getExtensibleAddExtensionCommand()
  {
    return addCommand;
  }

  public void setExtensibleAddExtensionCommand(ExtensibleAddExtensionCommand addCommand)
  {
    this.addCommand = addCommand;
  }

  public ExtensibleRemoveExtensionNodeCommand getExtensibleRemoveExtensionNodeCommand()
  {
    return removeCommand;
  }

  public void setExtensibleRemoveExtensionNodeCommand(ExtensibleRemoveExtensionNodeCommand removeCommand)
  {
    this.removeCommand = removeCommand;
  }

  public boolean isDefautSchema(){
	  return isDefaultSchema ;
  }

  public void setDefautSchema(){
	  isDefaultSchema = true;
  }
  
  public void setSourceHint(String s){
	  sourceHint = s;
  }
  
  public String getSourceHint(){
	  return sourceHint;
  }

  public boolean isFromCatalog() {
	return fromCatalog;
  }

  public void setFromCatalog(boolean fromCatalog) {
	this.fromCatalog = fromCatalog;
  }
  
  /**
   * There is no support for setting this via the extension point defined in the plugin.xml
   * This allows extenders to provide a filter for a category that has been added 
   * dynamically (programmatically)
   * @param nodeFilter
   */ 
  public void setNodeFilter(NodeFilter nodeFilter)
  {
    this.nodeFilter = nodeFilter;
  }
  
  /**
   * Get the node filter
   * @return NodeFilter
   */
  public NodeFilter getNodeFilter()
  {
    return nodeFilter;
  }
  
  /**
   * There is no support for setting this via the extension point defined in the plugin.xml
   * This allows extenders to group categories into groups or classificationss  
   * @param classification
   */
  public void setClassification(String classification)
  {
    this.classification = classification;
  }
  
  /**
   * Get the classification
   * @return String
   */
  public String getClassification()
  {
    return classification;
  }
}

Back to the top