Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 80318 | Differences between
and this patch

Collapse All | Expand All

(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/instance/ParseException.java (+205 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.instance;
14
15
import org.eclipse.uml2.diagram.parser.ExternalParserException;
16
17
/**
18
 * This exception is thrown when parse errors are encountered.
19
 * You can explicitly create objects of this exception type by
20
 * calling the method generateParseException in the generated
21
 * parser.
22
 *
23
 * You can modify this class to customize your error reporting
24
 * mechanisms so long as you retain the public fields.
25
 */
26
public class ParseException extends ExternalParserException {
27
28
  /**
29
   * This constructor is used by the method "generateParseException"
30
   * in the generated parser.  Calling this constructor generates
31
   * a new object of this type with the fields "currentToken",
32
   * "expectedTokenSequences", and "tokenImage" set.  The boolean
33
   * flag "specialConstructor" is also set to true to indicate that
34
   * this constructor was used to create this object.
35
   * This constructor calls its super class with the empty string
36
   * to force the "toString" method of parent class "Throwable" to
37
   * print the error message in the form:
38
   *     ParseException: <result of getMessage>
39
   */
40
  public ParseException(Token currentTokenVal,
41
                        int[][] expectedTokenSequencesVal,
42
                        String[] tokenImageVal
43
                       )
44
  {
45
    super("");
46
    specialConstructor = true;
47
    currentToken = currentTokenVal;
48
    expectedTokenSequences = expectedTokenSequencesVal;
49
    tokenImage = tokenImageVal;
50
  }
51
52
  /**
53
   * The following constructors are for use by you for whatever
54
   * purpose you can think of.  Constructing the exception in this
55
   * manner makes the exception behave in the normal way - i.e., as
56
   * documented in the class "Throwable".  The fields "errorToken",
57
   * "expectedTokenSequences", and "tokenImage" do not contain
58
   * relevant information.  The JavaCC generated code does not use
59
   * these constructors.
60
   */
61
62
  public ParseException() {
63
    super();
64
    specialConstructor = false;
65
  }
66
67
  public ParseException(String message) {
68
    super(message);
69
    specialConstructor = false;
70
  }
71
72
  /**
73
   * This variable determines which constructor was used to create
74
   * this object and thereby affects the semantics of the
75
   * "getMessage" method (see below).
76
   */
77
  protected boolean specialConstructor;
78
79
  /**
80
   * This is the last token that has been consumed successfully.  If
81
   * this object has been created due to a parse error, the token
82
   * followng this token will (therefore) be the first error token.
83
   */
84
  public Token currentToken;
85
86
  /**
87
   * Each entry in this array is an array of integers.  Each array
88
   * of integers represents a sequence of tokens (by their ordinal
89
   * values) that is expected at this point of the parse.
90
   */
91
  public int[][] expectedTokenSequences;
92
93
  /**
94
   * This is a reference to the "tokenImage" array of the generated
95
   * parser within which the parse error occurred.  This array is
96
   * defined in the generated ...Constants interface.
97
   */
98
  public String[] tokenImage;
99
100
  /**
101
   * This method has the standard behavior when this object has been
102
   * created using the standard constructors.  Otherwise, it uses
103
   * "currentToken" and "expectedTokenSequences" to generate a parse
104
   * error message and returns it.  If this object has been created
105
   * due to a parse error, and you do not catch it (it gets thrown
106
   * from the parser), then this method is called during the printing
107
   * of the final stack trace, and hence the correct error message
108
   * gets displayed.
109
   */
110
  public String getMessage() {
111
    if (!specialConstructor) {
112
      return super.getMessage();
113
    }
114
    String expected = "";
115
    int maxSize = 0;
116
    for (int i = 0; i < expectedTokenSequences.length; i++) {
117
      if (maxSize < expectedTokenSequences[i].length) {
118
        maxSize = expectedTokenSequences[i].length;
119
      }
120
      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
121
        expected += tokenImage[expectedTokenSequences[i][j]] + " ";
122
      }
123
      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
124
        expected += "...";
125
      }
126
      expected += eol + "    ";
127
    }
128
    String retval = "Encountered \"";
129
    Token tok = currentToken.next;
130
    for (int i = 0; i < maxSize; i++) {
131
      if (i != 0) retval += " ";
132
      if (tok.kind == 0) {
133
        retval += tokenImage[0];
134
        break;
135
      }
136
      retval += add_escapes(tok.image);
137
      tok = tok.next; 
138
    }
139
    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
140
    retval += "." + eol;
141
    if (expectedTokenSequences.length == 1) {
142
      retval += "Was expecting:" + eol + "    ";
143
    } else {
144
      retval += "Was expecting one of:" + eol + "    ";
145
    }
146
    retval += expected;
147
    return retval;
148
  }
149
150
  /**
151
   * The end of line string for this machine.
152
   */
153
  protected String eol = System.getProperty("line.separator", "\n");
154
 
155
  /**
156
   * Used to convert raw characters to their escaped version
157
   * when these raw version cannot be used as part of an ASCII
158
   * string literal.
159
   */
160
  protected String add_escapes(String str) {
161
      StringBuffer retval = new StringBuffer();
162
      char ch;
163
      for (int i = 0; i < str.length(); i++) {
164
        switch (str.charAt(i))
165
        {
166
           case 0 :
167
              continue;
168
           case '\b':
169
              retval.append("\\b");
170
              continue;
171
           case '\t':
172
              retval.append("\\t");
173
              continue;
174
           case '\n':
175
              retval.append("\\n");
176
              continue;
177
           case '\f':
178
              retval.append("\\f");
179
              continue;
180
           case '\r':
181
              retval.append("\\r");
182
              continue;
183
           case '\"':
184
              retval.append("\\\"");
185
              continue;
186
           case '\'':
187
              retval.append("\\\'");
188
              continue;
189
           case '\\':
190
              retval.append("\\\\");
191
              continue;
192
           default:
193
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
194
                 String s = "0000" + Integer.toString(ch, 16);
195
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
196
              } else {
197
                 retval.append(ch);
198
              }
199
              continue;
200
        }
201
      }
202
      return retval.toString();
203
   }
204
205
}
(-).options (+7 lines)
Added Link Here
1
# Debugging options for the org.eclipse.uml2.diagram.clazz plug-in
2
3
# Turn on general debugging for the org.eclipse.uml2.diagram.clazz plug-in
4
org.eclipse.uml2.diagram.clazz/debug=false
5
6
# Turn on debugging of visualID processing
7
org.eclipse.uml2.diagram.clazz/debug/visualID=true
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Package2ViewFactory.java (+58 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageClassifiersEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageNameEditPart;
16
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageOtherEditPart;
17
import org.eclipse.uml2.diagram.clazz.edit.parts.PackagePackagesEditPart;
18
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
19
20
/**
21
 * @generated
22
 */
23
public class Package2ViewFactory extends AbstractShapeViewFactory {
24
25
	/**
26
	 * @generated 
27
	 */
28
	protected List createStyles(View view) {
29
		List styles = new ArrayList();
30
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
31
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
32
		styles.add(NotationFactory.eINSTANCE.createFillStyle());
33
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
34
		return styles;
35
	}
36
37
	/**
38
	 * @generated
39
	 */
40
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
41
		if (semanticHint == null) {
42
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Package2EditPart.VISUAL_ID);
43
			view.setType(semanticHint);
44
		}
45
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(PackageNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
53
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(PackagePackagesEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
54
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(PackageClassifiersEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
55
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(PackageOtherEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
56
	}
57
58
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationClass2ViewFactory.java (+58 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassAttributesEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassClassesEditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassNameEditPart;
16
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassOperationsEditPart;
17
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
18
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
19
20
/**
21
 * @generated
22
 */
23
public class AssociationClass2ViewFactory extends AbstractShapeViewFactory {
24
25
	/**
26
	 * @generated 
27
	 */
28
	protected List createStyles(View view) {
29
		List styles = new ArrayList();
30
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
31
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
32
		styles.add(NotationFactory.eINSTANCE.createFillStyle());
33
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
34
		return styles;
35
	}
36
37
	/**
38
	 * @generated
39
	 */
40
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
41
		if (semanticHint == null) {
42
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClass2EditPart.VISUAL_ID);
43
			view.setType(semanticHint);
44
		}
45
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(AssociationClassNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
53
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(AssociationClassAttributesEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
54
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(AssociationClassOperationsEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
55
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(AssociationClassClassesEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
56
	}
57
58
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/Property4EditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class Property4EditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/EnumerationEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class EnumerationEditHelper extends UMLBaseEditHelper {
7
}
(-)icons/wizban/NewUMLWizard.gif (+8 lines)
Added Link Here
1
GIF89aKBçÿÿÿîñøîñ÷¸ÃÖËÓâËÓáäéòíñø;Z‹=[Œ=[‹Ò輲ٌ™Ìf€À@Ca?Ec’Da?Fc’Fc‘He“Mi–Ok˜Ok—Qm™Rm™TošWqœWq›ZtžZt?]w _y¢`y¢`y¡c{£f~¥i?§lƒ©o†«p†ªs‰­vŒ¯z?±}’³}‘²ƒ—·„—·Š?»‹?¼‘£À’£À’£¿•¦Â™©Ä™©Ãœ¬ÆŸ¯È ¯È ¯Ç¤²Êª¸Î®»Ð·ÃÖ¸Ä×ÂÌÜÈÑàÓÛèÔÛçÖÝéØßêÞäîÜâìæëóäéñ<\Œ>]?=\‹?^Ž?^?A`?Db?Ec‘Ge“Fd‘Jg”Li•Qn™Rn™TpšWrœWr›YtžYt?]wŸ`z¢_y¡`z¡c|£e~¥l„©k„¨sŠ­uŒ¯y?±€•µƒ˜·„˜·‡›¹Šž¼Šž»? ½Ž¡¾Ž¡½‘¤À’¤À‘£¿‘¤¿’¤¿•§Á™ªÄ °ÈŸ¯Ç °Ç£³Ê¦µÌ©¸Î­»Ð®¼Ð±¾Ò´ÁÔ»ÇØ¾ÉÚÁÌÜÇÑàËÔâÍÖäÐÙæÎ×äÓÛçÕÝéÝäîÛâìàæïÞäíìðö˜ªÃœ­ÅŸ°ÈŸ°Ç¦¶Ì­¼Ð·ÄÖ¾ÊÚÄÏÞÈÒàÊÔáÓÜèÐÙåÎ×ãÖÞéäêòâèðêïöèíôÇÒàÍ×ãÓÜçÕÞéØàêßæïÝäíÛâëëðöêïõèíóïóøîò÷æìóäêñèîôíò÷ô®_ôÛ²óáÆ×Ä¥µ³?—£—†›–|•’u‘?c?…ž±²¨·´¼Â¹¼Â¹ÆÇ¶¼¹¬¢›’½ÃÇßàÞÌÆÏÎÈÑÑÌÖÙØãÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ,KBþH° Áƒ*\h0R#Jœ8Ñ!©‹)jÜ(1–€‡/rI’`,‡ Cf,ɲãI”*1¶œ©ðd?)c®¤Éóf,ŸrêìÙӿɠBc?iôhPRIC.-Ù4R¤PuŠœºñ§×›W¡F•Š0—Ù³hÓªMû“áW¯WÃjÝzW2fÉòêÝË·o®[ºp-|û2îçsâjÖ·q¤d?G%£µR$]·#|{3€€?†'F¨K•iÓ­R·Š	’kH£hɞ-›YfÍ
2
;{ý+âÑu“©R­šukZ­]?ZNà̺Lr~ù9ôX™¤U'+¾šõìå±gþÃ?+pfÁ?uû<Y=®Ø¹;ê"n<™åH´c‡ëoù[»ä2ÝzõæÞu	Í·Ýc¬¹É~´@HËx°Ì"
3
`˜f”n/xàut4Ÿq$>H[sRË(·Ýa¶g|ñ¤K‰¬?òÀŽ(ʦ",’$ÓbfÇäÂa‡~_‚‘t÷àŽ4Ð?>þ8^?CBç’ìVRJ(q“9&ó€Q6À€”Tù£$’d˜å\Rçå{‰yÀ«ð9&i$ž‰¦”¬é@›oÂ	fºè2L0
4
ôrL2uv)zò¹Ê¦œ&¸ÚrPښT^	'œà’ËÉ,À0þÂLZi’Oeª)§›ò™?1£@2ٙ¡úÀ”²½"	?pÊäÊÞŀ1»PZi{¤`kŸØfûçAº0§#šÂËf•§Êb.?'Ér2ÑÎ
5
’˜¢ˆ²ç¼¸Ö›P´à	*å¾ãÒb®$æšËe?Ì´Ëå»a†)ïžØÞÊé¶#[lgòËo›þ0’7Á’Œ1Җ§³(ï¼~ÖÛ)B»ÐVñ¾…Ž«ñÆMý$Ë( ‹ŒÉ˜šŒ²Ã¸B\P˳½LèšÄÎ,Ç[J’óo˜’2KÉ¢(q2Ã)k»Ê½.§y4›J¼å[Å4“ÕÎRO?ðÕX«Ü'×E‹jñaËåteë4KþÚ
6
[M/иÂ-› ^Kyh؟iP1Ì@½7É%ûü·Öo³|"áû®tÅkžÙ–@yÇ´·ÚV³Í°ÊºZ~9á;ÖÍù”lX(gç™6Õ¥O¸Ð}"-;Ò]÷Iâzþy³ëÍ·äm»?Ð0¿ËV·Ø±?ª8gÃ4žÓã¤çŽ²Û•ýïÓ/}Ò¡4í¢/ïÂ)k*ÿÖ??[ùæWÿÀWêy5Œˆ	“µ~ö=‡9bSÜÔó𧱗 O=é±IözFÀï­Â¼ 1ÈÁ&„§JVØ:ô@¤ç&ÃXÆÂ q®	Œ¡Ã†`"¤žþ4£Cþ®A‚‡HD!:"	?xˏÄF(1ƒ¼%®àY1vèK‡ò“a #I£??22‘‰F@#3¨@„ôÂ\Â!°l²ÅrQÈc3ôx„fôñ?Íh†)H#ò\ÙAދýYъ?ÜߖzÁ¶à1?˜Ì¤&3Y„B"2?¹JH/ˆW=p™²‘±;á†&ù“Knò•˜ì¤Ùè0Q’Ò”§4UÉKa0–™E3„H#<	ÙÊUøâRZl_¨¤ä$;¥›ø’Í`6µÉMmf“ˆìÓü‡?fàx¦”P©Å±%΀•7¹™Ímb³˜Iþgւ–?f62…
7
h@Q‰Ë‚¾îLÁ`@7ªMbæógnKÝA~qtîò„?Ì(°¢Ô9CË`(=ý¨Oz%óa	ùÅOª¨Qx¨-ŋ¬–AӚzÓ?H°ÖµN§²”¶¥ }©OÎé¹|THUFH±y„œ&Œ€Ê¬WڑŽüãå[‚Œ¤z“Œ?H˜žà×<{$’XBUMجF°­œÈQCÈ$°0jb]Xâ꧂ ­Éè0KØÂö°ˆ=¬0î¹%”¢gy%ë>ÉÉÅX`°¨L^½p6/IÐc’1Ú$0洘4m$ö„¶î™î¤(å?H[‡Š$ÄèR!QÂEH÷>ˆ‚¯#u\åØj;#0¹~{•jBâúÖÊΊ:ЉnyûZÀµñ¬¹¹èKú7-Ü¢
8
rk“,ø¦jÇ]òo¸³ºÔ¤Æ·ª±-¹óŒ4ÍÛ?ÝvF¹½]xш̖­Ïe~U2ºÈ¹wr¿ÝŒI(¹Eô×»»?Zä¼×¶q  ;
(-)src/org/eclipse/uml2/diagram/clazz/navigator/UMLAbstractNavigatorItem.java (+51 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.navigator;
2
3
import org.eclipse.core.runtime.IAdaptable;
4
import org.eclipse.gmf.runtime.diagram.ui.properties.views.IReadOnlyDiagramPropertySheetPageContributor;
5
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
6
7
/**
8
 * @generated
9
 */
10
public abstract class UMLAbstractNavigatorItem implements IAdaptable {
11
12
	/**
13
	 * @generated
14
	 */
15
	private Object myParent;
16
17
	/**
18
	 * @generated
19
	 */
20
	protected UMLAbstractNavigatorItem(Object parent) {
21
		myParent = parent;
22
	}
23
24
	/**
25
	 * @generated
26
	 */
27
	abstract public String getModelID();
28
29
	/**
30
	 * @generated
31
	 */
32
	public Object getParent() {
33
		return myParent;
34
	}
35
36
	/**
37
	 * @generated
38
	 */
39
	public Object getAdapter(Class adapter) {
40
		if (ITabbedPropertySheetPageContributor.class.isAssignableFrom(adapter)) {
41
			return new ITabbedPropertySheetPageContributor() {
42
43
				public String getContributorId() {
44
					return "org.eclipse.uml2.diagram.clazz";
45
				}
46
			};
47
		}
48
		return null;
49
	}
50
51
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/Property2EditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class Property2EditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/LiteralStringViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class LiteralStringViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.LiteralStringEditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/DataTypeOperationsViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class DataTypeOperationsViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeOperationsEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/ClassAttributesViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class ClassAttributesViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.ClassAttributesEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/DataType2ViewFactory.java (+56 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeAttributesEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeNameEditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeOperationsEditPart;
16
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
17
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
18
19
/**
20
 * @generated
21
 */
22
public class DataType2ViewFactory extends AbstractShapeViewFactory {
23
24
	/**
25
	 * @generated 
26
	 */
27
	protected List createStyles(View view) {
28
		List styles = new ArrayList();
29
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
30
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFillStyle());
32
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
33
		return styles;
34
	}
35
36
	/**
37
	 * @generated
38
	 */
39
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
40
		if (semanticHint == null) {
41
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.DataType2EditPart.VISUAL_ID);
42
			view.setType(semanticHint);
43
		}
44
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
45
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
46
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
47
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
48
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
49
			view.getEAnnotations().add(shortcutAnnotation);
50
		}
51
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(DataTypeNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
52
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(DataTypeAttributesEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
53
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(DataTypeOperationsEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
54
	}
55
56
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/EnumerationViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class EnumerationViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationEditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/SlotEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class SlotEditHelper extends UMLBaseEditHelper {
7
}
(-)icons/incomingLinksNavigatorGroup.gif (+5 lines)
Added Link Here
1
GIF89aÕÿÿ­r/‚GøØˆžf'øÐxøà˜øÐ€f>2èÆ”øè°èЈøðÈÿÿÿË6úöºøà øØ?Œ]Føè˜Ò«€üößãϹ´2àÀx­r+ðØ?¥l$yO@ž_­l$?R¼2ï߯¼…2Å6!ù,s@€pH,?È#âèh:‚¨T0ô4®
2
‹à‘?p©€Ñd¢Y`B‚¡‹p8G AØ%‚%HÁçW¶	_B†‰Š‹?’“’š??–B¥¦¥ B­®­©C³´µI·¸FA;Content-Type: image/gif
3
4
GIF89aÕÿÿ­r/‚GøØˆžf'øÐxøà˜øÐ€f>2èÆ”øè°èЈøðÈÿÿÿË6úöºøà øØ?Œ]Føè˜Ò«€üößãϹ´2àÀx­r+ðØ?¥l$yO@ž_­l$?R¼2ï߯¼…2Å6!ù,s@€pH,?È#âèh:‚¨T0ô4®
5
‹à‘?p©€Ñd¢Y`B‚¡‹p8G AØ%‚%HÁçW¶	_B†‰Š‹?’“’š??–B¥¦¥ B­®­©C³´µI·¸FA;
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/operation/ParseException.java (+205 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.operation;
14
15
import org.eclipse.uml2.diagram.parser.ExternalParserException;
16
17
/**
18
 * This exception is thrown when parse errors are encountered.
19
 * You can explicitly create objects of this exception type by
20
 * calling the method generateParseException in the generated
21
 * parser.
22
 *
23
 * You can modify this class to customize your error reporting
24
 * mechanisms so long as you retain the public fields.
25
 */
26
public class ParseException extends ExternalParserException {
27
28
  /**
29
   * This constructor is used by the method "generateParseException"
30
   * in the generated parser.  Calling this constructor generates
31
   * a new object of this type with the fields "currentToken",
32
   * "expectedTokenSequences", and "tokenImage" set.  The boolean
33
   * flag "specialConstructor" is also set to true to indicate that
34
   * this constructor was used to create this object.
35
   * This constructor calls its super class with the empty string
36
   * to force the "toString" method of parent class "Throwable" to
37
   * print the error message in the form:
38
   *     ParseException: <result of getMessage>
39
   */
40
  public ParseException(Token currentTokenVal,
41
                        int[][] expectedTokenSequencesVal,
42
                        String[] tokenImageVal
43
                       )
44
  {
45
    super("");
46
    specialConstructor = true;
47
    currentToken = currentTokenVal;
48
    expectedTokenSequences = expectedTokenSequencesVal;
49
    tokenImage = tokenImageVal;
50
  }
51
52
  /**
53
   * The following constructors are for use by you for whatever
54
   * purpose you can think of.  Constructing the exception in this
55
   * manner makes the exception behave in the normal way - i.e., as
56
   * documented in the class "Throwable".  The fields "errorToken",
57
   * "expectedTokenSequences", and "tokenImage" do not contain
58
   * relevant information.  The JavaCC generated code does not use
59
   * these constructors.
60
   */
61
62
  public ParseException() {
63
    super();
64
    specialConstructor = false;
65
  }
66
67
  public ParseException(String message) {
68
    super(message);
69
    specialConstructor = false;
70
  }
71
72
  /**
73
   * This variable determines which constructor was used to create
74
   * this object and thereby affects the semantics of the
75
   * "getMessage" method (see below).
76
   */
77
  protected boolean specialConstructor;
78
79
  /**
80
   * This is the last token that has been consumed successfully.  If
81
   * this object has been created due to a parse error, the token
82
   * followng this token will (therefore) be the first error token.
83
   */
84
  public Token currentToken;
85
86
  /**
87
   * Each entry in this array is an array of integers.  Each array
88
   * of integers represents a sequence of tokens (by their ordinal
89
   * values) that is expected at this point of the parse.
90
   */
91
  public int[][] expectedTokenSequences;
92
93
  /**
94
   * This is a reference to the "tokenImage" array of the generated
95
   * parser within which the parse error occurred.  This array is
96
   * defined in the generated ...Constants interface.
97
   */
98
  public String[] tokenImage;
99
100
  /**
101
   * This method has the standard behavior when this object has been
102
   * created using the standard constructors.  Otherwise, it uses
103
   * "currentToken" and "expectedTokenSequences" to generate a parse
104
   * error message and returns it.  If this object has been created
105
   * due to a parse error, and you do not catch it (it gets thrown
106
   * from the parser), then this method is called during the printing
107
   * of the final stack trace, and hence the correct error message
108
   * gets displayed.
109
   */
110
  public String getMessage() {
111
    if (!specialConstructor) {
112
      return super.getMessage();
113
    }
114
    String expected = "";
115
    int maxSize = 0;
116
    for (int i = 0; i < expectedTokenSequences.length; i++) {
117
      if (maxSize < expectedTokenSequences[i].length) {
118
        maxSize = expectedTokenSequences[i].length;
119
      }
120
      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
121
        expected += tokenImage[expectedTokenSequences[i][j]] + " ";
122
      }
123
      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
124
        expected += "...";
125
      }
126
      expected += eol + "    ";
127
    }
128
    String retval = "Encountered \"";
129
    Token tok = currentToken.next;
130
    for (int i = 0; i < maxSize; i++) {
131
      if (i != 0) retval += " ";
132
      if (tok.kind == 0) {
133
        retval += tokenImage[0];
134
        break;
135
      }
136
      retval += add_escapes(tok.image);
137
      tok = tok.next; 
138
    }
139
    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
140
    retval += "." + eol;
141
    if (expectedTokenSequences.length == 1) {
142
      retval += "Was expecting:" + eol + "    ";
143
    } else {
144
      retval += "Was expecting one of:" + eol + "    ";
145
    }
146
    retval += expected;
147
    return retval;
148
  }
149
150
  /**
151
   * The end of line string for this machine.
152
   */
153
  protected String eol = System.getProperty("line.separator", "\n");
154
 
155
  /**
156
   * Used to convert raw characters to their escaped version
157
   * when these raw version cannot be used as part of an ASCII
158
   * string literal.
159
   */
160
  protected String add_escapes(String str) {
161
      StringBuffer retval = new StringBuffer();
162
      char ch;
163
      for (int i = 0; i < str.length(); i++) {
164
        switch (str.charAt(i))
165
        {
166
           case 0 :
167
              continue;
168
           case '\b':
169
              retval.append("\\b");
170
              continue;
171
           case '\t':
172
              retval.append("\\t");
173
              continue;
174
           case '\n':
175
              retval.append("\\n");
176
              continue;
177
           case '\f':
178
              retval.append("\\f");
179
              continue;
180
           case '\r':
181
              retval.append("\\r");
182
              continue;
183
           case '\"':
184
              retval.append("\\\"");
185
              continue;
186
           case '\'':
187
              retval.append("\\\'");
188
              continue;
189
           case '\\':
190
              retval.append("\\\\");
191
              continue;
192
           default:
193
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
194
                 String s = "0000" + Integer.toString(ch, 16);
195
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
196
              } else {
197
                 retval.append(ch);
198
              }
199
              continue;
200
        }
201
      }
202
      return retval.toString();
203
   }
204
205
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/name/AssociationNameParser.java (+250 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. AssociationNameParser.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.name;
14
15
import java.io.*;
16
import org.eclipse.emf.ecore.EClass;
17
import org.eclipse.emf.ecore.EObject;
18
import org.eclipse.uml2.diagram.parser.*;
19
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
20
import org.eclipse.uml2.uml.*;
21
22
public class AssociationNameParser extends ExternalParserBase implements AssociationNameParserConstants {
23
        private Association mySubject;
24
25
    public AssociationNameParser(){
26
        this(new StringReader(""));
27
    }
28
29
    public AssociationNameParser(LookupSuite lookup){
30
        this();
31
        setLookupSuite(lookup);
32
    }
33
34
        public EClass getSubjectClass(){
35
                return UMLPackage.eINSTANCE.getAssociation();
36
        }
37
38
        public void parse(EObject target, String text) throws ExternalParserException {
39
                checkContext();
40
                ReInit(new StringReader(text));
41
                mySubject = (Association)target;
42
                Declaration();
43
                mySubject = null;
44
        }
45
46
        protected static int parseInt(Token t) throws ParseException {
47
                if (t.kind != AssociationNameParserConstants.INTEGER_LITERAL){
48
                        throw new IllegalStateException("Token: " + t + ", image: " + t.image);
49
                }
50
                try {
51
                        return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
52
                } catch (NumberFormatException e){
53
                        throw new ParseException("Not supported integer value:" + t.image);
54
                }
55
        }
56
57
  final public void Declaration() throws ParseException {
58
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
59
    case SLASH:
60
      IsDerived();
61
      break;
62
    default:
63
      jj_la1[0] = jj_gen;
64
      ;
65
    }
66
    AssociationName();
67
    jj_consume_token(0);
68
  }
69
70
  final public void AssociationName() throws ParseException {
71
        String name;
72
    name = NameWithSpaces();
73
                mySubject.setName(name);
74
  }
75
76
  final public void IsDerived() throws ParseException {
77
    jj_consume_token(SLASH);
78
                  mySubject.setIsDerived(true);
79
  }
80
81
  final public String NameWithSpaces() throws ParseException {
82
        StringBuffer result = new StringBuffer();
83
        Token t;
84
    t = jj_consume_token(IDENTIFIER);
85
                                   result.append(t.image);
86
    label_1:
87
    while (true) {
88
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
89
      case IDENTIFIER:
90
        ;
91
        break;
92
      default:
93
        jj_la1[1] = jj_gen;
94
        break label_1;
95
      }
96
      t = jj_consume_token(IDENTIFIER);
97
                                     result.append(' '); result.append(t.image);
98
    }
99
                {if (true) return result.toString();}
100
    throw new Error("Missing return statement in function");
101
  }
102
103
  public AssociationNameParserTokenManager token_source;
104
  JavaCharStream jj_input_stream;
105
  public Token token, jj_nt;
106
  private int jj_ntk;
107
  private int jj_gen;
108
  final private int[] jj_la1 = new int[2];
109
  static private int[] jj_la1_0;
110
  static {
111
      jj_la1_0();
112
   }
113
   private static void jj_la1_0() {
114
      jj_la1_0 = new int[] {0x8,0x4000000,};
115
   }
116
117
  public AssociationNameParser(java.io.InputStream stream) {
118
    jj_input_stream = new JavaCharStream(stream, 1, 1);
119
    token_source = new AssociationNameParserTokenManager(jj_input_stream);
120
    token = new Token();
121
    jj_ntk = -1;
122
    jj_gen = 0;
123
    for (int i = 0; i < 2; i++) jj_la1[i] = -1;
124
  }
125
126
  public void ReInit(java.io.InputStream stream) {
127
    jj_input_stream.ReInit(stream, 1, 1);
128
    token_source.ReInit(jj_input_stream);
129
    token = new Token();
130
    jj_ntk = -1;
131
    jj_gen = 0;
132
    for (int i = 0; i < 2; i++) jj_la1[i] = -1;
133
  }
134
135
  public AssociationNameParser(java.io.Reader stream) {
136
    jj_input_stream = new JavaCharStream(stream, 1, 1);
137
    token_source = new AssociationNameParserTokenManager(jj_input_stream);
138
    token = new Token();
139
    jj_ntk = -1;
140
    jj_gen = 0;
141
    for (int i = 0; i < 2; i++) jj_la1[i] = -1;
142
  }
143
144
  public void ReInit(java.io.Reader stream) {
145
    jj_input_stream.ReInit(stream, 1, 1);
146
    token_source.ReInit(jj_input_stream);
147
    token = new Token();
148
    jj_ntk = -1;
149
    jj_gen = 0;
150
    for (int i = 0; i < 2; i++) jj_la1[i] = -1;
151
  }
152
153
  public AssociationNameParser(AssociationNameParserTokenManager tm) {
154
    token_source = tm;
155
    token = new Token();
156
    jj_ntk = -1;
157
    jj_gen = 0;
158
    for (int i = 0; i < 2; i++) jj_la1[i] = -1;
159
  }
160
161
  public void ReInit(AssociationNameParserTokenManager tm) {
162
    token_source = tm;
163
    token = new Token();
164
    jj_ntk = -1;
165
    jj_gen = 0;
166
    for (int i = 0; i < 2; i++) jj_la1[i] = -1;
167
  }
168
169
  final private Token jj_consume_token(int kind) throws ParseException {
170
    Token oldToken;
171
    if ((oldToken = token).next != null) token = token.next;
172
    else token = token.next = token_source.getNextToken();
173
    jj_ntk = -1;
174
    if (token.kind == kind) {
175
      jj_gen++;
176
      return token;
177
    }
178
    token = oldToken;
179
    jj_kind = kind;
180
    throw generateParseException();
181
  }
182
183
  final public Token getNextToken() {
184
    if (token.next != null) token = token.next;
185
    else token = token.next = token_source.getNextToken();
186
    jj_ntk = -1;
187
    jj_gen++;
188
    return token;
189
  }
190
191
  final public Token getToken(int index) {
192
    Token t = token;
193
    for (int i = 0; i < index; i++) {
194
      if (t.next != null) t = t.next;
195
      else t = t.next = token_source.getNextToken();
196
    }
197
    return t;
198
  }
199
200
  final private int jj_ntk() {
201
    if ((jj_nt=token.next) == null)
202
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
203
    else
204
      return (jj_ntk = jj_nt.kind);
205
  }
206
207
  private java.util.Vector jj_expentries = new java.util.Vector();
208
  private int[] jj_expentry;
209
  private int jj_kind = -1;
210
211
  public ParseException generateParseException() {
212
    jj_expentries.removeAllElements();
213
    boolean[] la1tokens = new boolean[29];
214
    for (int i = 0; i < 29; i++) {
215
      la1tokens[i] = false;
216
    }
217
    if (jj_kind >= 0) {
218
      la1tokens[jj_kind] = true;
219
      jj_kind = -1;
220
    }
221
    for (int i = 0; i < 2; i++) {
222
      if (jj_la1[i] == jj_gen) {
223
        for (int j = 0; j < 32; j++) {
224
          if ((jj_la1_0[i] & (1<<j)) != 0) {
225
            la1tokens[j] = true;
226
          }
227
        }
228
      }
229
    }
230
    for (int i = 0; i < 29; i++) {
231
      if (la1tokens[i]) {
232
        jj_expentry = new int[1];
233
        jj_expentry[0] = i;
234
        jj_expentries.addElement(jj_expentry);
235
      }
236
    }
237
    int[][] exptokseq = new int[jj_expentries.size()][];
238
    for (int i = 0; i < jj_expentries.size(); i++) {
239
      exptokseq[i] = (int[])jj_expentries.elementAt(i);
240
    }
241
    return new ParseException(token, exptokseq, tokenImage);
242
  }
243
244
  final public void enable_tracing() {
245
  }
246
247
  final public void disable_tracing() {
248
  }
249
250
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/UsageEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class UsageEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/DataTypeNameViewFactory.java (+29 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory;
8
import org.eclipse.gmf.runtime.notation.View;
9
10
/**
11
 * @generated
12
 */
13
public class DataTypeNameViewFactory extends BasicNodeViewFactory {
14
15
	/**
16
	 * @generated
17
	 */
18
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
19
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
20
	}
21
22
	/**
23
	 * @generated
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		return styles;
28
	}
29
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/ClassEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class ClassEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/Property3EditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class Property3EditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Package3ViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class Package3ViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Package3EditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/EnumerationLiteralsViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class EnumerationLiteralsViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationLiteralsEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/end/ParseException.java (+205 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.end;
14
15
import org.eclipse.uml2.diagram.parser.ExternalParserException;
16
17
/**
18
 * This exception is thrown when parse errors are encountered.
19
 * You can explicitly create objects of this exception type by
20
 * calling the method generateParseException in the generated
21
 * parser.
22
 *
23
 * You can modify this class to customize your error reporting
24
 * mechanisms so long as you retain the public fields.
25
 */
26
public class ParseException extends ExternalParserException {
27
28
  /**
29
   * This constructor is used by the method "generateParseException"
30
   * in the generated parser.  Calling this constructor generates
31
   * a new object of this type with the fields "currentToken",
32
   * "expectedTokenSequences", and "tokenImage" set.  The boolean
33
   * flag "specialConstructor" is also set to true to indicate that
34
   * this constructor was used to create this object.
35
   * This constructor calls its super class with the empty string
36
   * to force the "toString" method of parent class "Throwable" to
37
   * print the error message in the form:
38
   *     ParseException: <result of getMessage>
39
   */
40
  public ParseException(Token currentTokenVal,
41
                        int[][] expectedTokenSequencesVal,
42
                        String[] tokenImageVal
43
                       )
44
  {
45
    super("");
46
    specialConstructor = true;
47
    currentToken = currentTokenVal;
48
    expectedTokenSequences = expectedTokenSequencesVal;
49
    tokenImage = tokenImageVal;
50
  }
51
52
  /**
53
   * The following constructors are for use by you for whatever
54
   * purpose you can think of.  Constructing the exception in this
55
   * manner makes the exception behave in the normal way - i.e., as
56
   * documented in the class "Throwable".  The fields "errorToken",
57
   * "expectedTokenSequences", and "tokenImage" do not contain
58
   * relevant information.  The JavaCC generated code does not use
59
   * these constructors.
60
   */
61
62
  public ParseException() {
63
    super();
64
    specialConstructor = false;
65
  }
66
67
  public ParseException(String message) {
68
    super(message);
69
    specialConstructor = false;
70
  }
71
72
  /**
73
   * This variable determines which constructor was used to create
74
   * this object and thereby affects the semantics of the
75
   * "getMessage" method (see below).
76
   */
77
  protected boolean specialConstructor;
78
79
  /**
80
   * This is the last token that has been consumed successfully.  If
81
   * this object has been created due to a parse error, the token
82
   * followng this token will (therefore) be the first error token.
83
   */
84
  public Token currentToken;
85
86
  /**
87
   * Each entry in this array is an array of integers.  Each array
88
   * of integers represents a sequence of tokens (by their ordinal
89
   * values) that is expected at this point of the parse.
90
   */
91
  public int[][] expectedTokenSequences;
92
93
  /**
94
   * This is a reference to the "tokenImage" array of the generated
95
   * parser within which the parse error occurred.  This array is
96
   * defined in the generated ...Constants interface.
97
   */
98
  public String[] tokenImage;
99
100
  /**
101
   * This method has the standard behavior when this object has been
102
   * created using the standard constructors.  Otherwise, it uses
103
   * "currentToken" and "expectedTokenSequences" to generate a parse
104
   * error message and returns it.  If this object has been created
105
   * due to a parse error, and you do not catch it (it gets thrown
106
   * from the parser), then this method is called during the printing
107
   * of the final stack trace, and hence the correct error message
108
   * gets displayed.
109
   */
110
  public String getMessage() {
111
    if (!specialConstructor) {
112
      return super.getMessage();
113
    }
114
    String expected = "";
115
    int maxSize = 0;
116
    for (int i = 0; i < expectedTokenSequences.length; i++) {
117
      if (maxSize < expectedTokenSequences[i].length) {
118
        maxSize = expectedTokenSequences[i].length;
119
      }
120
      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
121
        expected += tokenImage[expectedTokenSequences[i][j]] + " ";
122
      }
123
      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
124
        expected += "...";
125
      }
126
      expected += eol + "    ";
127
    }
128
    String retval = "Encountered \"";
129
    Token tok = currentToken.next;
130
    for (int i = 0; i < maxSize; i++) {
131
      if (i != 0) retval += " ";
132
      if (tok.kind == 0) {
133
        retval += tokenImage[0];
134
        break;
135
      }
136
      retval += add_escapes(tok.image);
137
      tok = tok.next; 
138
    }
139
    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
140
    retval += "." + eol;
141
    if (expectedTokenSequences.length == 1) {
142
      retval += "Was expecting:" + eol + "    ";
143
    } else {
144
      retval += "Was expecting one of:" + eol + "    ";
145
    }
146
    retval += expected;
147
    return retval;
148
  }
149
150
  /**
151
   * The end of line string for this machine.
152
   */
153
  protected String eol = System.getProperty("line.separator", "\n");
154
 
155
  /**
156
   * Used to convert raw characters to their escaped version
157
   * when these raw version cannot be used as part of an ASCII
158
   * string literal.
159
   */
160
  protected String add_escapes(String str) {
161
      StringBuffer retval = new StringBuffer();
162
      char ch;
163
      for (int i = 0; i < str.length(); i++) {
164
        switch (str.charAt(i))
165
        {
166
           case 0 :
167
              continue;
168
           case '\b':
169
              retval.append("\\b");
170
              continue;
171
           case '\t':
172
              retval.append("\\t");
173
              continue;
174
           case '\n':
175
              retval.append("\\n");
176
              continue;
177
           case '\f':
178
              retval.append("\\f");
179
              continue;
180
           case '\r':
181
              retval.append("\\r");
182
              continue;
183
           case '\"':
184
              retval.append("\\\"");
185
              continue;
186
           case '\'':
187
              retval.append("\\\'");
188
              continue;
189
           case '\\':
190
              retval.append("\\\\");
191
              continue;
192
           default:
193
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
194
                 String s = "0000" + Integer.toString(ch, 16);
195
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
196
              } else {
197
                 retval.append(ch);
198
              }
199
              continue;
200
        }
201
      }
202
      return retval.toString();
203
   }
204
205
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLDiagramEditor.java (+207 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import org.eclipse.core.resources.IFile;
4
import org.eclipse.core.resources.IMarker;
5
import org.eclipse.core.resources.IWorkspaceRoot;
6
import org.eclipse.core.resources.ResourcesPlugin;
7
import org.eclipse.core.runtime.CoreException;
8
import org.eclipse.core.runtime.IPath;
9
import org.eclipse.core.runtime.IProgressMonitor;
10
import org.eclipse.core.runtime.IStatus;
11
import org.eclipse.core.runtime.NullProgressMonitor;
12
import org.eclipse.draw2d.DelegatingLayout;
13
import org.eclipse.draw2d.FreeformLayer;
14
import org.eclipse.draw2d.LayeredPane;
15
import org.eclipse.emf.transaction.TransactionalEditingDomain;
16
import org.eclipse.gef.LayerConstants;
17
import org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService;
18
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
19
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart;
20
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
21
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.document.StorageDiagramDocumentProvider;
22
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor;
23
import org.eclipse.jface.dialogs.ErrorDialog;
24
import org.eclipse.jface.dialogs.IMessageProvider;
25
import org.eclipse.jface.dialogs.MessageDialog;
26
import org.eclipse.jface.window.Window;
27
import org.eclipse.osgi.util.NLS;
28
import org.eclipse.swt.widgets.Shell;
29
import org.eclipse.ui.IEditorInput;
30
import org.eclipse.ui.IEditorMatchingStrategy;
31
import org.eclipse.ui.IEditorReference;
32
import org.eclipse.ui.IFileEditorInput;
33
import org.eclipse.ui.PlatformUI;
34
import org.eclipse.ui.dialogs.SaveAsDialog;
35
import org.eclipse.ui.ide.IGotoMarker;
36
import org.eclipse.ui.part.FileEditorInput;
37
import org.eclipse.uml2.diagram.clazz.edit.parts.UMLEditPartFactory;
38
39
/**
40
 * @generated
41
 */
42
public class UMLDiagramEditor extends DiagramDocumentEditor implements IGotoMarker {
43
44
	/**
45
	 * @generated
46
	 */
47
	public static final String ID = "org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorID"; //$NON-NLS-1$
48
49
	/**
50
	 * @generated
51
	 */
52
	public UMLDiagramEditor() {
53
		super(true);
54
	}
55
56
	/**
57
	 * @generated
58
	 */
59
	protected String getEditingDomainID() {
60
		return "org.eclipse.uml2.diagram.clazz.EditingDomain"; //$NON-NLS-1$
61
	}
62
63
	/**
64
	 * @generated
65
	 */
66
	protected TransactionalEditingDomain createEditingDomain() {
67
		TransactionalEditingDomain domain = super.createEditingDomain();
68
		domain.setID(getEditingDomainID());
69
		return domain;
70
	}
71
72
	/**
73
	 * @generated
74
	 */
75
	protected void configureGraphicalViewer() {
76
		super.configureGraphicalViewer();
77
		DiagramRootEditPart root = (DiagramRootEditPart) getDiagramGraphicalViewer().getRootEditPart();
78
		LayeredPane printableLayers = (LayeredPane) root.getLayer(LayerConstants.PRINTABLE_LAYERS);
79
		FreeformLayer extLabelsLayer = new FreeformLayer();
80
		extLabelsLayer.setLayoutManager(new DelegatingLayout());
81
		printableLayers.addLayerAfter(extLabelsLayer, UMLEditPartFactory.EXTERNAL_NODE_LABELS_LAYER, LayerConstants.PRIMARY_LAYER);
82
		LayeredPane scalableLayers = (LayeredPane) root.getLayer(LayerConstants.SCALABLE_LAYERS);
83
		FreeformLayer scaledFeedbackLayer = new FreeformLayer();
84
		scaledFeedbackLayer.setEnabled(false);
85
		scalableLayers.addLayerAfter(scaledFeedbackLayer, LayerConstants.SCALED_FEEDBACK_LAYER, DiagramRootEditPart.DECORATION_UNPRINTABLE_LAYER);
86
	}
87
88
	/**
89
	 * @generated
90
	 */
91
	protected PreferencesHint getPreferencesHint() {
92
		return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
93
	}
94
95
	/**
96
	 * @generated
97
	 */
98
	public String getContributorId() {
99
		return UMLDiagramEditorPlugin.ID;
100
	}
101
102
	/**
103
	 * @generated
104
	 */
105
	private String contentObjectURI;
106
107
	/**
108
	 * @generated
109
	 */
110
	protected void setDocumentProvider(IEditorInput input) {
111
		if (input instanceof IFileEditorInput) {
112
			setDocumentProvider(new UMLDocumentProvider(contentObjectURI));
113
		} else {
114
			setDocumentProvider(new StorageDiagramDocumentProvider());
115
		}
116
	}
117
118
	/**
119
	 * @generated
120
	 */
121
	public void gotoMarker(IMarker marker) {
122
		MarkerNavigationService.getInstance().gotoMarker(this, marker);
123
	}
124
125
	/**
126
	 * @generated
127
	 */
128
	public boolean isSaveAsAllowed() {
129
		return true;
130
	}
131
132
	/**
133
	 * @generated
134
	 */
135
	public void doSaveAs() {
136
		performSaveAs(new NullProgressMonitor());
137
	}
138
139
	/**
140
	 * @generated
141
	 */
142
	protected void performSaveAs(IProgressMonitor progressMonitor) {
143
		Shell shell = getSite().getShell();
144
		IEditorInput input = getEditorInput();
145
		SaveAsDialog dialog = new SaveAsDialog(shell);
146
		IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
147
		if (original != null) {
148
			dialog.setOriginalFile(original);
149
		}
150
		dialog.create();
151
		IDocumentProvider provider = getDocumentProvider();
152
		if (provider == null) {
153
			// editor has been programmatically closed while the dialog was open
154
			return;
155
		}
156
		if (provider.isDeleted(input) && original != null) {
157
			String message = NLS.bind("The original file ''{0}'' has been deleted.", original.getName());
158
			dialog.setErrorMessage(null);
159
			dialog.setMessage(message, IMessageProvider.WARNING);
160
		}
161
		if (dialog.open() == Window.CANCEL) {
162
			if (progressMonitor != null) {
163
				progressMonitor.setCanceled(true);
164
			}
165
			return;
166
		}
167
		IPath filePath = dialog.getResult();
168
		if (filePath == null) {
169
			if (progressMonitor != null) {
170
				progressMonitor.setCanceled(true);
171
			}
172
			return;
173
		}
174
		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
175
		IFile file = workspaceRoot.getFile(filePath);
176
		final IEditorInput newInput = new FileEditorInput(file);
177
		// Check if the editor is already open
178
		IEditorMatchingStrategy matchingStrategy = getEditorDescriptor().getEditorMatchingStrategy();
179
		IEditorReference[] editorRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
180
		for (int i = 0; i < editorRefs.length; i++) {
181
			if (matchingStrategy.matches(editorRefs[i], newInput)) {
182
				MessageDialog.openWarning(shell, "Problem During Save As...", "Save could not be completed. Target file is already open in another editor.");
183
				return;
184
			}
185
		}
186
		boolean success = false;
187
		try {
188
			provider.aboutToChange(newInput);
189
			getDocumentProvider(newInput).saveDocument(progressMonitor, newInput, getDocumentProvider().getDocument(getEditorInput()), true);
190
			success = true;
191
		} catch (CoreException x) {
192
			IStatus status = x.getStatus();
193
			if (status == null || status.getSeverity() != IStatus.CANCEL) {
194
				ErrorDialog.openError(shell, "Save Problems", "Could not save file.", x.getStatus());
195
			}
196
		} finally {
197
			provider.changed(newInput);
198
			if (success) {
199
				setInput(newInput);
200
			}
201
		}
202
		if (progressMonitor != null) {
203
			progressMonitor.setCanceled(!success);
204
		}
205
	}
206
207
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/InterfaceRealizationViewFactory.java (+48 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
10
import org.eclipse.gmf.runtime.notation.NotationFactory;
11
import org.eclipse.gmf.runtime.notation.View;
12
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
13
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
14
15
/**
16
 * @generated
17
 */
18
public class InterfaceRealizationViewFactory extends ConnectionViewFactory {
19
20
	/**
21
	 * @generated 
22
	 */
23
	protected List createStyles(View view) {
24
		List styles = new ArrayList();
25
		styles.add(NotationFactory.eINSTANCE.createRoutingStyle());
26
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
27
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
28
		return styles;
29
	}
30
31
	/**
32
	 * @generated
33
	 */
34
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
35
		if (semanticHint == null) {
36
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceRealizationEditPart.VISUAL_ID);
37
			view.setType(semanticHint);
38
		}
39
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
40
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
41
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
42
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
43
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
44
			view.getEAnnotations().add(shortcutAnnotation);
45
		}
46
	}
47
48
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationName6ViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class AssociationName6ViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(15));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/ClassEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class ClassEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/operation/OperationInplaceApplier.java (+54 lines)
Added Link Here
1
/*
2
 * Copyright (c) 2006 Borland Software Corporation
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    Michael Golubev (Borland) - initial API and implementation
11
 */
12
13
package org.eclipse.uml2.diagram.clazz.parser.operation;
14
15
import java.util.LinkedList;
16
import java.util.List;
17
18
import org.eclipse.emf.ecore.EObject;
19
import org.eclipse.uml2.diagram.parser.ApplyStrategy;
20
import org.eclipse.uml2.diagram.parser.BasicApplyStrategy;
21
import org.eclipse.uml2.uml.Operation;
22
import org.eclipse.uml2.uml.UMLPackage;
23
24
public class OperationInplaceApplier extends BasicApplyStrategy implements ApplyStrategy {
25
	private static final UMLPackage UML = UMLPackage.eINSTANCE;
26
	
27
	public List/*1.5 <ICommand>*/ apply(EObject modelObject, EObject parsedObject) {
28
		List output = new LinkedList();
29
		assertOperation(modelObject);
30
		assertOperation(parsedObject);
31
		Operation model = (Operation)modelObject;
32
		Operation parsed = (Operation)parsedObject;
33
		
34
		transferValue(output, model, parsed, UML.getNamedElement_Visibility());
35
		transferValue(output, model, parsed, UML.getNamedElement_Name());
36
		transferValue(output, model, parsed, UML.getOperation_IsQuery());
37
		transferValue(output, model, parsed, UML.getOperation_IsOrdered());
38
		transferValue(output, model, parsed, UML.getOperation_IsUnique());
39
		transferValue(output, model, parsed, UML.getRedefinableElement_RedefinedElement());
40
41
		//XXX parameters may have incoming references, try to preserve them
42
		//match parameters and transfer their features one by one instead of total delete-create
43
		transferValue(output, model, parsed, UML.getBehavioralFeature_OwnedParameter());
44
		
45
		return output.isEmpty() ? NOT_EXECUTABLE : output;
46
	}
47
	
48
	protected void assertOperation(EObject object){
49
		if (false == object instanceof Operation){
50
			throw new IllegalStateException("Operation expected: " + object);
51
		}
52
	}
53
	
54
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/commands/UMLReorientConnectionViewCommand.java (+69 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.commands;
2
3
import java.util.List;
4
5
import org.eclipse.core.runtime.IAdaptable;
6
import org.eclipse.core.runtime.IProgressMonitor;
7
import org.eclipse.emf.transaction.TransactionalEditingDomain;
8
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
9
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
10
import org.eclipse.gmf.runtime.notation.Edge;
11
import org.eclipse.gmf.runtime.notation.View;
12
13
/**
14
 * @generated
15
 */
16
public class UMLReorientConnectionViewCommand extends AbstractTransactionalCommand {
17
18
	/**
19
	 * @generated
20
	 */
21
	private IAdaptable edgeAdaptor;
22
23
	/**
24
	 * @generated
25
	 */
26
	public UMLReorientConnectionViewCommand(TransactionalEditingDomain editingDomain, String label) {
27
		super(editingDomain, label, null);
28
	}
29
30
	/**
31
	 * @generated
32
	 */
33
	public List getAffectedFiles() {
34
		View view = (View) edgeAdaptor.getAdapter(View.class);
35
		if (view != null) {
36
			return getWorkspaceFiles(view);
37
		}
38
		return super.getAffectedFiles();
39
	}
40
41
	/**
42
	 * @generated
43
	 */
44
	public IAdaptable getEdgeAdaptor() {
45
		return edgeAdaptor;
46
	}
47
48
	/**
49
	 * @generated
50
	 */
51
	public void setEdgeAdaptor(IAdaptable edgeAdaptor) {
52
		this.edgeAdaptor = edgeAdaptor;
53
	}
54
55
	/**
56
	 * @generated
57
	 */
58
	protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) {
59
		assert null != edgeAdaptor : "Null child in UMLReorientConnectionViewCommand"; //$NON-NLS-1$
60
		Edge edge = (Edge) getEdgeAdaptor().getAdapter(Edge.class);
61
		assert null != edge : "Null edge in UMLReorientConnectionViewCommand"; //$NON-NLS-1$
62
63
		View tempView = edge.getSource();
64
		edge.setSource(edge.getTarget());
65
		edge.setTarget(tempView);
66
67
		return CommandResult.newOKCommandResult();
68
	}
69
}
(-)src/org/eclipse/uml2/diagram/clazz/providers/UMLStructuralFeaturesParser.java (+102 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.providers;
2
3
import java.text.FieldPosition;
4
import java.text.MessageFormat;
5
import java.util.ArrayList;
6
import java.util.Iterator;
7
import java.util.List;
8
9
import org.eclipse.core.runtime.IAdaptable;
10
import org.eclipse.emf.common.notify.Notification;
11
import org.eclipse.emf.ecore.EObject;
12
import org.eclipse.emf.ecore.EStructuralFeature;
13
import org.eclipse.emf.transaction.TransactionalEditingDomain;
14
import org.eclipse.emf.transaction.util.TransactionUtil;
15
import org.eclipse.gmf.runtime.common.core.command.ICommand;
16
import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
17
import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
18
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
19
import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
20
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
21
22
/**
23
 * @generated
24
 */
25
public class UMLStructuralFeaturesParser extends UMLAbstractParser {
26
27
	/**
28
	 * @generated
29
	 */
30
	private List features;
31
32
	/**
33
	 * @generated
34
	 */
35
	public UMLStructuralFeaturesParser(List features) {
36
		this.features = features;
37
	}
38
39
	/**
40
	 * @generated
41
	 */
42
	protected String getStringByPattern(IAdaptable adapter, int flags, String pattern, MessageFormat processor) {
43
		EObject element = (EObject) adapter.getAdapter(EObject.class);
44
		List values = new ArrayList(features.size());
45
		for (Iterator it = features.iterator(); it.hasNext();) {
46
			EStructuralFeature feature = (EStructuralFeature) it.next();
47
			Object value = element.eGet(feature);
48
			value = getValidValue(feature, value);
49
			values.add(value);
50
		}
51
		return processor.format(values.toArray(new Object[values.size()]), new StringBuffer(), new FieldPosition(0)).toString();
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected IParserEditStatus validateValues(Object[] values) {
58
		if (values.length != features.size()) {
59
			return ParserEditStatus.UNEDITABLE_STATUS;
60
		}
61
		for (int i = 0; i < values.length; i++) {
62
			Object value = getValidNewValue((EStructuralFeature) features.get(i), values[i]);
63
			if (value instanceof InvalidValue) {
64
				return new ParserEditStatus(UMLDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, value.toString());
65
			}
66
		}
67
		return ParserEditStatus.EDITABLE_STATUS;
68
	}
69
70
	/**
71
	 * @generated
72
	 */
73
	public ICommand getParseCommand(IAdaptable adapter, Object[] values) {
74
		EObject element = (EObject) adapter.getAdapter(EObject.class);
75
		if (element == null) {
76
			return UnexecutableCommand.INSTANCE;
77
		}
78
		TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
79
		if (editingDomain == null) {
80
			return UnexecutableCommand.INSTANCE;
81
		}
82
		CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
83
		for (int i = 0; i < values.length; i++) {
84
			EStructuralFeature feature = (EStructuralFeature) features.get(i);
85
			command.compose(getModificationCommand(element, feature, values[i]));
86
		}
87
		return command;
88
	}
89
90
	/**
91
	 * @generated
92
	 */
93
	public boolean isAffectingEvent(Object event, int flags) {
94
		if (event instanceof Notification) {
95
			Object feature = ((Notification) event).getFeature();
96
			if (features.contains(feature)) {
97
				return true;
98
			}
99
		}
100
		return false;
101
	}
102
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/operation/TokenMgrError.java (+144 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.operation;
14
15
public class TokenMgrError extends Error
16
{
17
   /*
18
    * Ordinals for various reasons why an Error of this type can be thrown.
19
    */
20
21
   /**
22
    * Lexical error occured.
23
    */
24
   static final int LEXICAL_ERROR = 0;
25
26
   /**
27
    * An attempt wass made to create a second instance of a static token manager.
28
    */
29
   static final int STATIC_LEXER_ERROR = 1;
30
31
   /**
32
    * Tried to change to an invalid lexical state.
33
    */
34
   static final int INVALID_LEXICAL_STATE = 2;
35
36
   /**
37
    * Detected (and bailed out of) an infinite loop in the token manager.
38
    */
39
   static final int LOOP_DETECTED = 3;
40
41
   /**
42
    * Indicates the reason why the exception is thrown. It will have
43
    * one of the above 4 values.
44
    */
45
   int errorCode;
46
47
   /**
48
    * Replaces unprintable characters by their espaced (or unicode escaped)
49
    * equivalents in the given string
50
    */
51
   protected static final String addEscapes(String str) {
52
      StringBuffer retval = new StringBuffer();
53
      char ch;
54
      for (int i = 0; i < str.length(); i++) {
55
        switch (str.charAt(i))
56
        {
57
           case 0 :
58
              continue;
59
           case '\b':
60
              retval.append("\\b");
61
              continue;
62
           case '\t':
63
              retval.append("\\t");
64
              continue;
65
           case '\n':
66
              retval.append("\\n");
67
              continue;
68
           case '\f':
69
              retval.append("\\f");
70
              continue;
71
           case '\r':
72
              retval.append("\\r");
73
              continue;
74
           case '\"':
75
              retval.append("\\\"");
76
              continue;
77
           case '\'':
78
              retval.append("\\\'");
79
              continue;
80
           case '\\':
81
              retval.append("\\\\");
82
              continue;
83
           default:
84
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
85
                 String s = "0000" + Integer.toString(ch, 16);
86
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
87
              } else {
88
                 retval.append(ch);
89
              }
90
              continue;
91
        }
92
      }
93
      return retval.toString();
94
   }
95
96
   /**
97
    * Returns a detailed message for the Error when it is thrown by the
98
    * token manager to indicate a lexical error.
99
    * Parameters : 
100
    *    EOFSeen     : indicates if EOF caused the lexicl error
101
    *    curLexState : lexical state in which this error occured
102
    *    errorLine   : line number when the error occured
103
    *    errorColumn : column number when the error occured
104
    *    errorAfter  : prefix that was seen before this error occured
105
    *    curchar     : the offending character
106
    * Note: You can customize the lexical error message by modifying this method.
107
    */
108
   protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
109
      return("Lexical error at line " +
110
           errorLine + ", column " +
111
           errorColumn + ".  Encountered: " +
112
           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
113
           "after : \"" + addEscapes(errorAfter) + "\"");
114
   }
115
116
   /**
117
    * You can also modify the body of this method to customize your error messages.
118
    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
119
    * of end-users concern, so you can return something like : 
120
    *
121
    *     "Internal Error : Please file a bug report .... "
122
    *
123
    * from this method for such cases in the release version of your parser.
124
    */
125
   public String getMessage() {
126
      return super.getMessage();
127
   }
128
129
   /*
130
    * Constructors of various flavors follow.
131
    */
132
133
   public TokenMgrError() {
134
   }
135
136
   public TokenMgrError(String message, int reason) {
137
      super(message);
138
      errorCode = reason;
139
   }
140
141
   public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
142
      this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
143
   }
144
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PrimitiveTypeAttributesViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class PrimitiveTypeAttributesViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeAttributesEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PrimitiveType2ViewFactory.java (+56 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeAttributesEditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeNameEditPart;
16
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeOperationsEditPart;
17
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
18
19
/**
20
 * @generated
21
 */
22
public class PrimitiveType2ViewFactory extends AbstractShapeViewFactory {
23
24
	/**
25
	 * @generated 
26
	 */
27
	protected List createStyles(View view) {
28
		List styles = new ArrayList();
29
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
30
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFillStyle());
32
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
33
		return styles;
34
	}
35
36
	/**
37
	 * @generated
38
	 */
39
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
40
		if (semanticHint == null) {
41
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveType2EditPart.VISUAL_ID);
42
			view.setType(semanticHint);
43
		}
44
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
45
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
46
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
47
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
48
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
49
			view.getEAnnotations().add(shortcutAnnotation);
50
		}
51
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(PrimitiveTypeNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
52
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(PrimitiveTypeAttributesEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
53
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(PrimitiveTypeOperationsEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
54
	}
55
56
}
(-)icons/obj16/UMLDiagramFile.gif (+6 lines)
Added Link Here
1
GIF89a¥	åëø___¿¿¿ÿߟÀÀÀ€€€ÿÿÀÀÀÿÿÿ?}IÒ輲ٌ™Ìf€À@´?=´?=°?>¬Œ@§‹B¢ˆC?…E—‚FƒwM~uN{sPÔ²iÚ½|àÈ?ùúü÷ùûõøûòõûðõûíòúêðùßéøÜç÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ!ù?,pÀŸB,…H$ÄÃln I¤äC}<
2
œgô7yA×Nv¥„ΡkãL‰VD¢FC
3
¯D-£FÁZhŒFQzj$$‚„†}ˆŠIƒ{?
4
?QŒj
5
Q%„¢
6
%Q&&r«©Q°±²[µQA;
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/Operation3EditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class Operation3EditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/name/AssociationNameParserConstants.java (+79 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. AssociationNameParserConstants.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.name;
14
15
public interface AssociationNameParserConstants {
16
17
  int EOF = 0;
18
  int SLASH = 3;
19
  int COLON = 4;
20
  int EQUALS = 5;
21
  int LBRACKET = 6;
22
  int RBRACKET = 7;
23
  int LCURLY = 8;
24
  int RCURLY = 9;
25
  int COMMA = 10;
26
  int PLUS = 11;
27
  int MINUS = 12;
28
  int NUMBER_SIGN = 13;
29
  int TILDE = 14;
30
  int DOT = 15;
31
  int STAR = 16;
32
  int READ_ONLY = 17;
33
  int UNION = 18;
34
  int SUBSETS = 19;
35
  int REDEFINES = 20;
36
  int ORDERED = 21;
37
  int UNORDERED = 22;
38
  int UNIQUE = 23;
39
  int NON_UNIQUE = 24;
40
  int INTEGER_LITERAL = 25;
41
  int IDENTIFIER = 26;
42
  int LETTER = 27;
43
  int DIGIT = 28;
44
45
  int DEFAULT = 0;
46
47
  String[] tokenImage = {
48
    "<EOF>",
49
    "\" \"",
50
    "\"\\t\"",
51
    "\"/\"",
52
    "\":\"",
53
    "\"=\"",
54
    "\"[\"",
55
    "\"]\"",
56
    "\"{\"",
57
    "\"}\"",
58
    "\",\"",
59
    "\"+\"",
60
    "\"-\"",
61
    "\"#\"",
62
    "\"~\"",
63
    "\".\"",
64
    "\"*\"",
65
    "\"readOnly\"",
66
    "\"union\"",
67
    "\"subsets\"",
68
    "\"redefines\"",
69
    "\"ordered\"",
70
    "\"unordered\"",
71
    "\"unique\"",
72
    "\"nonunique\"",
73
    "<INTEGER_LITERAL>",
74
    "<IDENTIFIER>",
75
    "<LETTER>",
76
    "<DIGIT>",
77
  };
78
79
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/ConstraintNameViewFactory.java (+29 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory;
8
import org.eclipse.gmf.runtime.notation.View;
9
10
/**
11
 * @generated
12
 */
13
public class ConstraintNameViewFactory extends BasicNodeViewFactory {
14
15
	/**
16
	 * @generated
17
	 */
18
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
19
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
20
	}
21
22
	/**
23
	 * @generated
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		return styles;
28
	}
29
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/OperationEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class OperationEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/DependencyEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class DependencyEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/PackageEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class PackageEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/EnumerationLiteralEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class EnumerationLiteralEditHelper extends UMLBaseEditHelper {
7
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/instance/InstanceSpecificationParser.java (+443 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. InstanceSpecificationParser.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.instance;
14
15
import java.io.*;
16
import java.util.*;
17
import org.eclipse.emf.ecore.EClass;
18
import org.eclipse.emf.ecore.EObject;
19
import org.eclipse.uml2.diagram.parser.*;
20
import org.eclipse.uml2.diagram.parser.lookup.LookupResolver;
21
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
22
import org.eclipse.uml2.uml.*;
23
24
public class InstanceSpecificationParser extends ExternalParserBase implements InstanceSpecificationParserConstants {
25
        private InstanceSpecification mySubject;
26
27
    private static class ClassifierLookupCallback implements LookupResolver.Callback {
28
        private final InstanceSpecification mySubject;
29
30
                public ClassifierLookupCallback(InstanceSpecification subject){
31
                        mySubject = subject;
32
        }
33
34
        public void lookupResolved(NamedElement resolution) {
35
                if (resolution instanceof Classifier){
36
                        mySubject.getClassifiers().add(resolution);
37
                }
38
        }
39
    }
40
41
    public InstanceSpecificationParser(){
42
        this(new StringReader(""));
43
    }
44
45
    public InstanceSpecificationParser(LookupSuite lookup){
46
        this();
47
        setLookupSuite(lookup);
48
    }
49
50
        public EClass getSubjectClass(){
51
                return UMLPackage.eINSTANCE.getInstanceSpecification();
52
        }
53
54
        public void parse(EObject target, String text) throws ExternalParserException {
55
                checkContext();
56
                ReInit(new StringReader(text));
57
                mySubject = (InstanceSpecification)target;
58
                Declaration();
59
                mySubject = null;
60
        }
61
62
        public InstanceSpecification parseNew(String text) throws ExternalParserException {
63
                InstanceSpecification instance = UMLFactory.eINSTANCE.createInstanceSpecification();
64
                parse(instance, text);
65
                return instance;
66
        }
67
68
        protected static int parseInt(Token t) throws ParseException {
69
                if (t.kind != InstanceSpecificationParserConstants.INTEGER_LITERAL){
70
                        throw new IllegalStateException("Token: " + t + ", image: " + t.image);
71
                }
72
                try {
73
                        return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
74
                } catch (NumberFormatException e){
75
                        throw new ParseException("Not supported integer value:" + t.image);
76
                }
77
        }
78
79
  final public void Declaration() throws ParseException {
80
    if (jj_2_1(2)) {
81
      AnonymousUnnamed();
82
    } else {
83
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
84
      case 0:
85
      case COLON:
86
      case IDENTIFIER:
87
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
88
        case IDENTIFIER:
89
          InstanceName();
90
          break;
91
        default:
92
          jj_la1[0] = jj_gen;
93
          ;
94
        }
95
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
96
        case COLON:
97
          InstanceType();
98
          break;
99
        default:
100
          jj_la1[1] = jj_gen;
101
          ;
102
        }
103
        jj_consume_token(0);
104
        break;
105
      default:
106
        jj_la1[2] = jj_gen;
107
        jj_consume_token(-1);
108
        throw new ParseException();
109
      }
110
    }
111
  }
112
113
  final public void AnonymousUnnamed() throws ParseException {
114
    jj_consume_token(COLON);
115
                  mySubject.setName(null); mySubject.getClassifiers().clear();
116
  }
117
118
  final public void InstanceName() throws ParseException {
119
        String name;
120
    name = NameWithSpaces();
121
                mySubject.setName(name);
122
  }
123
124
  final public void InstanceType() throws ParseException {
125
        String type;
126
    jj_consume_token(COLON);
127
    type = NameWithSpaces();
128
                                                  applyLookup(Type.class, type, new ClassifierLookupCallback(mySubject));
129
    label_1:
130
    while (true) {
131
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
132
      case COMMA:
133
        ;
134
        break;
135
      default:
136
        jj_la1[3] = jj_gen;
137
        break label_1;
138
      }
139
      jj_consume_token(COMMA);
140
      type = NameWithSpaces();
141
                                                          applyLookup(Type.class, type, new ClassifierLookupCallback(mySubject));
142
    }
143
  }
144
145
  final public String NameWithSpaces() throws ParseException {
146
        StringBuffer result = new StringBuffer();
147
        Token t;
148
    t = jj_consume_token(IDENTIFIER);
149
                                   result.append(t.image);
150
    label_2:
151
    while (true) {
152
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
153
      case IDENTIFIER:
154
        ;
155
        break;
156
      default:
157
        jj_la1[4] = jj_gen;
158
        break label_2;
159
      }
160
      t = jj_consume_token(IDENTIFIER);
161
                                     result.append(' '); result.append(t.image);
162
    }
163
                {if (true) return result.toString();}
164
    throw new Error("Missing return statement in function");
165
  }
166
167
  final private boolean jj_2_1(int xla) {
168
    jj_la = xla; jj_lastpos = jj_scanpos = token;
169
    try { return !jj_3_1(); }
170
    catch(LookaheadSuccess ls) { return true; }
171
    finally { jj_save(0, xla); }
172
  }
173
174
  final private boolean jj_3_1() {
175
    if (jj_3R_3()) return true;
176
    return false;
177
  }
178
179
  final private boolean jj_3R_3() {
180
    if (jj_scan_token(COLON)) return true;
181
    return false;
182
  }
183
184
  public InstanceSpecificationParserTokenManager token_source;
185
  JavaCharStream jj_input_stream;
186
  public Token token, jj_nt;
187
  private int jj_ntk;
188
  private Token jj_scanpos, jj_lastpos;
189
  private int jj_la;
190
  public boolean lookingAhead = false;
191
  private boolean jj_semLA;
192
  private int jj_gen;
193
  final private int[] jj_la1 = new int[5];
194
  static private int[] jj_la1_0;
195
  static {
196
      jj_la1_0();
197
   }
198
   private static void jj_la1_0() {
199
      jj_la1_0 = new int[] {0x4000000,0x10,0x4000011,0x400,0x4000000,};
200
   }
201
  final private JJCalls[] jj_2_rtns = new JJCalls[1];
202
  private boolean jj_rescan = false;
203
  private int jj_gc = 0;
204
205
  public InstanceSpecificationParser(java.io.InputStream stream) {
206
    jj_input_stream = new JavaCharStream(stream, 1, 1);
207
    token_source = new InstanceSpecificationParserTokenManager(jj_input_stream);
208
    token = new Token();
209
    jj_ntk = -1;
210
    jj_gen = 0;
211
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
212
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
213
  }
214
215
  public void ReInit(java.io.InputStream stream) {
216
    jj_input_stream.ReInit(stream, 1, 1);
217
    token_source.ReInit(jj_input_stream);
218
    token = new Token();
219
    jj_ntk = -1;
220
    jj_gen = 0;
221
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
222
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
223
  }
224
225
  public InstanceSpecificationParser(java.io.Reader stream) {
226
    jj_input_stream = new JavaCharStream(stream, 1, 1);
227
    token_source = new InstanceSpecificationParserTokenManager(jj_input_stream);
228
    token = new Token();
229
    jj_ntk = -1;
230
    jj_gen = 0;
231
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
232
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
233
  }
234
235
  public void ReInit(java.io.Reader stream) {
236
    jj_input_stream.ReInit(stream, 1, 1);
237
    token_source.ReInit(jj_input_stream);
238
    token = new Token();
239
    jj_ntk = -1;
240
    jj_gen = 0;
241
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
242
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
243
  }
244
245
  public InstanceSpecificationParser(InstanceSpecificationParserTokenManager tm) {
246
    token_source = tm;
247
    token = new Token();
248
    jj_ntk = -1;
249
    jj_gen = 0;
250
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
251
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
252
  }
253
254
  public void ReInit(InstanceSpecificationParserTokenManager tm) {
255
    token_source = tm;
256
    token = new Token();
257
    jj_ntk = -1;
258
    jj_gen = 0;
259
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
260
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
261
  }
262
263
  final private Token jj_consume_token(int kind) throws ParseException {
264
    Token oldToken;
265
    if ((oldToken = token).next != null) token = token.next;
266
    else token = token.next = token_source.getNextToken();
267
    jj_ntk = -1;
268
    if (token.kind == kind) {
269
      jj_gen++;
270
      if (++jj_gc > 100) {
271
        jj_gc = 0;
272
        for (int i = 0; i < jj_2_rtns.length; i++) {
273
          JJCalls c = jj_2_rtns[i];
274
          while (c != null) {
275
            if (c.gen < jj_gen) c.first = null;
276
            c = c.next;
277
          }
278
        }
279
      }
280
      return token;
281
    }
282
    token = oldToken;
283
    jj_kind = kind;
284
    throw generateParseException();
285
  }
286
287
  static private final class LookaheadSuccess extends java.lang.Error { }
288
  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
289
  final private boolean jj_scan_token(int kind) {
290
    if (jj_scanpos == jj_lastpos) {
291
      jj_la--;
292
      if (jj_scanpos.next == null) {
293
        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
294
      } else {
295
        jj_lastpos = jj_scanpos = jj_scanpos.next;
296
      }
297
    } else {
298
      jj_scanpos = jj_scanpos.next;
299
    }
300
    if (jj_rescan) {
301
      int i = 0; Token tok = token;
302
      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
303
      if (tok != null) jj_add_error_token(kind, i);
304
    }
305
    if (jj_scanpos.kind != kind) return true;
306
    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
307
    return false;
308
  }
309
310
  final public Token getNextToken() {
311
    if (token.next != null) token = token.next;
312
    else token = token.next = token_source.getNextToken();
313
    jj_ntk = -1;
314
    jj_gen++;
315
    return token;
316
  }
317
318
  final public Token getToken(int index) {
319
    Token t = lookingAhead ? jj_scanpos : token;
320
    for (int i = 0; i < index; i++) {
321
      if (t.next != null) t = t.next;
322
      else t = t.next = token_source.getNextToken();
323
    }
324
    return t;
325
  }
326
327
  final private int jj_ntk() {
328
    if ((jj_nt=token.next) == null)
329
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
330
    else
331
      return (jj_ntk = jj_nt.kind);
332
  }
333
334
  private java.util.Vector jj_expentries = new java.util.Vector();
335
  private int[] jj_expentry;
336
  private int jj_kind = -1;
337
  private int[] jj_lasttokens = new int[100];
338
  private int jj_endpos;
339
340
  private void jj_add_error_token(int kind, int pos) {
341
    if (pos >= 100) return;
342
    if (pos == jj_endpos + 1) {
343
      jj_lasttokens[jj_endpos++] = kind;
344
    } else if (jj_endpos != 0) {
345
      jj_expentry = new int[jj_endpos];
346
      for (int i = 0; i < jj_endpos; i++) {
347
        jj_expentry[i] = jj_lasttokens[i];
348
      }
349
      boolean exists = false;
350
      for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
351
        int[] oldentry = (int[])(e.nextElement());
352
        if (oldentry.length == jj_expentry.length) {
353
          exists = true;
354
          for (int i = 0; i < jj_expentry.length; i++) {
355
            if (oldentry[i] != jj_expentry[i]) {
356
              exists = false;
357
              break;
358
            }
359
          }
360
          if (exists) break;
361
        }
362
      }
363
      if (!exists) jj_expentries.addElement(jj_expentry);
364
      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
365
    }
366
  }
367
368
  public ParseException generateParseException() {
369
    jj_expentries.removeAllElements();
370
    boolean[] la1tokens = new boolean[29];
371
    for (int i = 0; i < 29; i++) {
372
      la1tokens[i] = false;
373
    }
374
    if (jj_kind >= 0) {
375
      la1tokens[jj_kind] = true;
376
      jj_kind = -1;
377
    }
378
    for (int i = 0; i < 5; i++) {
379
      if (jj_la1[i] == jj_gen) {
380
        for (int j = 0; j < 32; j++) {
381
          if ((jj_la1_0[i] & (1<<j)) != 0) {
382
            la1tokens[j] = true;
383
          }
384
        }
385
      }
386
    }
387
    for (int i = 0; i < 29; i++) {
388
      if (la1tokens[i]) {
389
        jj_expentry = new int[1];
390
        jj_expentry[0] = i;
391
        jj_expentries.addElement(jj_expentry);
392
      }
393
    }
394
    jj_endpos = 0;
395
    jj_rescan_token();
396
    jj_add_error_token(0, 0);
397
    int[][] exptokseq = new int[jj_expentries.size()][];
398
    for (int i = 0; i < jj_expentries.size(); i++) {
399
      exptokseq[i] = (int[])jj_expentries.elementAt(i);
400
    }
401
    return new ParseException(token, exptokseq, tokenImage);
402
  }
403
404
  final public void enable_tracing() {
405
  }
406
407
  final public void disable_tracing() {
408
  }
409
410
  final private void jj_rescan_token() {
411
    jj_rescan = true;
412
    for (int i = 0; i < 1; i++) {
413
      JJCalls p = jj_2_rtns[i];
414
      do {
415
        if (p.gen > jj_gen) {
416
          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
417
          switch (i) {
418
            case 0: jj_3_1(); break;
419
          }
420
        }
421
        p = p.next;
422
      } while (p != null);
423
    }
424
    jj_rescan = false;
425
  }
426
427
  final private void jj_save(int index, int xla) {
428
    JJCalls p = jj_2_rtns[index];
429
    while (p.gen > jj_gen) {
430
      if (p.next == null) { p = p.next = new JJCalls(); break; }
431
      p = p.next;
432
    }
433
    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
434
  }
435
436
  static final class JJCalls {
437
    int gen;
438
    Token first;
439
    int arg;
440
    JJCalls next;
441
  }
442
443
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/EnumerationEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class EnumerationEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PortViewFactory.java (+52 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.PortNameEditPart;
15
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
16
17
/**
18
 * @generated
19
 */
20
public class PortViewFactory extends AbstractShapeViewFactory {
21
22
	/**
23
	 * @generated 
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
28
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
29
		styles.add(NotationFactory.eINSTANCE.createFillStyle());
30
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
31
		return styles;
32
	}
33
34
	/**
35
	 * @generated
36
	 */
37
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
38
		if (semanticHint == null) {
39
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.PortEditPart.VISUAL_ID);
40
			view.setType(semanticHint);
41
		}
42
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
43
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
44
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
45
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
46
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
47
			view.getEAnnotations().add(shortcutAnnotation);
48
		}
49
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(PortNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
50
	}
51
52
}
(-)plugin.properties (+19 lines)
Added Link Here
1
pluginName=UML Plugin
2
providerName=Sample Plugin Provider, Inc
3
4
editorName=UMLClass Diagram Editor
5
newWizardName=UMLClass Diagram
6
newWizardDesc=Creates UMLClass diagram.
7
8
initDiagramActionLabel=Initialize umlclass_diagram diagram file
9
loadResourceActionLabel=Load Resource...
10
11
navigatorContentName=*.umlclass_diagram diagram contents
12
###
13
# Property Sheet
14
15
tab.appearance=Appearance
16
tab.diagram=Rulers & Grid
17
tab.domain=Core
18
###
19
	
(-)icons/linksNavigatorGroup.gif (+5 lines)
Added Link Here
1
GIF89aÕÿÿ­r/‚GøØˆžf'øÐxøà˜øÐ€f>2èÆ”øè°èЈøðÈÿÿÿË6úöºøà øØ?Œ]Føè˜Ò«€üößãϹ´2àÀx­r+ðØ?¥l$yO@ž_­l$?R¼2ï߯¼…2Å6!ù,s@€pH,?È#âèh:‚¨T0ô4®
2
‹à‘?p©€Ñd¢Y`B‚¡‹p8G AØ%‚%HÁçW¶	_B†‰Š‹?’“’š??–B¥¦¥ B­®­©C³´µI·¸FA;Content-Type: image/gif
3
4
GIF89aÕÿÿ­r/‚GøØˆžf'øÐxøà˜øÐ€f>2èÆ”øè°èЈøðÈÿÿÿË6úöºøà øØ?Œ]Føè˜Ò«€üößãϹ´2àÀx­r+ðØ?¥l$yO@ž_­l$?R¼2ï߯¼…2Å6!ù,s@€pH,?È#âèh:‚¨T0ô4®
5
‹à‘?p©€Ñd¢Y`B‚¡‹p8G AØ%‚%HÁçW¶	_B†‰Š‹?’“’š??–B¥¦¥ B­®­©C³´µI·¸FA;
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLPaletteFactory.java (+594 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.gef.Tool;
7
import org.eclipse.gef.palette.PaletteContainer;
8
import org.eclipse.gef.palette.PaletteGroup;
9
import org.eclipse.gef.palette.PaletteRoot;
10
import org.eclipse.gef.palette.ToolEntry;
11
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeConnectionTool;
12
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeCreationTool;
13
import org.eclipse.jface.resource.ImageDescriptor;
14
import org.eclipse.uml2.diagram.clazz.providers.UMLElementTypes;
15
16
/**
17
 * @generated
18
 */
19
public class UMLPaletteFactory {
20
21
	/**
22
	 * @generated
23
	 */
24
	public void fillPalette(PaletteRoot paletteRoot) {
25
		paletteRoot.add(createNodes1Group());
26
		paletteRoot.add(createChildren2Group());
27
		paletteRoot.add(createLinks3Group());
28
		paletteRoot.add(createInstances4Group());
29
	}
30
31
	/**
32
	 * @generated
33
	 */
34
	private PaletteContainer createNodes1Group() {
35
		PaletteContainer paletteContainer = new PaletteGroup("Nodes");
36
		paletteContainer.setDescription("Diagram Nodes");
37
		paletteContainer.add(createClass1CreationTool());
38
		paletteContainer.add(createPackage2CreationTool());
39
		paletteContainer.add(createEnumeration3CreationTool());
40
		paletteContainer.add(createDataType4CreationTool());
41
		paletteContainer.add(createPrimitiveType5CreationTool());
42
		paletteContainer.add(createConstraint6CreationTool());
43
		paletteContainer.add(createAssociationClass7CreationTool());
44
		paletteContainer.add(createInterface8CreationTool());
45
		return paletteContainer;
46
	}
47
48
	/**
49
	 * @generated
50
	 */
51
	private PaletteContainer createChildren2Group() {
52
		PaletteContainer paletteContainer = new PaletteGroup("Children");
53
		paletteContainer.setDescription("Child Elements of the Diagram Nodes");
54
		paletteContainer.add(createAttribute1CreationTool());
55
		paletteContainer.add(createOperation2CreationTool());
56
		paletteContainer.add(createValueSpecification3CreationTool());
57
		paletteContainer.add(createEnumLiteral4CreationTool());
58
		paletteContainer.add(createPort5CreationTool());
59
		return paletteContainer;
60
	}
61
62
	/**
63
	 * @generated
64
	 */
65
	private PaletteContainer createLinks3Group() {
66
		PaletteContainer paletteContainer = new PaletteGroup("Links");
67
		paletteContainer.setDescription("Diagram Links");
68
		paletteContainer.add(createAssociation1CreationTool());
69
		paletteContainer.add(createGeneralization2CreationTool());
70
		paletteContainer.add(createProvidedInterface3CreationTool());
71
		paletteContainer.add(createRequiredInterface4CreationTool());
72
		paletteContainer.add(createDependency5CreationTool());
73
		paletteContainer.add(createConstrainedElement6CreationTool());
74
		paletteContainer.add(createNAryDependencyTarget7CreationTool());
75
		paletteContainer.add(createNAryDependencySource8CreationTool());
76
		paletteContainer.add(createAssociationEnd9CreationTool());
77
		return paletteContainer;
78
	}
79
80
	/**
81
	 * @generated
82
	 */
83
	private PaletteContainer createInstances4Group() {
84
		PaletteContainer paletteContainer = new PaletteGroup("Instances");
85
		paletteContainer.setDescription("Instances");
86
		paletteContainer.add(createInstanceSpecification1CreationTool());
87
		paletteContainer.add(createSlot2CreationTool());
88
		return paletteContainer;
89
	}
90
91
	/**
92
	 * @generated
93
	 */
94
	private ToolEntry createClass1CreationTool() {
95
		ImageDescriptor smallImage;
96
		ImageDescriptor largeImage;
97
98
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Class_3007);
99
100
		largeImage = smallImage;
101
102
		final List elementTypes = new ArrayList();
103
		elementTypes.add(UMLElementTypes.Class_3007);
104
		elementTypes.add(UMLElementTypes.Class_2001);
105
		elementTypes.add(UMLElementTypes.Class_3003);
106
		ToolEntry result = new NodeToolEntry("Class", "Create Class", smallImage, largeImage, elementTypes);
107
108
		return result;
109
	}
110
111
	/**
112
	 * @generated
113
	 */
114
	private ToolEntry createPackage2CreationTool() {
115
		ImageDescriptor smallImage;
116
		ImageDescriptor largeImage;
117
118
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Package_2002);
119
120
		largeImage = smallImage;
121
122
		final List elementTypes = new ArrayList();
123
		elementTypes.add(UMLElementTypes.Package_2002);
124
		elementTypes.add(UMLElementTypes.Package_3006);
125
		ToolEntry result = new NodeToolEntry("Package", "Create Package", smallImage, largeImage, elementTypes);
126
127
		return result;
128
	}
129
130
	/**
131
	 * @generated
132
	 */
133
	private ToolEntry createEnumeration3CreationTool() {
134
		ImageDescriptor smallImage;
135
		ImageDescriptor largeImage;
136
137
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Enumeration_3011);
138
139
		largeImage = smallImage;
140
141
		final List elementTypes = new ArrayList();
142
		elementTypes.add(UMLElementTypes.Enumeration_3011);
143
		elementTypes.add(UMLElementTypes.Enumeration_2003);
144
		ToolEntry result = new NodeToolEntry("Enumeration", "Create Enumeration", smallImage, largeImage, elementTypes);
145
146
		return result;
147
	}
148
149
	/**
150
	 * @generated
151
	 */
152
	private ToolEntry createDataType4CreationTool() {
153
		ImageDescriptor smallImage;
154
		ImageDescriptor largeImage;
155
156
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.DataType_3008);
157
158
		largeImage = smallImage;
159
160
		final List elementTypes = new ArrayList();
161
		elementTypes.add(UMLElementTypes.DataType_3008);
162
		elementTypes.add(UMLElementTypes.DataType_2004);
163
		ToolEntry result = new NodeToolEntry("DataType", "Create DataType", smallImage, largeImage, elementTypes);
164
165
		return result;
166
	}
167
168
	/**
169
	 * @generated
170
	 */
171
	private ToolEntry createPrimitiveType5CreationTool() {
172
		ImageDescriptor smallImage;
173
		ImageDescriptor largeImage;
174
175
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.PrimitiveType_3009);
176
177
		largeImage = smallImage;
178
179
		final List elementTypes = new ArrayList();
180
		elementTypes.add(UMLElementTypes.PrimitiveType_3009);
181
		elementTypes.add(UMLElementTypes.PrimitiveType_2005);
182
		ToolEntry result = new NodeToolEntry("PrimitiveType", "Create PrimitiveType", smallImage, largeImage, elementTypes);
183
184
		return result;
185
	}
186
187
	/**
188
	 * @generated
189
	 */
190
	private ToolEntry createConstraint6CreationTool() {
191
		ImageDescriptor smallImage;
192
		ImageDescriptor largeImage;
193
194
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Constraint_2006);
195
196
		largeImage = smallImage;
197
198
		final List elementTypes = new ArrayList();
199
		elementTypes.add(UMLElementTypes.Constraint_2006);
200
		ToolEntry result = new NodeToolEntry("Constraint", "Create Constraint", smallImage, largeImage, elementTypes);
201
202
		return result;
203
	}
204
205
	/**
206
	 * @generated
207
	 */
208
	private ToolEntry createAssociationClass7CreationTool() {
209
		ImageDescriptor smallImage;
210
		ImageDescriptor largeImage;
211
212
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.AssociationClass_3012);
213
214
		largeImage = smallImage;
215
216
		final List elementTypes = new ArrayList();
217
		elementTypes.add(UMLElementTypes.AssociationClass_3012);
218
		elementTypes.add(UMLElementTypes.AssociationClass_2007);
219
		ToolEntry result = new NodeToolEntry("Association Class", "Create Association Class", smallImage, largeImage, elementTypes);
220
221
		return result;
222
	}
223
224
	/**
225
	 * @generated
226
	 */
227
	private ToolEntry createInterface8CreationTool() {
228
		ImageDescriptor smallImage;
229
		ImageDescriptor largeImage;
230
231
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Interface_2010);
232
233
		largeImage = smallImage;
234
235
		final List elementTypes = new ArrayList();
236
		elementTypes.add(UMLElementTypes.Interface_2010);
237
		ToolEntry result = new NodeToolEntry("Interface", "Create Interface", smallImage, largeImage, elementTypes);
238
239
		return result;
240
	}
241
242
	/**
243
	 * @generated
244
	 */
245
	private ToolEntry createAttribute1CreationTool() {
246
		ImageDescriptor smallImage;
247
		ImageDescriptor largeImage;
248
249
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Property_3001);
250
251
		largeImage = smallImage;
252
253
		final List elementTypes = new ArrayList();
254
		elementTypes.add(UMLElementTypes.Property_3001);
255
		elementTypes.add(UMLElementTypes.Property_3019);
256
		elementTypes.add(UMLElementTypes.Property_3014);
257
		elementTypes.add(UMLElementTypes.Property_3021);
258
		elementTypes.add(UMLElementTypes.Property_3023);
259
		ToolEntry result = new NodeToolEntry("Attribute", "Create Attribute", smallImage, largeImage, elementTypes);
260
261
		return result;
262
	}
263
264
	/**
265
	 * @generated
266
	 */
267
	private ToolEntry createOperation2CreationTool() {
268
		ImageDescriptor smallImage;
269
		ImageDescriptor largeImage;
270
271
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Operation_3002);
272
273
		largeImage = smallImage;
274
275
		final List elementTypes = new ArrayList();
276
		elementTypes.add(UMLElementTypes.Operation_3002);
277
		elementTypes.add(UMLElementTypes.Operation_3020);
278
		elementTypes.add(UMLElementTypes.Operation_3015);
279
		elementTypes.add(UMLElementTypes.Operation_3022);
280
		elementTypes.add(UMLElementTypes.Operation_3024);
281
		ToolEntry result = new NodeToolEntry("Operation", "Create Operation", smallImage, largeImage, elementTypes);
282
283
		return result;
284
	}
285
286
	/**
287
	 * @generated
288
	 */
289
	private ToolEntry createValueSpecification3CreationTool() {
290
		ImageDescriptor smallImage;
291
		ImageDescriptor largeImage;
292
293
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.LiteralString_3005);
294
295
		largeImage = smallImage;
296
297
		final List elementTypes = new ArrayList();
298
		elementTypes.add(UMLElementTypes.LiteralString_3005);
299
		ToolEntry result = new NodeToolEntry("Value Specification", "Create Value Specification", smallImage, largeImage, elementTypes);
300
301
		return result;
302
	}
303
304
	/**
305
	 * @generated
306
	 */
307
	private ToolEntry createEnumLiteral4CreationTool() {
308
		ImageDescriptor smallImage;
309
		ImageDescriptor largeImage;
310
311
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.EnumerationLiteral_3016);
312
313
		largeImage = smallImage;
314
315
		final List elementTypes = new ArrayList();
316
		elementTypes.add(UMLElementTypes.EnumerationLiteral_3016);
317
		ToolEntry result = new NodeToolEntry("Enum Literal", "Create Enum Literal", smallImage, largeImage, elementTypes);
318
319
		return result;
320
	}
321
322
	/**
323
	 * @generated
324
	 */
325
	private ToolEntry createPort5CreationTool() {
326
		ImageDescriptor smallImage;
327
		ImageDescriptor largeImage;
328
329
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Port_3025);
330
331
		largeImage = smallImage;
332
333
		final List elementTypes = new ArrayList();
334
		elementTypes.add(UMLElementTypes.Port_3025);
335
		ToolEntry result = new NodeToolEntry("Port", "Create Port", smallImage, largeImage, elementTypes);
336
337
		return result;
338
	}
339
340
	/**
341
	 * @generated
342
	 */
343
	private ToolEntry createAssociation1CreationTool() {
344
		ImageDescriptor smallImage;
345
		ImageDescriptor largeImage;
346
347
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Association_4005);
348
349
		largeImage = smallImage;
350
351
		final List relationshipTypes = new ArrayList();
352
		relationshipTypes.add(UMLElementTypes.Association_4005);
353
		ToolEntry result = new LinkToolEntry("Association", "Association", smallImage, largeImage, relationshipTypes);
354
355
		return result;
356
	}
357
358
	/**
359
	 * @generated
360
	 */
361
	private ToolEntry createGeneralization2CreationTool() {
362
		ImageDescriptor smallImage;
363
		ImageDescriptor largeImage;
364
365
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Generalization_4001);
366
367
		largeImage = smallImage;
368
369
		final List relationshipTypes = new ArrayList();
370
		relationshipTypes.add(UMLElementTypes.Generalization_4001);
371
		ToolEntry result = new LinkToolEntry("Generalization", "Create Generalization Link", smallImage, largeImage, relationshipTypes);
372
373
		return result;
374
	}
375
376
	/**
377
	 * @generated
378
	 */
379
	private ToolEntry createProvidedInterface3CreationTool() {
380
		ImageDescriptor smallImage;
381
		ImageDescriptor largeImage;
382
383
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.InterfaceRealization_4008);
384
385
		largeImage = smallImage;
386
387
		final List relationshipTypes = new ArrayList();
388
		relationshipTypes.add(UMLElementTypes.InterfaceRealization_4008);
389
		ToolEntry result = new LinkToolEntry("Provided Interface", "Create Interface Realization", smallImage, largeImage, relationshipTypes);
390
391
		return result;
392
	}
393
394
	/**
395
	 * @generated
396
	 */
397
	private ToolEntry createRequiredInterface4CreationTool() {
398
		ImageDescriptor smallImage;
399
		ImageDescriptor largeImage;
400
401
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Usage_4009);
402
403
		largeImage = smallImage;
404
405
		final List relationshipTypes = new ArrayList();
406
		relationshipTypes.add(UMLElementTypes.Usage_4009);
407
		ToolEntry result = new LinkToolEntry("Required Interface", "Create Usage", smallImage, largeImage, relationshipTypes);
408
409
		return result;
410
	}
411
412
	/**
413
	 * @generated
414
	 */
415
	private ToolEntry createDependency5CreationTool() {
416
		ImageDescriptor smallImage;
417
		ImageDescriptor largeImage;
418
419
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Dependency_4002);
420
421
		largeImage = smallImage;
422
423
		final List relationshipTypes = new ArrayList();
424
		relationshipTypes.add(UMLElementTypes.Dependency_4002);
425
		ToolEntry result = new LinkToolEntry("Dependency", "Create Dependency Link", smallImage, largeImage, relationshipTypes);
426
427
		return result;
428
	}
429
430
	/**
431
	 * @generated
432
	 */
433
	private ToolEntry createConstrainedElement6CreationTool() {
434
		ImageDescriptor smallImage;
435
		ImageDescriptor largeImage;
436
437
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.ConstraintConstrainedElement_4004);
438
439
		largeImage = smallImage;
440
441
		final List relationshipTypes = new ArrayList();
442
		relationshipTypes.add(UMLElementTypes.ConstraintConstrainedElement_4004);
443
		ToolEntry result = new LinkToolEntry("Constrained Element", "Create Constrained Element Link", smallImage, largeImage, relationshipTypes);
444
445
		return result;
446
	}
447
448
	/**
449
	 * @generated
450
	 */
451
	private ToolEntry createNAryDependencyTarget7CreationTool() {
452
		ImageDescriptor smallImage;
453
		ImageDescriptor largeImage;
454
455
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.DependencySupplier_4006);
456
457
		largeImage = smallImage;
458
459
		final List relationshipTypes = new ArrayList();
460
		relationshipTypes.add(UMLElementTypes.DependencySupplier_4006);
461
		ToolEntry result = new LinkToolEntry("NAry Dependency Target", "Add NAry Dependency Target", smallImage, largeImage, relationshipTypes);
462
463
		return result;
464
	}
465
466
	/**
467
	 * @generated
468
	 */
469
	private ToolEntry createNAryDependencySource8CreationTool() {
470
		ImageDescriptor smallImage;
471
		ImageDescriptor largeImage;
472
473
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.DependencyClient_4007);
474
475
		largeImage = smallImage;
476
477
		final List relationshipTypes = new ArrayList();
478
		relationshipTypes.add(UMLElementTypes.DependencyClient_4007);
479
		ToolEntry result = new LinkToolEntry("NAry Dependency Source", "Add NAry Dependency Source", smallImage, largeImage, relationshipTypes);
480
481
		return result;
482
	}
483
484
	/**
485
	 * @generated
486
	 */
487
	private ToolEntry createAssociationEnd9CreationTool() {
488
		ImageDescriptor smallImage;
489
		ImageDescriptor largeImage;
490
491
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Property_4003);
492
493
		largeImage = smallImage;
494
495
		final List relationshipTypes = new ArrayList();
496
		relationshipTypes.add(UMLElementTypes.Property_4003);
497
		ToolEntry result = new LinkToolEntry("Association End", "Create Association End Link", smallImage, largeImage, relationshipTypes);
498
499
		return result;
500
	}
501
502
	/**
503
	 * @generated
504
	 */
505
	private ToolEntry createInstanceSpecification1CreationTool() {
506
		ImageDescriptor smallImage;
507
		ImageDescriptor largeImage;
508
509
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.InstanceSpecification_3013);
510
511
		largeImage = smallImage;
512
513
		final List elementTypes = new ArrayList();
514
		elementTypes.add(UMLElementTypes.InstanceSpecification_3013);
515
		elementTypes.add(UMLElementTypes.InstanceSpecification_2008);
516
		ToolEntry result = new NodeToolEntry("Instance Specification", "Create Instance Specification", smallImage, largeImage, elementTypes);
517
518
		return result;
519
	}
520
521
	/**
522
	 * @generated
523
	 */
524
	private ToolEntry createSlot2CreationTool() {
525
		ImageDescriptor smallImage;
526
		ImageDescriptor largeImage;
527
528
		smallImage = UMLElementTypes.getImageDescriptor(UMLElementTypes.Slot_3017);
529
530
		largeImage = smallImage;
531
532
		final List elementTypes = new ArrayList();
533
		elementTypes.add(UMLElementTypes.Slot_3017);
534
		ToolEntry result = new NodeToolEntry("Slot", "Create Slot", smallImage, largeImage, elementTypes);
535
536
		return result;
537
	}
538
539
	/**
540
	 * @generated
541
	 */
542
	private static class NodeToolEntry extends ToolEntry {
543
544
		/**
545
		 * @generated
546
		 */
547
		private final List elementTypes;
548
549
		/**
550
		 * @generated
551
		 */
552
		private NodeToolEntry(String title, String description, ImageDescriptor smallIcon, ImageDescriptor largeIcon, List elementTypes) {
553
			super(title, description, smallIcon, largeIcon);
554
			this.elementTypes = elementTypes;
555
		}
556
557
		/**
558
		 * @generated
559
		 */
560
		public Tool createTool() {
561
			Tool tool = new UnspecifiedTypeCreationTool(elementTypes);
562
			tool.setProperties(getToolProperties());
563
			return tool;
564
		}
565
	}
566
567
	/**
568
	 * @generated
569
	 */
570
	private static class LinkToolEntry extends ToolEntry {
571
572
		/**
573
		 * @generated
574
		 */
575
		private final List relationshipTypes;
576
577
		/**
578
		 * @generated
579
		 */
580
		private LinkToolEntry(String title, String description, ImageDescriptor smallIcon, ImageDescriptor largeIcon, List relationshipTypes) {
581
			super(title, description, smallIcon, largeIcon);
582
			this.relationshipTypes = relationshipTypes;
583
		}
584
585
		/**
586
		 * @generated
587
		 */
588
		public Tool createTool() {
589
			Tool tool = new UnspecifiedTypeConnectionTool(relationshipTypes);
590
			tool.setProperties(getToolProperties());
591
			return tool;
592
		}
593
	}
594
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationClassAttributesViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class AssociationClassAttributesViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassAttributesEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Dependency2ViewFactory.java (+50 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyName2EditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
15
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
16
17
/**
18
 * @generated
19
 */
20
public class Dependency2ViewFactory extends ConnectionViewFactory {
21
22
	/**
23
	 * @generated 
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		styles.add(NotationFactory.eINSTANCE.createRoutingStyle());
28
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
29
		return styles;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
36
		if (semanticHint == null) {
37
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Dependency2EditPart.VISUAL_ID);
38
			view.setType(semanticHint);
39
		}
40
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
41
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
42
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
43
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
44
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
45
			view.getEAnnotations().add(shortcutAnnotation);
46
		}
47
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(DependencyName2EditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
48
	}
49
50
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/EnumerationOperationsViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class EnumerationOperationsViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationOperationsEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/property/property.jj (+382 lines)
Added Link Here
1
options {
2
  JAVA_UNICODE_ESCAPE = true;
3
  STATIC=false;
4
}
5
6
PARSER_BEGIN(PropertyParser)
7
8
/*
9
 * Copyright (c) 2006 Borland Software Corporation
10
 * 
11
 * All rights reserved. This program and the accompanying materials
12
 * are made available under the terms of the Eclipse Public License v1.0
13
 * which accompanies this distribution, and is available at
14
 * http://www.eclipse.org/legal/epl-v10.html
15
 *
16
 * Contributors:
17
 *    Michael Golubev (Borland) - initial API and implementation
18
 */
19
package org.eclipse.uml2.diagram.clazz.parser.property;
20
21
import java.io.*;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EObject;
24
import org.eclipse.uml2.diagram.parser.*;
25
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
26
import org.eclipse.uml2.diagram.parser.lookup.LookupResolver;
27
import org.eclipse.uml2.uml.*;
28
29
public class PropertyParser extends ExternalParserBase {
30
	private Property mySubject;
31
	
32
    private static class TypeLookupCallback implements LookupResolver.Callback {
33
    	private final Property myProperty;
34
35
		public TypeLookupCallback(Property property){
36
			myProperty = property;
37
    	}
38
    	
39
    	public void lookupResolved(NamedElement resolution) {
40
    		if (resolution instanceof Type){
41
    			myProperty.setType((Type)resolution);
42
    		}
43
    	}
44
    }
45
46
    public PropertyParser(){
47
    	this(new StringReader(""));
48
    }
49
    
50
    public PropertyParser(LookupSuite lookup){
51
    	this();
52
    	setLookupSuite(lookup);
53
    }
54
55
	public EClass getSubjectClass(){
56
		return UMLPackage.eINSTANCE.getProperty();
57
	}
58
	
59
	public void parse(EObject target, String text) throws ExternalParserException {
60
		checkContext();
61
		ReInit(new StringReader(text));
62
		mySubject = (Property)target;
63
		Declaration();
64
		mySubject = null;
65
	}
66
	
67
	protected static int parseInt(Token t) throws ParseException {
68
		if (t.kind != PropertyParserConstants.INTEGER_LITERAL){
69
			throw new IllegalStateException("Token: " + t + ", image: " + t.image);
70
		}
71
		try {
72
			return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
73
		} catch (NumberFormatException e){
74
			throw new ParseException("Not supported integer value:" + t.image);
75
		}
76
	}
77
	
78
}
79
80
PARSER_END(PropertyParser)
81
82
/* WHITE SPACE */
83
84
SPECIAL_TOKEN :
85
{
86
  " "
87
| "\t"
88
}
89
90
/* SEPARATORS */
91
TOKEN :
92
{
93
	< SLASH: "/" >
94
|	< COLON: ":" >
95
|	< EQUALS: "=" >
96
|	< LBRACKET: "[" >
97
|	< RBRACKET: "]" >
98
|	< LCURLY: "{" >
99
|	< RCURLY: "}" >
100
|	< COMMA: "," >
101
}
102
103
/* SPECIAL_MEANING */
104
TOKEN :
105
{
106
	< PLUS: "+" >
107
|	< MINUS: "-" >
108
|	< NUMBER_SIGN: "#" >
109
|	< TILDE: "~" >
110
|	< DOT: "." >
111
|	< STAR: "*" >
112
}
113
114
/* MODIFIERS */
115
TOKEN :
116
{
117
	< READ_ONLY: "readOnly" >
118
|	< UNION: "union" >
119
|	< SUBSETS: "subsets" >
120
|	< REDEFINES: "redefines" >
121
|	< ORDERED: "ordered" >
122
|	< UNORDERED: "unordered" > 
123
|	< UNIQUE: "unique" >
124
|	< NON_UNIQUE: "nonunique" >
125
}
126
	
127
/* LITERALS */
128
TOKEN: 
129
{
130
	< INTEGER_LITERAL: ["0"-"9"] (["0"-"9"])* >
131
}
132
  
133
TOKEN :
134
{
135
  < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
136
|
137
  < #LETTER:
138
      [
139
       "\u0024",
140
       "\u0041"-"\u005a",
141
       "\u005f",
142
       "\u0061"-"\u007a",
143
       "\u00c0"-"\u00d6",
144
       "\u00d8"-"\u00f6",
145
       "\u00f8"-"\u00ff",
146
       "\u0100"-"\u1fff",
147
       "\u3040"-"\u318f",
148
       "\u3300"-"\u337f",
149
       "\u3400"-"\u3d2d",
150
       "\u4e00"-"\u9fff",
151
       "\uf900"-"\ufaff"
152
      ]
153
  >
154
|
155
  < #DIGIT:
156
      [
157
       "\u0030"-"\u0039",
158
       "\u0660"-"\u0669",
159
       "\u06f0"-"\u06f9",
160
       "\u0966"-"\u096f",
161
       "\u09e6"-"\u09ef",
162
       "\u0a66"-"\u0a6f",
163
       "\u0ae6"-"\u0aef",
164
       "\u0b66"-"\u0b6f",
165
       "\u0be7"-"\u0bef",
166
       "\u0c66"-"\u0c6f",
167
       "\u0ce6"-"\u0cef",
168
       "\u0d66"-"\u0d6f",
169
       "\u0e50"-"\u0e59",
170
       "\u0ed0"-"\u0ed9",
171
       "\u1040"-"\u1049"
172
      ]
173
  >
174
}
175
176
void Declaration() :
177
{}
178
{
179
	(
180
		[ Visibility() ]
181
		[ IsDerived() ]
182
		PropertyName()
183
		[ PropertyType() ]
184
		[ Multiplicity() ]
185
		[ DefaultValue() ]
186
		[ PropertyModifiers() ]
187
	) <EOF>
188
}
189
190
void PropertyName() :
191
{
192
	String name;
193
}
194
{
195
	name = NameWithSpaces() 
196
	{
197
		mySubject.setName(name);
198
	}
199
}
200
201
void Visibility() :
202
{ 
203
	VisibilityKind kind;
204
}
205
{
206
	(
207
		<PLUS> { kind = VisibilityKind.PUBLIC_LITERAL; }
208
	|
209
		<MINUS> { kind = VisibilityKind.PRIVATE_LITERAL; }
210
	|
211
		<NUMBER_SIGN> { kind = VisibilityKind.PROTECTED_LITERAL; }
212
	|
213
		<TILDE> { kind = VisibilityKind.PACKAGE_LITERAL; }
214
	)
215
	{
216
		mySubject.setVisibility(kind);
217
	}
218
}
219
220
void Multiplicity() :
221
{}
222
{
223
	MultiplicityRange() 
224
	/* XXX: Parse conflict in case of empty DefaultValue, consider "a:int[5]{unique}"  
225
	[ MultiplicityDesignator() ] 
226
	*/
227
}
228
229
/* XXX: Parse conflict in case of empty default value
230
void MultiplicityDesignator() :
231
{ }
232
{
233
	<LCURLY> 
234
	(
235
		( MultiplicityUnique() [ MultiplicityOrdered() ] ) 
236
		|
237
		( MultiplicityOrdered() [ MultiplicityUnique() ] ) 
238
	) 
239
	<RCURLY>
240
}
241
242
void MultiplicityUnique() :
243
{}
244
{
245
		<UNIQUE> { mySubject.setIsUnique(true); }
246
	|
247
		<NON_UNIQUE> { mySubject.setIsUnique(false); }	
248
}
249
250
void MultiplicityOrdered() :
251
{}
252
{
253
		<ORDERED> { mySubject.setIsOrdered(true); }
254
	|
255
		<UNORDERED> { mySubject.setIsOrdered(false); }
256
}
257
258
*/
259
260
/* XXX: ValueSpecification -- how to parse */
261
void MultiplicityRange() :
262
{
263
	Token tLower = null;
264
	Token tUpper;
265
}
266
{
267
	<LBRACKET>
268
	(
269
		[ LOOKAHEAD(2) tLower = <INTEGER_LITERAL> <DOT> <DOT> { mySubject.setLower(parseInt(tLower)); } ] 
270
		(
271
			tUpper = <STAR> 
272
			{ 
273
				if (tLower == null){
274
					mySubject.setLower(0);
275
				}
276
				mySubject.setUpper(LiteralUnlimitedNatural.UNLIMITED); 
277
			}
278
		| 
279
			tUpper = <INTEGER_LITERAL> 
280
			{ 
281
				if (tLower == null){
282
					mySubject.setLower(parseInt(tUpper));
283
				}
284
				mySubject.setUpper(parseInt(tUpper)); 
285
			}
286
		)
287
	)
288
	<RBRACKET>
289
}
290
291
void IsDerived() :
292
{}
293
{
294
	<SLASH> { mySubject.setIsDerived(true); }
295
}
296
297
void PropertyType() :
298
{
299
	String type;
300
}
301
{
302
	<COLON> type = NameWithSpaces() { applyLookup(Type.class, type, new TypeLookupCallback(mySubject)); }
303
}
304
305
String NameWithSpaces() :
306
{
307
	StringBuffer result = new StringBuffer();
308
	Token t;
309
}
310
{
311
	(
312
		t = <IDENTIFIER> { result.append(t.image); } 
313
		( t = <IDENTIFIER> { result.append(' '); result.append(t.image); } ) *
314
	)
315
	{
316
		return result.toString();
317
	}
318
}
319
320
void DefaultValue() :
321
{
322
	Token t;	
323
}
324
{
325
	(
326
		<EQUALS> ( t = <IDENTIFIER> | t = <INTEGER_LITERAL> { /* XXX: Should be Expression */ } )
327
	)
328
	{
329
		mySubject.setDefault(t.image);
330
	}
331
}
332
333
void SimpleTokenPropertyModifier() :
334
{}
335
{
336
	(
337
		<READ_ONLY> { mySubject.setIsReadOnly(true); }
338
	|
339
		<UNION> { mySubject.setIsDerivedUnion(true); }
340
	|
341
		<ORDERED> { mySubject.setIsOrdered(true); }
342
	|
343
		<UNORDERED> { mySubject.setIsOrdered(false); }
344
	|
345
		<UNIQUE> { mySubject.setIsUnique(true); }
346
	|
347
		<NON_UNIQUE> { mySubject.setIsUnique(false); }
348
	)
349
}
350
351
void ReferencingPropertyModifier() :
352
{
353
	String name;
354
}
355
{
356
	(
357
		<SUBSETS> name = NameWithSpaces() 
358
		{ 
359
			Property subsets = lookup(Property.class, name); 
360
			if (subsets != null) {
361
				mySubject.getSubsettedProperties().add(subsets);
362
			}
363
		}
364
	|
365
		<REDEFINES> name = NameWithSpaces() 
366
		{ 
367
			RedefinableElement redefines = lookup(RedefinableElement.class, name); 
368
			if (redefines != null) {
369
				mySubject.getRedefinedElements().add(redefines);
370
			}
371
		}
372
	)
373
}
374
375
void PropertyModifiers() :
376
{}
377
{
378
	<LCURLY> 
379
	( SimpleTokenPropertyModifier() | ReferencingPropertyModifier() )
380
	( <COMMA> ( SimpleTokenPropertyModifier() | ReferencingPropertyModifier() ) )*
381
	<RCURLY>
382
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PortNameViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class PortNameViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(5));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/InstanceSpecificationViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class InstanceSpecificationViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationEditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/slot/SlotParserTokenManager.java (+728 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. SlotParserTokenManager.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.slot;
14
import java.io.*;
15
import org.eclipse.emf.ecore.EClass;
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.uml2.diagram.parser.*;
18
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
19
import org.eclipse.uml2.uml.*;
20
21
public class SlotParserTokenManager implements SlotParserConstants
22
{
23
  public  java.io.PrintStream debugStream = System.out;
24
  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
25
private final int jjStopStringLiteralDfa_0(int pos, long active0)
26
{
27
   switch (pos)
28
   {
29
      case 0:
30
         if ((active0 & 0x1fe0000L) != 0L)
31
         {
32
            jjmatchedKind = 26;
33
            return 2;
34
         }
35
         return -1;
36
      case 1:
37
         if ((active0 & 0x1fe0000L) != 0L)
38
         {
39
            jjmatchedKind = 26;
40
            jjmatchedPos = 1;
41
            return 2;
42
         }
43
         return -1;
44
      case 2:
45
         if ((active0 & 0x1fe0000L) != 0L)
46
         {
47
            jjmatchedKind = 26;
48
            jjmatchedPos = 2;
49
            return 2;
50
         }
51
         return -1;
52
      case 3:
53
         if ((active0 & 0x1fe0000L) != 0L)
54
         {
55
            jjmatchedKind = 26;
56
            jjmatchedPos = 3;
57
            return 2;
58
         }
59
         return -1;
60
      case 4:
61
         if ((active0 & 0x40000L) != 0L)
62
            return 2;
63
         if ((active0 & 0x1fa0000L) != 0L)
64
         {
65
            jjmatchedKind = 26;
66
            jjmatchedPos = 4;
67
            return 2;
68
         }
69
         return -1;
70
      case 5:
71
         if ((active0 & 0x800000L) != 0L)
72
            return 2;
73
         if ((active0 & 0x17a0000L) != 0L)
74
         {
75
            jjmatchedKind = 26;
76
            jjmatchedPos = 5;
77
            return 2;
78
         }
79
         return -1;
80
      case 6:
81
         if ((active0 & 0x280000L) != 0L)
82
            return 2;
83
         if ((active0 & 0x1520000L) != 0L)
84
         {
85
            jjmatchedKind = 26;
86
            jjmatchedPos = 6;
87
            return 2;
88
         }
89
         return -1;
90
      case 7:
91
         if ((active0 & 0x20000L) != 0L)
92
            return 2;
93
         if ((active0 & 0x1500000L) != 0L)
94
         {
95
            jjmatchedKind = 26;
96
            jjmatchedPos = 7;
97
            return 2;
98
         }
99
         return -1;
100
      default :
101
         return -1;
102
   }
103
}
104
private final int jjStartNfa_0(int pos, long active0)
105
{
106
   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
107
}
108
private final int jjStopAtPos(int pos, int kind)
109
{
110
   jjmatchedKind = kind;
111
   jjmatchedPos = pos;
112
   return pos + 1;
113
}
114
private final int jjStartNfaWithStates_0(int pos, int kind, int state)
115
{
116
   jjmatchedKind = kind;
117
   jjmatchedPos = pos;
118
   try { curChar = input_stream.readChar(); }
119
   catch(java.io.IOException e) { return pos + 1; }
120
   return jjMoveNfa_0(state, pos + 1);
121
}
122
private final int jjMoveStringLiteralDfa0_0()
123
{
124
   switch(curChar)
125
   {
126
      case 9:
127
         return jjStopAtPos(0, 2);
128
      case 32:
129
         return jjStopAtPos(0, 1);
130
      case 34:
131
         return jjStopAtPos(0, 29);
132
      case 35:
133
         return jjStopAtPos(0, 13);
134
      case 42:
135
         return jjStopAtPos(0, 16);
136
      case 43:
137
         return jjStopAtPos(0, 11);
138
      case 44:
139
         return jjStopAtPos(0, 10);
140
      case 45:
141
         return jjStopAtPos(0, 12);
142
      case 46:
143
         return jjStopAtPos(0, 15);
144
      case 47:
145
         return jjStopAtPos(0, 3);
146
      case 58:
147
         return jjStopAtPos(0, 4);
148
      case 61:
149
         return jjStopAtPos(0, 5);
150
      case 91:
151
         return jjStopAtPos(0, 6);
152
      case 93:
153
         return jjStopAtPos(0, 7);
154
      case 110:
155
         return jjMoveStringLiteralDfa1_0(0x1000000L);
156
      case 111:
157
         return jjMoveStringLiteralDfa1_0(0x200000L);
158
      case 114:
159
         return jjMoveStringLiteralDfa1_0(0x120000L);
160
      case 115:
161
         return jjMoveStringLiteralDfa1_0(0x80000L);
162
      case 117:
163
         return jjMoveStringLiteralDfa1_0(0xc40000L);
164
      case 123:
165
         return jjStopAtPos(0, 8);
166
      case 125:
167
         return jjStopAtPos(0, 9);
168
      case 126:
169
         return jjStopAtPos(0, 14);
170
      default :
171
         return jjMoveNfa_0(1, 0);
172
   }
173
}
174
private final int jjMoveStringLiteralDfa1_0(long active0)
175
{
176
   try { curChar = input_stream.readChar(); }
177
   catch(java.io.IOException e) {
178
      jjStopStringLiteralDfa_0(0, active0);
179
      return 1;
180
   }
181
   switch(curChar)
182
   {
183
      case 101:
184
         return jjMoveStringLiteralDfa2_0(active0, 0x120000L);
185
      case 110:
186
         return jjMoveStringLiteralDfa2_0(active0, 0xc40000L);
187
      case 111:
188
         return jjMoveStringLiteralDfa2_0(active0, 0x1000000L);
189
      case 114:
190
         return jjMoveStringLiteralDfa2_0(active0, 0x200000L);
191
      case 117:
192
         return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
193
      default :
194
         break;
195
   }
196
   return jjStartNfa_0(0, active0);
197
}
198
private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
199
{
200
   if (((active0 &= old0)) == 0L)
201
      return jjStartNfa_0(0, old0); 
202
   try { curChar = input_stream.readChar(); }
203
   catch(java.io.IOException e) {
204
      jjStopStringLiteralDfa_0(1, active0);
205
      return 2;
206
   }
207
   switch(curChar)
208
   {
209
      case 97:
210
         return jjMoveStringLiteralDfa3_0(active0, 0x20000L);
211
      case 98:
212
         return jjMoveStringLiteralDfa3_0(active0, 0x80000L);
213
      case 100:
214
         return jjMoveStringLiteralDfa3_0(active0, 0x300000L);
215
      case 105:
216
         return jjMoveStringLiteralDfa3_0(active0, 0x840000L);
217
      case 110:
218
         return jjMoveStringLiteralDfa3_0(active0, 0x1000000L);
219
      case 111:
220
         return jjMoveStringLiteralDfa3_0(active0, 0x400000L);
221
      default :
222
         break;
223
   }
224
   return jjStartNfa_0(1, active0);
225
}
226
private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
227
{
228
   if (((active0 &= old0)) == 0L)
229
      return jjStartNfa_0(1, old0); 
230
   try { curChar = input_stream.readChar(); }
231
   catch(java.io.IOException e) {
232
      jjStopStringLiteralDfa_0(2, active0);
233
      return 3;
234
   }
235
   switch(curChar)
236
   {
237
      case 100:
238
         return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
239
      case 101:
240
         return jjMoveStringLiteralDfa4_0(active0, 0x300000L);
241
      case 111:
242
         return jjMoveStringLiteralDfa4_0(active0, 0x40000L);
243
      case 113:
244
         return jjMoveStringLiteralDfa4_0(active0, 0x800000L);
245
      case 114:
246
         return jjMoveStringLiteralDfa4_0(active0, 0x400000L);
247
      case 115:
248
         return jjMoveStringLiteralDfa4_0(active0, 0x80000L);
249
      case 117:
250
         return jjMoveStringLiteralDfa4_0(active0, 0x1000000L);
251
      default :
252
         break;
253
   }
254
   return jjStartNfa_0(2, active0);
255
}
256
private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
257
{
258
   if (((active0 &= old0)) == 0L)
259
      return jjStartNfa_0(2, old0); 
260
   try { curChar = input_stream.readChar(); }
261
   catch(java.io.IOException e) {
262
      jjStopStringLiteralDfa_0(3, active0);
263
      return 4;
264
   }
265
   switch(curChar)
266
   {
267
      case 79:
268
         return jjMoveStringLiteralDfa5_0(active0, 0x20000L);
269
      case 100:
270
         return jjMoveStringLiteralDfa5_0(active0, 0x400000L);
271
      case 101:
272
         return jjMoveStringLiteralDfa5_0(active0, 0x80000L);
273
      case 102:
274
         return jjMoveStringLiteralDfa5_0(active0, 0x100000L);
275
      case 110:
276
         if ((active0 & 0x40000L) != 0L)
277
            return jjStartNfaWithStates_0(4, 18, 2);
278
         return jjMoveStringLiteralDfa5_0(active0, 0x1000000L);
279
      case 114:
280
         return jjMoveStringLiteralDfa5_0(active0, 0x200000L);
281
      case 117:
282
         return jjMoveStringLiteralDfa5_0(active0, 0x800000L);
283
      default :
284
         break;
285
   }
286
   return jjStartNfa_0(3, active0);
287
}
288
private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
289
{
290
   if (((active0 &= old0)) == 0L)
291
      return jjStartNfa_0(3, old0); 
292
   try { curChar = input_stream.readChar(); }
293
   catch(java.io.IOException e) {
294
      jjStopStringLiteralDfa_0(4, active0);
295
      return 5;
296
   }
297
   switch(curChar)
298
   {
299
      case 101:
300
         if ((active0 & 0x800000L) != 0L)
301
            return jjStartNfaWithStates_0(5, 23, 2);
302
         return jjMoveStringLiteralDfa6_0(active0, 0x600000L);
303
      case 105:
304
         return jjMoveStringLiteralDfa6_0(active0, 0x1100000L);
305
      case 110:
306
         return jjMoveStringLiteralDfa6_0(active0, 0x20000L);
307
      case 116:
308
         return jjMoveStringLiteralDfa6_0(active0, 0x80000L);
309
      default :
310
         break;
311
   }
312
   return jjStartNfa_0(4, active0);
313
}
314
private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
315
{
316
   if (((active0 &= old0)) == 0L)
317
      return jjStartNfa_0(4, old0); 
318
   try { curChar = input_stream.readChar(); }
319
   catch(java.io.IOException e) {
320
      jjStopStringLiteralDfa_0(5, active0);
321
      return 6;
322
   }
323
   switch(curChar)
324
   {
325
      case 100:
326
         if ((active0 & 0x200000L) != 0L)
327
            return jjStartNfaWithStates_0(6, 21, 2);
328
         break;
329
      case 108:
330
         return jjMoveStringLiteralDfa7_0(active0, 0x20000L);
331
      case 110:
332
         return jjMoveStringLiteralDfa7_0(active0, 0x100000L);
333
      case 113:
334
         return jjMoveStringLiteralDfa7_0(active0, 0x1000000L);
335
      case 114:
336
         return jjMoveStringLiteralDfa7_0(active0, 0x400000L);
337
      case 115:
338
         if ((active0 & 0x80000L) != 0L)
339
            return jjStartNfaWithStates_0(6, 19, 2);
340
         break;
341
      default :
342
         break;
343
   }
344
   return jjStartNfa_0(5, active0);
345
}
346
private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
347
{
348
   if (((active0 &= old0)) == 0L)
349
      return jjStartNfa_0(5, old0); 
350
   try { curChar = input_stream.readChar(); }
351
   catch(java.io.IOException e) {
352
      jjStopStringLiteralDfa_0(6, active0);
353
      return 7;
354
   }
355
   switch(curChar)
356
   {
357
      case 101:
358
         return jjMoveStringLiteralDfa8_0(active0, 0x500000L);
359
      case 117:
360
         return jjMoveStringLiteralDfa8_0(active0, 0x1000000L);
361
      case 121:
362
         if ((active0 & 0x20000L) != 0L)
363
            return jjStartNfaWithStates_0(7, 17, 2);
364
         break;
365
      default :
366
         break;
367
   }
368
   return jjStartNfa_0(6, active0);
369
}
370
private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
371
{
372
   if (((active0 &= old0)) == 0L)
373
      return jjStartNfa_0(6, old0); 
374
   try { curChar = input_stream.readChar(); }
375
   catch(java.io.IOException e) {
376
      jjStopStringLiteralDfa_0(7, active0);
377
      return 8;
378
   }
379
   switch(curChar)
380
   {
381
      case 100:
382
         if ((active0 & 0x400000L) != 0L)
383
            return jjStartNfaWithStates_0(8, 22, 2);
384
         break;
385
      case 101:
386
         if ((active0 & 0x1000000L) != 0L)
387
            return jjStartNfaWithStates_0(8, 24, 2);
388
         break;
389
      case 115:
390
         if ((active0 & 0x100000L) != 0L)
391
            return jjStartNfaWithStates_0(8, 20, 2);
392
         break;
393
      default :
394
         break;
395
   }
396
   return jjStartNfa_0(7, active0);
397
}
398
private final void jjCheckNAdd(int state)
399
{
400
   if (jjrounds[state] != jjround)
401
   {
402
      jjstateSet[jjnewStateCnt++] = state;
403
      jjrounds[state] = jjround;
404
   }
405
}
406
private final void jjAddStates(int start, int end)
407
{
408
   do {
409
      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
410
   } while (start++ != end);
411
}
412
private final void jjCheckNAddTwoStates(int state1, int state2)
413
{
414
   jjCheckNAdd(state1);
415
   jjCheckNAdd(state2);
416
}
417
private final void jjCheckNAddStates(int start, int end)
418
{
419
   do {
420
      jjCheckNAdd(jjnextStates[start]);
421
   } while (start++ != end);
422
}
423
private final void jjCheckNAddStates(int start)
424
{
425
   jjCheckNAdd(jjnextStates[start]);
426
   jjCheckNAdd(jjnextStates[start + 1]);
427
}
428
static final long[] jjbitVec0 = {
429
   0x1ff00000fffffffeL, 0xffffffffffffc000L, 0xffffffffL, 0x600000000000000L
430
};
431
static final long[] jjbitVec2 = {
432
   0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
433
};
434
static final long[] jjbitVec3 = {
435
   0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
436
};
437
static final long[] jjbitVec4 = {
438
   0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
439
};
440
static final long[] jjbitVec5 = {
441
   0xffffffffffffffffL, 0xffffffffffffffffL, 0x0L, 0x0L
442
};
443
static final long[] jjbitVec6 = {
444
   0x3fffffffffffL, 0x0L, 0x0L, 0x0L
445
};
446
private final int jjMoveNfa_0(int startState, int curPos)
447
{
448
   int[] nextStates;
449
   int startsAt = 0;
450
   jjnewStateCnt = 3;
451
   int i = 1;
452
   jjstateSet[0] = startState;
453
   int j, kind = 0x7fffffff;
454
   for (;;)
455
   {
456
      if (++jjround == 0x7fffffff)
457
         ReInitRounds();
458
      if (curChar < 64)
459
      {
460
         long l = 1L << curChar;
461
         MatchLoop: do
462
         {
463
            switch(jjstateSet[--i])
464
            {
465
               case 1:
466
                  if ((0x3ff000000000000L & l) != 0L)
467
                  {
468
                     if (kind > 25)
469
                        kind = 25;
470
                     jjCheckNAdd(0);
471
                  }
472
                  else if (curChar == 36)
473
                  {
474
                     if (kind > 26)
475
                        kind = 26;
476
                     jjCheckNAdd(2);
477
                  }
478
                  break;
479
               case 0:
480
                  if ((0x3ff000000000000L & l) == 0L)
481
                     break;
482
                  if (kind > 25)
483
                     kind = 25;
484
                  jjCheckNAdd(0);
485
                  break;
486
               case 2:
487
                  if ((0x3ff001000000000L & l) == 0L)
488
                     break;
489
                  if (kind > 26)
490
                     kind = 26;
491
                  jjCheckNAdd(2);
492
                  break;
493
               default : break;
494
            }
495
         } while(i != startsAt);
496
      }
497
      else if (curChar < 128)
498
      {
499
         long l = 1L << (curChar & 077);
500
         MatchLoop: do
501
         {
502
            switch(jjstateSet[--i])
503
            {
504
               case 1:
505
               case 2:
506
                  if ((0x7fffffe87fffffeL & l) == 0L)
507
                     break;
508
                  if (kind > 26)
509
                     kind = 26;
510
                  jjCheckNAdd(2);
511
                  break;
512
               default : break;
513
            }
514
         } while(i != startsAt);
515
      }
516
      else
517
      {
518
         int hiByte = (int)(curChar >> 8);
519
         int i1 = hiByte >> 6;
520
         long l1 = 1L << (hiByte & 077);
521
         int i2 = (curChar & 0xff) >> 6;
522
         long l2 = 1L << (curChar & 077);
523
         MatchLoop: do
524
         {
525
            switch(jjstateSet[--i])
526
            {
527
               case 1:
528
               case 2:
529
                  if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
530
                     break;
531
                  if (kind > 26)
532
                     kind = 26;
533
                  jjCheckNAdd(2);
534
                  break;
535
               default : break;
536
            }
537
         } while(i != startsAt);
538
      }
539
      if (kind != 0x7fffffff)
540
      {
541
         jjmatchedKind = kind;
542
         jjmatchedPos = curPos;
543
         kind = 0x7fffffff;
544
      }
545
      ++curPos;
546
      if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
547
         return curPos;
548
      try { curChar = input_stream.readChar(); }
549
      catch(java.io.IOException e) { return curPos; }
550
   }
551
}
552
static final int[] jjnextStates = {
553
};
554
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
555
{
556
   switch(hiByte)
557
   {
558
      case 0:
559
         return ((jjbitVec2[i2] & l2) != 0L);
560
      case 48:
561
         return ((jjbitVec3[i2] & l2) != 0L);
562
      case 49:
563
         return ((jjbitVec4[i2] & l2) != 0L);
564
      case 51:
565
         return ((jjbitVec5[i2] & l2) != 0L);
566
      case 61:
567
         return ((jjbitVec6[i2] & l2) != 0L);
568
      default : 
569
         if ((jjbitVec0[i1] & l1) != 0L)
570
            return true;
571
         return false;
572
   }
573
}
574
public static final String[] jjstrLiteralImages = {
575
"", null, null, "\57", "\72", "\75", "\133", "\135", "\173", "\175", "\54", 
576
"\53", "\55", "\43", "\176", "\56", "\52", "\162\145\141\144\117\156\154\171", 
577
"\165\156\151\157\156", "\163\165\142\163\145\164\163", "\162\145\144\145\146\151\156\145\163", 
578
"\157\162\144\145\162\145\144", "\165\156\157\162\144\145\162\145\144", "\165\156\151\161\165\145", 
579
"\156\157\156\165\156\151\161\165\145", null, null, null, null, "\42", };
580
public static final String[] lexStateNames = {
581
   "DEFAULT", 
582
};
583
static final long[] jjtoToken = {
584
   0x27fffff9L, 
585
};
586
static final long[] jjtoSkip = {
587
   0x6L, 
588
};
589
static final long[] jjtoSpecial = {
590
   0x6L, 
591
};
592
protected JavaCharStream input_stream;
593
private final int[] jjrounds = new int[3];
594
private final int[] jjstateSet = new int[6];
595
protected char curChar;
596
public SlotParserTokenManager(JavaCharStream stream)
597
{
598
   if (JavaCharStream.staticFlag)
599
      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
600
   input_stream = stream;
601
}
602
public SlotParserTokenManager(JavaCharStream stream, int lexState)
603
{
604
   this(stream);
605
   SwitchTo(lexState);
606
}
607
public void ReInit(JavaCharStream stream)
608
{
609
   jjmatchedPos = jjnewStateCnt = 0;
610
   curLexState = defaultLexState;
611
   input_stream = stream;
612
   ReInitRounds();
613
}
614
private final void ReInitRounds()
615
{
616
   int i;
617
   jjround = 0x80000001;
618
   for (i = 3; i-- > 0;)
619
      jjrounds[i] = 0x80000000;
620
}
621
public void ReInit(JavaCharStream stream, int lexState)
622
{
623
   ReInit(stream);
624
   SwitchTo(lexState);
625
}
626
public void SwitchTo(int lexState)
627
{
628
   if (lexState >= 1 || lexState < 0)
629
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
630
   else
631
      curLexState = lexState;
632
}
633
634
protected Token jjFillToken()
635
{
636
   Token t = Token.newToken(jjmatchedKind);
637
   t.kind = jjmatchedKind;
638
   String im = jjstrLiteralImages[jjmatchedKind];
639
   t.image = (im == null) ? input_stream.GetImage() : im;
640
   t.beginLine = input_stream.getBeginLine();
641
   t.beginColumn = input_stream.getBeginColumn();
642
   t.endLine = input_stream.getEndLine();
643
   t.endColumn = input_stream.getEndColumn();
644
   return t;
645
}
646
647
int curLexState = 0;
648
int defaultLexState = 0;
649
int jjnewStateCnt;
650
int jjround;
651
int jjmatchedPos;
652
int jjmatchedKind;
653
654
public Token getNextToken() 
655
{
656
  int kind;
657
  Token specialToken = null;
658
  Token matchedToken;
659
  int curPos = 0;
660
661
  EOFLoop :
662
  for (;;)
663
  {   
664
   try   
665
   {     
666
      curChar = input_stream.BeginToken();
667
   }     
668
   catch(java.io.IOException e)
669
   {        
670
      jjmatchedKind = 0;
671
      matchedToken = jjFillToken();
672
      matchedToken.specialToken = specialToken;
673
      return matchedToken;
674
   }
675
676
   jjmatchedKind = 0x7fffffff;
677
   jjmatchedPos = 0;
678
   curPos = jjMoveStringLiteralDfa0_0();
679
   if (jjmatchedKind != 0x7fffffff)
680
   {
681
      if (jjmatchedPos + 1 < curPos)
682
         input_stream.backup(curPos - jjmatchedPos - 1);
683
      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
684
      {
685
         matchedToken = jjFillToken();
686
         matchedToken.specialToken = specialToken;
687
         return matchedToken;
688
      }
689
      else
690
      {
691
         if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
692
         {
693
            matchedToken = jjFillToken();
694
            if (specialToken == null)
695
               specialToken = matchedToken;
696
            else
697
            {
698
               matchedToken.specialToken = specialToken;
699
               specialToken = (specialToken.next = matchedToken);
700
            }
701
         }
702
         continue EOFLoop;
703
      }
704
   }
705
   int error_line = input_stream.getEndLine();
706
   int error_column = input_stream.getEndColumn();
707
   String error_after = null;
708
   boolean EOFSeen = false;
709
   try { input_stream.readChar(); input_stream.backup(1); }
710
   catch (java.io.IOException e1) {
711
      EOFSeen = true;
712
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
713
      if (curChar == '\n' || curChar == '\r') {
714
         error_line++;
715
         error_column = 0;
716
      }
717
      else
718
         error_column++;
719
   }
720
   if (!EOFSeen) {
721
      input_stream.backup(1);
722
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
723
   }
724
   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
725
  }
726
}
727
728
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLCreationWizard.java (+128 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import java.lang.reflect.InvocationTargetException;
4
5
import org.eclipse.core.runtime.CoreException;
6
import org.eclipse.core.runtime.IProgressMonitor;
7
import org.eclipse.emf.common.util.URI;
8
import org.eclipse.jface.dialogs.ErrorDialog;
9
import org.eclipse.jface.operation.IRunnableWithProgress;
10
import org.eclipse.jface.viewers.IStructuredSelection;
11
import org.eclipse.jface.wizard.Wizard;
12
import org.eclipse.ui.INewWizard;
13
import org.eclipse.ui.IWorkbench;
14
import org.eclipse.ui.actions.WorkspaceModifyOperation;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
17
/**
18
 * @generated
19
 */
20
public class UMLCreationWizard extends Wizard implements INewWizard {
21
22
	/**
23
	 * @generated
24
	 */
25
	private IWorkbench workbench;
26
27
	/**
28
	 * @generated
29
	 */
30
	protected IStructuredSelection selection;
31
32
	/**
33
	 * @generated
34
	 */
35
	protected UMLCreationWizardPage page;
36
37
	/**
38
	 * @generated
39
	 */
40
	protected URI diagramURI;
41
42
	/**
43
	 * @generated
44
	 */
45
	private boolean openNewlyCreatedDiagramEditor = true;
46
47
	/**
48
	 * @generated
49
	 */
50
	public IWorkbench getWorkbench() {
51
		return workbench;
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	public IStructuredSelection getSelection() {
58
		return selection;
59
	}
60
61
	/**
62
	 * @generated
63
	 */
64
	public final URI getDiagramURI() {
65
		return diagramURI;
66
	}
67
68
	/**
69
	 * @generated
70
	 */
71
	public final boolean isOpenNewlyCreatedDiagramEditor() {
72
		return openNewlyCreatedDiagramEditor;
73
	}
74
75
	/**
76
	 * @generated
77
	 */
78
	public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) {
79
		this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
80
	}
81
82
	/**
83
	 * @generated
84
	 */
85
	public void init(IWorkbench workbench, IStructuredSelection selection) {
86
		this.workbench = workbench;
87
		this.selection = selection;
88
		setWindowTitle("New UMLClass Diagram");
89
		setDefaultPageImageDescriptor(UMLDiagramEditorPlugin.getBundledImageDescriptor("icons/wizban/NewUMLWizard.gif")); //$NON-NLS-1$
90
		setNeedsProgressMonitor(true);
91
	}
92
93
	/**
94
	 * @generated
95
	 */
96
	public void addPages() {
97
		page = new UMLCreationWizardPage("CreationWizardPage", getSelection()); //$NON-NLS-1$
98
		page.setTitle("Create UMLClass Diagram");
99
		page.setDescription("Create a new UMLClass diagram.");
100
		addPage(page);
101
	}
102
103
	/**
104
	 * @generated
105
	 */
106
	public boolean performFinish() {
107
		IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
108
109
			protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException {
110
				diagramURI = UMLDiagramEditorUtil.createAndOpenDiagram(page.getContainerFullPath(), page.getFileName(), getWorkbench().getActiveWorkbenchWindow(), monitor,
111
						isOpenNewlyCreatedDiagramEditor(), true);
112
			}
113
		};
114
		try {
115
			getContainer().run(false, true, op);
116
		} catch (InterruptedException e) {
117
			return false;
118
		} catch (InvocationTargetException e) {
119
			if (e.getTargetException() instanceof CoreException) {
120
				ErrorDialog.openError(getContainer().getShell(), "Creation Problems", null, ((CoreException) e.getTargetException()).getStatus());
121
			} else {
122
				UMLDiagramEditorPlugin.getInstance().logError("Error creating diagram", e.getTargetException()); //$NON-NLS-1$
123
			}
124
			return false;
125
		}
126
		return diagramURI != null;
127
	}
128
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Operation4ViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class Operation4ViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Operation4EditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/InterfaceEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class InterfaceEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/providers/UMLStructuralFeatureParser.java (+132 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.providers;
2
3
import java.text.FieldPosition;
4
import java.text.MessageFormat;
5
import java.util.Collections;
6
7
import org.eclipse.core.runtime.IAdaptable;
8
import org.eclipse.emf.common.notify.Notification;
9
import org.eclipse.emf.ecore.EObject;
10
import org.eclipse.emf.ecore.EStructuralFeature;
11
import org.eclipse.emf.transaction.TransactionalEditingDomain;
12
import org.eclipse.emf.transaction.util.TransactionUtil;
13
import org.eclipse.gmf.runtime.common.core.command.ICommand;
14
import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
15
import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
16
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
17
import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
18
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
19
20
/**
21
 * @generated
22
 */
23
public class UMLStructuralFeatureParser extends UMLAbstractParser {
24
25
	/**
26
	 * @generated
27
	 */
28
	public static final MessageFormat DEFAULT_PROCESSOR = new MessageFormat("{0}"); //$NON-NLS-1$
29
30
	/**
31
	 * @generated
32
	 */
33
	private EStructuralFeature feature;
34
35
	/**
36
	 * @generated
37
	 */
38
	public UMLStructuralFeatureParser(EStructuralFeature feature) {
39
		this.feature = feature;
40
	}
41
42
	/**
43
	 * @generated
44
	 */
45
	protected MessageFormat getViewProcessor() {
46
		MessageFormat processor = super.getViewProcessor();
47
		return processor == null ? DEFAULT_PROCESSOR : processor;
48
	}
49
50
	/**
51
	 * @generated
52
	 */
53
	protected MessageFormat getEditProcessor() {
54
		MessageFormat processor = super.getEditProcessor();
55
		return processor == null ? DEFAULT_PROCESSOR : processor;
56
	}
57
58
	/**
59
	 * @generated
60
	 */
61
	protected EObject getDomainElement(EObject element) {
62
		return element;
63
	}
64
65
	/**
66
	 * @generated
67
	 */
68
	protected String getStringByPattern(IAdaptable adapter, int flags, String pattern, MessageFormat processor) {
69
		EObject element = (EObject) adapter.getAdapter(EObject.class);
70
		element = getDomainElement(element);
71
		return getStringByPattern(element, feature, processor);
72
	}
73
74
	/**
75
	 * @generated
76
	 */
77
	protected String getStringByPattern(EObject element, EStructuralFeature feature, MessageFormat processor) {
78
		Object value = element == null ? null : element.eGet(feature);
79
		value = getValidValue(feature, value);
80
		return processor.format(new Object[] { value }, new StringBuffer(), new FieldPosition(0)).toString();
81
	}
82
83
	/**
84
	 * @generated
85
	 */
86
	protected IParserEditStatus validateValues(Object[] values) {
87
		if (values.length > 1) {
88
			return ParserEditStatus.UNEDITABLE_STATUS;
89
		}
90
		Object value = values.length == 1 ? values[0] : null;
91
		value = getValidNewValue(feature, value);
92
		if (value instanceof InvalidValue) {
93
			return new ParserEditStatus(UMLDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, value.toString());
94
		}
95
		return ParserEditStatus.EDITABLE_STATUS;
96
	}
97
98
	/**
99
	 * @generated
100
	 */
101
	public ICommand getParseCommand(IAdaptable adapter, Object[] values) {
102
		EObject element = (EObject) adapter.getAdapter(EObject.class);
103
		element = getDomainElement(element);
104
		if (element == null) {
105
			return UnexecutableCommand.INSTANCE;
106
		}
107
		TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
108
		if (editingDomain == null) {
109
			return UnexecutableCommand.INSTANCE;
110
		}
111
		Object value = values.length == 1 ? values[0] : null;
112
		ICommand command = getModificationCommand(element, feature, value);
113
		return new CompositeTransactionalCommand(editingDomain, command.getLabel(), Collections.singletonList(command));
114
	}
115
116
	/**
117
	 * @generated
118
	 */
119
	public boolean isAffectingEvent(Object event, int flags) {
120
		if (event instanceof Notification) {
121
			return isAffectingFeature(((Notification) event).getFeature());
122
		}
123
		return false;
124
	}
125
126
	/**
127
	 * @generated
128
	 */
129
	protected boolean isAffectingFeature(Object eventFeature) {
130
		return feature == eventFeature;
131
	}
132
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/Property5EditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class Property5EditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)icons/outgoingLinksNavigatorGroup.gif (+5 lines)
Added Link Here
1
GIF89aÕÿÿ­r/‚GøØˆžf'øÐxøà˜øÐ€f>2èÆ”øè°èЈøðÈÿÿÿË6úöºøà øØ?Œ]Føè˜Ò«€üößãϹ´2àÀx­r+ðØ?¥l$yO@ž_­l$?R¼2ï߯¼…2Å6!ù,s@€pH,?È#âèh:‚¨T0ô4®
2
‹à‘?p©€Ñd¢Y`B‚¡‹p8G AØ%‚%HÁçW¶	_B†‰Š‹?’“’š??–B¥¦¥ B­®­©C³´µI·¸FA;Content-Type: image/gif
3
4
GIF89aÕÿÿ­r/‚GøØˆžf'øÐxøà˜øÐ€f>2èÆ”øè°èЈøðÈÿÿÿË6úöºøà øØ?Œ]Føè˜Ò«€üößãϹ´2àÀx­r+ðØ?¥l$yO@ž_­l$?R¼2ï߯¼…2Å6!ù,s@€pH,?È#âèh:‚¨T0ô4®
5
‹à‘?p©€Ñd¢Y`B‚¡‹p8G AØ%‚%HÁçW¶	_B†‰Š‹?’“’š??–B¥¦¥ B­®­©C³´µI·¸FA;
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/name/AssociationNameParserTokenManager.java (+726 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. AssociationNameParserTokenManager.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.name;
14
import java.io.*;
15
import org.eclipse.emf.ecore.EClass;
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.uml2.diagram.parser.*;
18
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
19
import org.eclipse.uml2.uml.*;
20
21
public class AssociationNameParserTokenManager implements AssociationNameParserConstants
22
{
23
  public  java.io.PrintStream debugStream = System.out;
24
  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
25
private final int jjStopStringLiteralDfa_0(int pos, long active0)
26
{
27
   switch (pos)
28
   {
29
      case 0:
30
         if ((active0 & 0x1fe0000L) != 0L)
31
         {
32
            jjmatchedKind = 26;
33
            return 2;
34
         }
35
         return -1;
36
      case 1:
37
         if ((active0 & 0x1fe0000L) != 0L)
38
         {
39
            jjmatchedKind = 26;
40
            jjmatchedPos = 1;
41
            return 2;
42
         }
43
         return -1;
44
      case 2:
45
         if ((active0 & 0x1fe0000L) != 0L)
46
         {
47
            jjmatchedKind = 26;
48
            jjmatchedPos = 2;
49
            return 2;
50
         }
51
         return -1;
52
      case 3:
53
         if ((active0 & 0x1fe0000L) != 0L)
54
         {
55
            jjmatchedKind = 26;
56
            jjmatchedPos = 3;
57
            return 2;
58
         }
59
         return -1;
60
      case 4:
61
         if ((active0 & 0x40000L) != 0L)
62
            return 2;
63
         if ((active0 & 0x1fa0000L) != 0L)
64
         {
65
            jjmatchedKind = 26;
66
            jjmatchedPos = 4;
67
            return 2;
68
         }
69
         return -1;
70
      case 5:
71
         if ((active0 & 0x800000L) != 0L)
72
            return 2;
73
         if ((active0 & 0x17a0000L) != 0L)
74
         {
75
            jjmatchedKind = 26;
76
            jjmatchedPos = 5;
77
            return 2;
78
         }
79
         return -1;
80
      case 6:
81
         if ((active0 & 0x280000L) != 0L)
82
            return 2;
83
         if ((active0 & 0x1520000L) != 0L)
84
         {
85
            jjmatchedKind = 26;
86
            jjmatchedPos = 6;
87
            return 2;
88
         }
89
         return -1;
90
      case 7:
91
         if ((active0 & 0x20000L) != 0L)
92
            return 2;
93
         if ((active0 & 0x1500000L) != 0L)
94
         {
95
            jjmatchedKind = 26;
96
            jjmatchedPos = 7;
97
            return 2;
98
         }
99
         return -1;
100
      default :
101
         return -1;
102
   }
103
}
104
private final int jjStartNfa_0(int pos, long active0)
105
{
106
   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
107
}
108
private final int jjStopAtPos(int pos, int kind)
109
{
110
   jjmatchedKind = kind;
111
   jjmatchedPos = pos;
112
   return pos + 1;
113
}
114
private final int jjStartNfaWithStates_0(int pos, int kind, int state)
115
{
116
   jjmatchedKind = kind;
117
   jjmatchedPos = pos;
118
   try { curChar = input_stream.readChar(); }
119
   catch(java.io.IOException e) { return pos + 1; }
120
   return jjMoveNfa_0(state, pos + 1);
121
}
122
private final int jjMoveStringLiteralDfa0_0()
123
{
124
   switch(curChar)
125
   {
126
      case 9:
127
         return jjStopAtPos(0, 2);
128
      case 32:
129
         return jjStopAtPos(0, 1);
130
      case 35:
131
         return jjStopAtPos(0, 13);
132
      case 42:
133
         return jjStopAtPos(0, 16);
134
      case 43:
135
         return jjStopAtPos(0, 11);
136
      case 44:
137
         return jjStopAtPos(0, 10);
138
      case 45:
139
         return jjStopAtPos(0, 12);
140
      case 46:
141
         return jjStopAtPos(0, 15);
142
      case 47:
143
         return jjStopAtPos(0, 3);
144
      case 58:
145
         return jjStopAtPos(0, 4);
146
      case 61:
147
         return jjStopAtPos(0, 5);
148
      case 91:
149
         return jjStopAtPos(0, 6);
150
      case 93:
151
         return jjStopAtPos(0, 7);
152
      case 110:
153
         return jjMoveStringLiteralDfa1_0(0x1000000L);
154
      case 111:
155
         return jjMoveStringLiteralDfa1_0(0x200000L);
156
      case 114:
157
         return jjMoveStringLiteralDfa1_0(0x120000L);
158
      case 115:
159
         return jjMoveStringLiteralDfa1_0(0x80000L);
160
      case 117:
161
         return jjMoveStringLiteralDfa1_0(0xc40000L);
162
      case 123:
163
         return jjStopAtPos(0, 8);
164
      case 125:
165
         return jjStopAtPos(0, 9);
166
      case 126:
167
         return jjStopAtPos(0, 14);
168
      default :
169
         return jjMoveNfa_0(1, 0);
170
   }
171
}
172
private final int jjMoveStringLiteralDfa1_0(long active0)
173
{
174
   try { curChar = input_stream.readChar(); }
175
   catch(java.io.IOException e) {
176
      jjStopStringLiteralDfa_0(0, active0);
177
      return 1;
178
   }
179
   switch(curChar)
180
   {
181
      case 101:
182
         return jjMoveStringLiteralDfa2_0(active0, 0x120000L);
183
      case 110:
184
         return jjMoveStringLiteralDfa2_0(active0, 0xc40000L);
185
      case 111:
186
         return jjMoveStringLiteralDfa2_0(active0, 0x1000000L);
187
      case 114:
188
         return jjMoveStringLiteralDfa2_0(active0, 0x200000L);
189
      case 117:
190
         return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
191
      default :
192
         break;
193
   }
194
   return jjStartNfa_0(0, active0);
195
}
196
private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
197
{
198
   if (((active0 &= old0)) == 0L)
199
      return jjStartNfa_0(0, old0); 
200
   try { curChar = input_stream.readChar(); }
201
   catch(java.io.IOException e) {
202
      jjStopStringLiteralDfa_0(1, active0);
203
      return 2;
204
   }
205
   switch(curChar)
206
   {
207
      case 97:
208
         return jjMoveStringLiteralDfa3_0(active0, 0x20000L);
209
      case 98:
210
         return jjMoveStringLiteralDfa3_0(active0, 0x80000L);
211
      case 100:
212
         return jjMoveStringLiteralDfa3_0(active0, 0x300000L);
213
      case 105:
214
         return jjMoveStringLiteralDfa3_0(active0, 0x840000L);
215
      case 110:
216
         return jjMoveStringLiteralDfa3_0(active0, 0x1000000L);
217
      case 111:
218
         return jjMoveStringLiteralDfa3_0(active0, 0x400000L);
219
      default :
220
         break;
221
   }
222
   return jjStartNfa_0(1, active0);
223
}
224
private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
225
{
226
   if (((active0 &= old0)) == 0L)
227
      return jjStartNfa_0(1, old0); 
228
   try { curChar = input_stream.readChar(); }
229
   catch(java.io.IOException e) {
230
      jjStopStringLiteralDfa_0(2, active0);
231
      return 3;
232
   }
233
   switch(curChar)
234
   {
235
      case 100:
236
         return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
237
      case 101:
238
         return jjMoveStringLiteralDfa4_0(active0, 0x300000L);
239
      case 111:
240
         return jjMoveStringLiteralDfa4_0(active0, 0x40000L);
241
      case 113:
242
         return jjMoveStringLiteralDfa4_0(active0, 0x800000L);
243
      case 114:
244
         return jjMoveStringLiteralDfa4_0(active0, 0x400000L);
245
      case 115:
246
         return jjMoveStringLiteralDfa4_0(active0, 0x80000L);
247
      case 117:
248
         return jjMoveStringLiteralDfa4_0(active0, 0x1000000L);
249
      default :
250
         break;
251
   }
252
   return jjStartNfa_0(2, active0);
253
}
254
private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
255
{
256
   if (((active0 &= old0)) == 0L)
257
      return jjStartNfa_0(2, old0); 
258
   try { curChar = input_stream.readChar(); }
259
   catch(java.io.IOException e) {
260
      jjStopStringLiteralDfa_0(3, active0);
261
      return 4;
262
   }
263
   switch(curChar)
264
   {
265
      case 79:
266
         return jjMoveStringLiteralDfa5_0(active0, 0x20000L);
267
      case 100:
268
         return jjMoveStringLiteralDfa5_0(active0, 0x400000L);
269
      case 101:
270
         return jjMoveStringLiteralDfa5_0(active0, 0x80000L);
271
      case 102:
272
         return jjMoveStringLiteralDfa5_0(active0, 0x100000L);
273
      case 110:
274
         if ((active0 & 0x40000L) != 0L)
275
            return jjStartNfaWithStates_0(4, 18, 2);
276
         return jjMoveStringLiteralDfa5_0(active0, 0x1000000L);
277
      case 114:
278
         return jjMoveStringLiteralDfa5_0(active0, 0x200000L);
279
      case 117:
280
         return jjMoveStringLiteralDfa5_0(active0, 0x800000L);
281
      default :
282
         break;
283
   }
284
   return jjStartNfa_0(3, active0);
285
}
286
private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
287
{
288
   if (((active0 &= old0)) == 0L)
289
      return jjStartNfa_0(3, old0); 
290
   try { curChar = input_stream.readChar(); }
291
   catch(java.io.IOException e) {
292
      jjStopStringLiteralDfa_0(4, active0);
293
      return 5;
294
   }
295
   switch(curChar)
296
   {
297
      case 101:
298
         if ((active0 & 0x800000L) != 0L)
299
            return jjStartNfaWithStates_0(5, 23, 2);
300
         return jjMoveStringLiteralDfa6_0(active0, 0x600000L);
301
      case 105:
302
         return jjMoveStringLiteralDfa6_0(active0, 0x1100000L);
303
      case 110:
304
         return jjMoveStringLiteralDfa6_0(active0, 0x20000L);
305
      case 116:
306
         return jjMoveStringLiteralDfa6_0(active0, 0x80000L);
307
      default :
308
         break;
309
   }
310
   return jjStartNfa_0(4, active0);
311
}
312
private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
313
{
314
   if (((active0 &= old0)) == 0L)
315
      return jjStartNfa_0(4, old0); 
316
   try { curChar = input_stream.readChar(); }
317
   catch(java.io.IOException e) {
318
      jjStopStringLiteralDfa_0(5, active0);
319
      return 6;
320
   }
321
   switch(curChar)
322
   {
323
      case 100:
324
         if ((active0 & 0x200000L) != 0L)
325
            return jjStartNfaWithStates_0(6, 21, 2);
326
         break;
327
      case 108:
328
         return jjMoveStringLiteralDfa7_0(active0, 0x20000L);
329
      case 110:
330
         return jjMoveStringLiteralDfa7_0(active0, 0x100000L);
331
      case 113:
332
         return jjMoveStringLiteralDfa7_0(active0, 0x1000000L);
333
      case 114:
334
         return jjMoveStringLiteralDfa7_0(active0, 0x400000L);
335
      case 115:
336
         if ((active0 & 0x80000L) != 0L)
337
            return jjStartNfaWithStates_0(6, 19, 2);
338
         break;
339
      default :
340
         break;
341
   }
342
   return jjStartNfa_0(5, active0);
343
}
344
private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
345
{
346
   if (((active0 &= old0)) == 0L)
347
      return jjStartNfa_0(5, old0); 
348
   try { curChar = input_stream.readChar(); }
349
   catch(java.io.IOException e) {
350
      jjStopStringLiteralDfa_0(6, active0);
351
      return 7;
352
   }
353
   switch(curChar)
354
   {
355
      case 101:
356
         return jjMoveStringLiteralDfa8_0(active0, 0x500000L);
357
      case 117:
358
         return jjMoveStringLiteralDfa8_0(active0, 0x1000000L);
359
      case 121:
360
         if ((active0 & 0x20000L) != 0L)
361
            return jjStartNfaWithStates_0(7, 17, 2);
362
         break;
363
      default :
364
         break;
365
   }
366
   return jjStartNfa_0(6, active0);
367
}
368
private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
369
{
370
   if (((active0 &= old0)) == 0L)
371
      return jjStartNfa_0(6, old0); 
372
   try { curChar = input_stream.readChar(); }
373
   catch(java.io.IOException e) {
374
      jjStopStringLiteralDfa_0(7, active0);
375
      return 8;
376
   }
377
   switch(curChar)
378
   {
379
      case 100:
380
         if ((active0 & 0x400000L) != 0L)
381
            return jjStartNfaWithStates_0(8, 22, 2);
382
         break;
383
      case 101:
384
         if ((active0 & 0x1000000L) != 0L)
385
            return jjStartNfaWithStates_0(8, 24, 2);
386
         break;
387
      case 115:
388
         if ((active0 & 0x100000L) != 0L)
389
            return jjStartNfaWithStates_0(8, 20, 2);
390
         break;
391
      default :
392
         break;
393
   }
394
   return jjStartNfa_0(7, active0);
395
}
396
private final void jjCheckNAdd(int state)
397
{
398
   if (jjrounds[state] != jjround)
399
   {
400
      jjstateSet[jjnewStateCnt++] = state;
401
      jjrounds[state] = jjround;
402
   }
403
}
404
private final void jjAddStates(int start, int end)
405
{
406
   do {
407
      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
408
   } while (start++ != end);
409
}
410
private final void jjCheckNAddTwoStates(int state1, int state2)
411
{
412
   jjCheckNAdd(state1);
413
   jjCheckNAdd(state2);
414
}
415
private final void jjCheckNAddStates(int start, int end)
416
{
417
   do {
418
      jjCheckNAdd(jjnextStates[start]);
419
   } while (start++ != end);
420
}
421
private final void jjCheckNAddStates(int start)
422
{
423
   jjCheckNAdd(jjnextStates[start]);
424
   jjCheckNAdd(jjnextStates[start + 1]);
425
}
426
static final long[] jjbitVec0 = {
427
   0x1ff00000fffffffeL, 0xffffffffffffc000L, 0xffffffffL, 0x600000000000000L
428
};
429
static final long[] jjbitVec2 = {
430
   0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
431
};
432
static final long[] jjbitVec3 = {
433
   0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
434
};
435
static final long[] jjbitVec4 = {
436
   0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
437
};
438
static final long[] jjbitVec5 = {
439
   0xffffffffffffffffL, 0xffffffffffffffffL, 0x0L, 0x0L
440
};
441
static final long[] jjbitVec6 = {
442
   0x3fffffffffffL, 0x0L, 0x0L, 0x0L
443
};
444
private final int jjMoveNfa_0(int startState, int curPos)
445
{
446
   int[] nextStates;
447
   int startsAt = 0;
448
   jjnewStateCnt = 3;
449
   int i = 1;
450
   jjstateSet[0] = startState;
451
   int j, kind = 0x7fffffff;
452
   for (;;)
453
   {
454
      if (++jjround == 0x7fffffff)
455
         ReInitRounds();
456
      if (curChar < 64)
457
      {
458
         long l = 1L << curChar;
459
         MatchLoop: do
460
         {
461
            switch(jjstateSet[--i])
462
            {
463
               case 1:
464
                  if ((0x3ff000000000000L & l) != 0L)
465
                  {
466
                     if (kind > 25)
467
                        kind = 25;
468
                     jjCheckNAdd(0);
469
                  }
470
                  else if (curChar == 36)
471
                  {
472
                     if (kind > 26)
473
                        kind = 26;
474
                     jjCheckNAdd(2);
475
                  }
476
                  break;
477
               case 0:
478
                  if ((0x3ff000000000000L & l) == 0L)
479
                     break;
480
                  if (kind > 25)
481
                     kind = 25;
482
                  jjCheckNAdd(0);
483
                  break;
484
               case 2:
485
                  if ((0x3ff001000000000L & l) == 0L)
486
                     break;
487
                  if (kind > 26)
488
                     kind = 26;
489
                  jjCheckNAdd(2);
490
                  break;
491
               default : break;
492
            }
493
         } while(i != startsAt);
494
      }
495
      else if (curChar < 128)
496
      {
497
         long l = 1L << (curChar & 077);
498
         MatchLoop: do
499
         {
500
            switch(jjstateSet[--i])
501
            {
502
               case 1:
503
               case 2:
504
                  if ((0x7fffffe87fffffeL & l) == 0L)
505
                     break;
506
                  if (kind > 26)
507
                     kind = 26;
508
                  jjCheckNAdd(2);
509
                  break;
510
               default : break;
511
            }
512
         } while(i != startsAt);
513
      }
514
      else
515
      {
516
         int hiByte = (int)(curChar >> 8);
517
         int i1 = hiByte >> 6;
518
         long l1 = 1L << (hiByte & 077);
519
         int i2 = (curChar & 0xff) >> 6;
520
         long l2 = 1L << (curChar & 077);
521
         MatchLoop: do
522
         {
523
            switch(jjstateSet[--i])
524
            {
525
               case 1:
526
               case 2:
527
                  if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
528
                     break;
529
                  if (kind > 26)
530
                     kind = 26;
531
                  jjCheckNAdd(2);
532
                  break;
533
               default : break;
534
            }
535
         } while(i != startsAt);
536
      }
537
      if (kind != 0x7fffffff)
538
      {
539
         jjmatchedKind = kind;
540
         jjmatchedPos = curPos;
541
         kind = 0x7fffffff;
542
      }
543
      ++curPos;
544
      if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
545
         return curPos;
546
      try { curChar = input_stream.readChar(); }
547
      catch(java.io.IOException e) { return curPos; }
548
   }
549
}
550
static final int[] jjnextStates = {
551
};
552
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
553
{
554
   switch(hiByte)
555
   {
556
      case 0:
557
         return ((jjbitVec2[i2] & l2) != 0L);
558
      case 48:
559
         return ((jjbitVec3[i2] & l2) != 0L);
560
      case 49:
561
         return ((jjbitVec4[i2] & l2) != 0L);
562
      case 51:
563
         return ((jjbitVec5[i2] & l2) != 0L);
564
      case 61:
565
         return ((jjbitVec6[i2] & l2) != 0L);
566
      default : 
567
         if ((jjbitVec0[i1] & l1) != 0L)
568
            return true;
569
         return false;
570
   }
571
}
572
public static final String[] jjstrLiteralImages = {
573
"", null, null, "\57", "\72", "\75", "\133", "\135", "\173", "\175", "\54", 
574
"\53", "\55", "\43", "\176", "\56", "\52", "\162\145\141\144\117\156\154\171", 
575
"\165\156\151\157\156", "\163\165\142\163\145\164\163", "\162\145\144\145\146\151\156\145\163", 
576
"\157\162\144\145\162\145\144", "\165\156\157\162\144\145\162\145\144", "\165\156\151\161\165\145", 
577
"\156\157\156\165\156\151\161\165\145", null, null, null, null, };
578
public static final String[] lexStateNames = {
579
   "DEFAULT", 
580
};
581
static final long[] jjtoToken = {
582
   0x7fffff9L, 
583
};
584
static final long[] jjtoSkip = {
585
   0x6L, 
586
};
587
static final long[] jjtoSpecial = {
588
   0x6L, 
589
};
590
protected JavaCharStream input_stream;
591
private final int[] jjrounds = new int[3];
592
private final int[] jjstateSet = new int[6];
593
protected char curChar;
594
public AssociationNameParserTokenManager(JavaCharStream stream)
595
{
596
   if (JavaCharStream.staticFlag)
597
      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
598
   input_stream = stream;
599
}
600
public AssociationNameParserTokenManager(JavaCharStream stream, int lexState)
601
{
602
   this(stream);
603
   SwitchTo(lexState);
604
}
605
public void ReInit(JavaCharStream stream)
606
{
607
   jjmatchedPos = jjnewStateCnt = 0;
608
   curLexState = defaultLexState;
609
   input_stream = stream;
610
   ReInitRounds();
611
}
612
private final void ReInitRounds()
613
{
614
   int i;
615
   jjround = 0x80000001;
616
   for (i = 3; i-- > 0;)
617
      jjrounds[i] = 0x80000000;
618
}
619
public void ReInit(JavaCharStream stream, int lexState)
620
{
621
   ReInit(stream);
622
   SwitchTo(lexState);
623
}
624
public void SwitchTo(int lexState)
625
{
626
   if (lexState >= 1 || lexState < 0)
627
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
628
   else
629
      curLexState = lexState;
630
}
631
632
protected Token jjFillToken()
633
{
634
   Token t = Token.newToken(jjmatchedKind);
635
   t.kind = jjmatchedKind;
636
   String im = jjstrLiteralImages[jjmatchedKind];
637
   t.image = (im == null) ? input_stream.GetImage() : im;
638
   t.beginLine = input_stream.getBeginLine();
639
   t.beginColumn = input_stream.getBeginColumn();
640
   t.endLine = input_stream.getEndLine();
641
   t.endColumn = input_stream.getEndColumn();
642
   return t;
643
}
644
645
int curLexState = 0;
646
int defaultLexState = 0;
647
int jjnewStateCnt;
648
int jjround;
649
int jjmatchedPos;
650
int jjmatchedKind;
651
652
public Token getNextToken() 
653
{
654
  int kind;
655
  Token specialToken = null;
656
  Token matchedToken;
657
  int curPos = 0;
658
659
  EOFLoop :
660
  for (;;)
661
  {   
662
   try   
663
   {     
664
      curChar = input_stream.BeginToken();
665
   }     
666
   catch(java.io.IOException e)
667
   {        
668
      jjmatchedKind = 0;
669
      matchedToken = jjFillToken();
670
      matchedToken.specialToken = specialToken;
671
      return matchedToken;
672
   }
673
674
   jjmatchedKind = 0x7fffffff;
675
   jjmatchedPos = 0;
676
   curPos = jjMoveStringLiteralDfa0_0();
677
   if (jjmatchedKind != 0x7fffffff)
678
   {
679
      if (jjmatchedPos + 1 < curPos)
680
         input_stream.backup(curPos - jjmatchedPos - 1);
681
      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
682
      {
683
         matchedToken = jjFillToken();
684
         matchedToken.specialToken = specialToken;
685
         return matchedToken;
686
      }
687
      else
688
      {
689
         if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
690
         {
691
            matchedToken = jjFillToken();
692
            if (specialToken == null)
693
               specialToken = matchedToken;
694
            else
695
            {
696
               matchedToken.specialToken = specialToken;
697
               specialToken = (specialToken.next = matchedToken);
698
            }
699
         }
700
         continue EOFLoop;
701
      }
702
   }
703
   int error_line = input_stream.getEndLine();
704
   int error_column = input_stream.getEndColumn();
705
   String error_after = null;
706
   boolean EOFSeen = false;
707
   try { input_stream.readChar(); input_stream.backup(1); }
708
   catch (java.io.IOException e1) {
709
      EOFSeen = true;
710
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
711
      if (curChar == '\n' || curChar == '\r') {
712
         error_line++;
713
         error_column = 0;
714
      }
715
      else
716
         error_column++;
717
   }
718
   if (!EOFSeen) {
719
      input_stream.backup(1);
720
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
721
   }
722
   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
723
  }
724
}
725
726
}
(-)src/org/eclipse/uml2/diagram/clazz/navigator/UMLNavigatorActionProvider.java (+154 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.navigator;
2
3
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorInput;
4
5
import org.eclipse.gmf.runtime.notation.Diagram;
6
7
import org.eclipse.jface.action.Action;
8
import org.eclipse.jface.action.IMenuManager;
9
10
import org.eclipse.jface.viewers.IStructuredSelection;
11
12
import org.eclipse.ui.IActionBars;
13
import org.eclipse.ui.IWorkbenchPage;
14
import org.eclipse.ui.PartInitException;
15
16
import org.eclipse.ui.navigator.CommonActionProvider;
17
import org.eclipse.ui.navigator.ICommonActionConstants;
18
import org.eclipse.ui.navigator.ICommonActionExtensionSite;
19
import org.eclipse.ui.navigator.ICommonMenuConstants;
20
import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
21
22
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
23
24
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditor;
25
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
26
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
27
28
/**
29
 * @generated
30
 */
31
public class UMLNavigatorActionProvider extends CommonActionProvider {
32
33
	/**
34
	 * @generated
35
	 */
36
	private boolean myContribute;
37
38
	/**
39
	 * @generated
40
	 */
41
	private OpenDiagramAction myOpenDiagramAction;
42
43
	/**
44
	 * @generated
45
	 */
46
	public void init(ICommonActionExtensionSite aSite) {
47
		super.init(aSite);
48
		if (aSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
49
			myContribute = true;
50
			makeActions((ICommonViewerWorkbenchSite) aSite.getViewSite());
51
		} else {
52
			myContribute = false;
53
		}
54
	}
55
56
	/**
57
	 * @generated
58
	 */
59
	private void makeActions(ICommonViewerWorkbenchSite viewerSite) {
60
		myOpenDiagramAction = new OpenDiagramAction(viewerSite);
61
	}
62
63
	/**
64
	 * @generated
65
	 */
66
	public void fillActionBars(IActionBars actionBars) {
67
		if (!myContribute) {
68
			return;
69
		}
70
		IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
71
		myOpenDiagramAction.selectionChanged(selection);
72
		if (myOpenDiagramAction.isEnabled()) {
73
			actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, myOpenDiagramAction);
74
		}
75
	}
76
77
	/**
78
	 * @generated
79
	 */
80
	public void fillContextMenu(IMenuManager menu) {
81
		/*		if (!myContribute || getContext().getSelection().isEmpty()) {
82
		 return;
83
		 }
84
85
		 IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
86
87
		 myOpenDiagramAction.selectionChanged(selection);
88
		 if (myOpenDiagramAction.isEnabled()) {
89
		 menu.insertAfter(ICommonMenuConstants.GROUP_OPEN, myOpenDiagramAction);
90
		 }*/
91
	}
92
93
	/**
94
	 * @generated
95
	 */
96
	private class OpenDiagramAction extends Action {
97
98
		/**
99
		 * @generated
100
		 */
101
		private Diagram myDiagram;
102
103
		/**
104
		 * @generated
105
		 */
106
		private ICommonViewerWorkbenchSite myViewerSite;
107
108
		/**
109
		 * @generated
110
		 */
111
		public OpenDiagramAction(ICommonViewerWorkbenchSite viewerSite) {
112
			super("Open Diagram");
113
			myViewerSite = viewerSite;
114
		}
115
116
		/**
117
		 * @generated
118
		 */
119
		public final void selectionChanged(IStructuredSelection selection) {
120
			myDiagram = null;
121
			if (selection.size() == 1) {
122
				Object selectedElement = selection.getFirstElement();
123
				if (selectedElement instanceof UMLNavigatorItem) {
124
					selectedElement = ((UMLNavigatorItem) selectedElement).getView();
125
				}
126
				if (selectedElement instanceof Diagram) {
127
					Diagram diagram = (Diagram) selectedElement;
128
					if (PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(diagram))) {
129
						myDiagram = diagram;
130
					}
131
				}
132
			}
133
			setEnabled(myDiagram != null);
134
		}
135
136
		/**
137
		 * @generated
138
		 */
139
		public void run() {
140
			if (myDiagram == null) {
141
				return;
142
			}
143
			DiagramEditorInput editorInput = new DiagramEditorInput(myDiagram);
144
			IWorkbenchPage page = myViewerSite.getPage();
145
			try {
146
				page.openEditor(editorInput, UMLDiagramEditor.ID);
147
			} catch (PartInitException e) {
148
				UMLDiagramEditorPlugin.getInstance().logError("Exception while openning diagram", e);
149
			}
150
		}
151
152
	}
153
154
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLMatchingStrategy.java (+64 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import org.eclipse.emf.common.util.URI;
4
5
import org.eclipse.emf.ecore.resource.Resource;
6
7
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorInput;
8
9
import org.eclipse.gmf.runtime.notation.Diagram;
10
11
import org.eclipse.ui.IEditorInput;
12
import org.eclipse.ui.IEditorMatchingStrategy;
13
import org.eclipse.ui.IEditorPart;
14
import org.eclipse.ui.IEditorReference;
15
import org.eclipse.ui.PartInitException;
16
17
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditorMatchingStrategy;
18
19
/**
20
 * @generated
21
 */
22
public class UMLMatchingStrategy implements IEditorMatchingStrategy {
23
24
	/**
25
	 * @generated
26
	 */
27
	public boolean matches(IEditorReference editorRef, IEditorInput input) {
28
		IEditorInput editorInput;
29
		try {
30
			editorInput = editorRef.getEditorInput();
31
		} catch (PartInitException e) {
32
			return false;
33
		}
34
35
		if (editorInput.equals(input)) {
36
			return true;
37
		}
38
39
		IEditorPart editor = editorRef.getEditor(false);
40
		if (input instanceof DiagramEditorInput && editor instanceof UMLDiagramEditor) {
41
			Diagram editorDiagram = ((UMLDiagramEditor) editor).getDiagram();
42
			Diagram otherDiagram = ((DiagramEditorInput) input).getDiagram();
43
			return equals(editorDiagram, otherDiagram);
44
		}
45
		return false;
46
	}
47
48
	/**
49
	 * @generated
50
	 */
51
	private boolean equals(Diagram editorDiagram, Diagram otherDiagram) {
52
		Resource editorResource = editorDiagram.eResource();
53
		Resource otherResource = otherDiagram.eResource();
54
		if (editorResource != null && otherResource != null) {
55
			URI editorURI = editorResource.getURI();
56
			URI otherURI = otherResource.getURI();
57
			String editorURIFragment = editorResource.getURIFragment(editorDiagram);
58
			String otherURIFragment = otherResource.getURIFragment(otherDiagram);
59
			return editorURI.equals(otherURI) && editorURIFragment.equals(otherURIFragment);
60
		}
61
		return false;
62
	}
63
64
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Operation5ViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class Operation5ViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Operation5EditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/name/ParseException.java (+205 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.name;
14
15
import org.eclipse.uml2.diagram.parser.ExternalParserException;
16
17
/**
18
 * This exception is thrown when parse errors are encountered.
19
 * You can explicitly create objects of this exception type by
20
 * calling the method generateParseException in the generated
21
 * parser.
22
 *
23
 * You can modify this class to customize your error reporting
24
 * mechanisms so long as you retain the public fields.
25
 */
26
public class ParseException extends ExternalParserException {
27
28
  /**
29
   * This constructor is used by the method "generateParseException"
30
   * in the generated parser.  Calling this constructor generates
31
   * a new object of this type with the fields "currentToken",
32
   * "expectedTokenSequences", and "tokenImage" set.  The boolean
33
   * flag "specialConstructor" is also set to true to indicate that
34
   * this constructor was used to create this object.
35
   * This constructor calls its super class with the empty string
36
   * to force the "toString" method of parent class "Throwable" to
37
   * print the error message in the form:
38
   *     ParseException: <result of getMessage>
39
   */
40
  public ParseException(Token currentTokenVal,
41
                        int[][] expectedTokenSequencesVal,
42
                        String[] tokenImageVal
43
                       )
44
  {
45
    super("");
46
    specialConstructor = true;
47
    currentToken = currentTokenVal;
48
    expectedTokenSequences = expectedTokenSequencesVal;
49
    tokenImage = tokenImageVal;
50
  }
51
52
  /**
53
   * The following constructors are for use by you for whatever
54
   * purpose you can think of.  Constructing the exception in this
55
   * manner makes the exception behave in the normal way - i.e., as
56
   * documented in the class "Throwable".  The fields "errorToken",
57
   * "expectedTokenSequences", and "tokenImage" do not contain
58
   * relevant information.  The JavaCC generated code does not use
59
   * these constructors.
60
   */
61
62
  public ParseException() {
63
    super();
64
    specialConstructor = false;
65
  }
66
67
  public ParseException(String message) {
68
    super(message);
69
    specialConstructor = false;
70
  }
71
72
  /**
73
   * This variable determines which constructor was used to create
74
   * this object and thereby affects the semantics of the
75
   * "getMessage" method (see below).
76
   */
77
  protected boolean specialConstructor;
78
79
  /**
80
   * This is the last token that has been consumed successfully.  If
81
   * this object has been created due to a parse error, the token
82
   * followng this token will (therefore) be the first error token.
83
   */
84
  public Token currentToken;
85
86
  /**
87
   * Each entry in this array is an array of integers.  Each array
88
   * of integers represents a sequence of tokens (by their ordinal
89
   * values) that is expected at this point of the parse.
90
   */
91
  public int[][] expectedTokenSequences;
92
93
  /**
94
   * This is a reference to the "tokenImage" array of the generated
95
   * parser within which the parse error occurred.  This array is
96
   * defined in the generated ...Constants interface.
97
   */
98
  public String[] tokenImage;
99
100
  /**
101
   * This method has the standard behavior when this object has been
102
   * created using the standard constructors.  Otherwise, it uses
103
   * "currentToken" and "expectedTokenSequences" to generate a parse
104
   * error message and returns it.  If this object has been created
105
   * due to a parse error, and you do not catch it (it gets thrown
106
   * from the parser), then this method is called during the printing
107
   * of the final stack trace, and hence the correct error message
108
   * gets displayed.
109
   */
110
  public String getMessage() {
111
    if (!specialConstructor) {
112
      return super.getMessage();
113
    }
114
    String expected = "";
115
    int maxSize = 0;
116
    for (int i = 0; i < expectedTokenSequences.length; i++) {
117
      if (maxSize < expectedTokenSequences[i].length) {
118
        maxSize = expectedTokenSequences[i].length;
119
      }
120
      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
121
        expected += tokenImage[expectedTokenSequences[i][j]] + " ";
122
      }
123
      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
124
        expected += "...";
125
      }
126
      expected += eol + "    ";
127
    }
128
    String retval = "Encountered \"";
129
    Token tok = currentToken.next;
130
    for (int i = 0; i < maxSize; i++) {
131
      if (i != 0) retval += " ";
132
      if (tok.kind == 0) {
133
        retval += tokenImage[0];
134
        break;
135
      }
136
      retval += add_escapes(tok.image);
137
      tok = tok.next; 
138
    }
139
    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
140
    retval += "." + eol;
141
    if (expectedTokenSequences.length == 1) {
142
      retval += "Was expecting:" + eol + "    ";
143
    } else {
144
      retval += "Was expecting one of:" + eol + "    ";
145
    }
146
    retval += expected;
147
    return retval;
148
  }
149
150
  /**
151
   * The end of line string for this machine.
152
   */
153
  protected String eol = System.getProperty("line.separator", "\n");
154
 
155
  /**
156
   * Used to convert raw characters to their escaped version
157
   * when these raw version cannot be used as part of an ASCII
158
   * string literal.
159
   */
160
  protected String add_escapes(String str) {
161
      StringBuffer retval = new StringBuffer();
162
      char ch;
163
      for (int i = 0; i < str.length(); i++) {
164
        switch (str.charAt(i))
165
        {
166
           case 0 :
167
              continue;
168
           case '\b':
169
              retval.append("\\b");
170
              continue;
171
           case '\t':
172
              retval.append("\\t");
173
              continue;
174
           case '\n':
175
              retval.append("\\n");
176
              continue;
177
           case '\f':
178
              retval.append("\\f");
179
              continue;
180
           case '\r':
181
              retval.append("\\r");
182
              continue;
183
           case '\"':
184
              retval.append("\\\"");
185
              continue;
186
           case '\'':
187
              retval.append("\\\'");
188
              continue;
189
           case '\\':
190
              retval.append("\\\\");
191
              continue;
192
           default:
193
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
194
                 String s = "0000" + Integer.toString(ch, 16);
195
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
196
              } else {
197
                 retval.append(ch);
198
              }
199
              continue;
200
        }
201
      }
202
      return retval.toString();
203
   }
204
205
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/InstanceSpecificationNameViewFactory.java (+29 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory;
8
import org.eclipse.gmf.runtime.notation.View;
9
10
/**
11
 * @generated
12
 */
13
public class InstanceSpecificationNameViewFactory extends BasicNodeViewFactory {
14
15
	/**
16
	 * @generated
17
	 */
18
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
19
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
20
	}
21
22
	/**
23
	 * @generated
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		return styles;
28
	}
29
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationName5ViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class AssociationName5ViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(-30));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/slot/JavaCharStream.java (+558 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.slot;
14
15
/**
16
 * An implementation of interface CharStream, where the stream is assumed to
17
 * contain only ASCII characters (with java-like unicode escape processing).
18
 */
19
20
public class JavaCharStream
21
{
22
  public static final boolean staticFlag = false;
23
  static final int hexval(char c) throws java.io.IOException {
24
    switch(c)
25
    {
26
       case '0' :
27
          return 0;
28
       case '1' :
29
          return 1;
30
       case '2' :
31
          return 2;
32
       case '3' :
33
          return 3;
34
       case '4' :
35
          return 4;
36
       case '5' :
37
          return 5;
38
       case '6' :
39
          return 6;
40
       case '7' :
41
          return 7;
42
       case '8' :
43
          return 8;
44
       case '9' :
45
          return 9;
46
47
       case 'a' :
48
       case 'A' :
49
          return 10;
50
       case 'b' :
51
       case 'B' :
52
          return 11;
53
       case 'c' :
54
       case 'C' :
55
          return 12;
56
       case 'd' :
57
       case 'D' :
58
          return 13;
59
       case 'e' :
60
       case 'E' :
61
          return 14;
62
       case 'f' :
63
       case 'F' :
64
          return 15;
65
    }
66
67
    throw new java.io.IOException(); // Should never come here
68
  }
69
70
  public int bufpos = -1;
71
  int bufsize;
72
  int available;
73
  int tokenBegin;
74
  protected int bufline[];
75
  protected int bufcolumn[];
76
77
  protected int column = 0;
78
  protected int line = 1;
79
80
  protected boolean prevCharIsCR = false;
81
  protected boolean prevCharIsLF = false;
82
83
  protected java.io.Reader inputStream;
84
85
  protected char[] nextCharBuf;
86
  protected char[] buffer;
87
  protected int maxNextCharInd = 0;
88
  protected int nextCharInd = -1;
89
  protected int inBuf = 0;
90
91
  protected void ExpandBuff(boolean wrapAround)
92
  {
93
     char[] newbuffer = new char[bufsize + 2048];
94
     int newbufline[] = new int[bufsize + 2048];
95
     int newbufcolumn[] = new int[bufsize + 2048];
96
97
     try
98
     {
99
        if (wrapAround)
100
        {
101
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
102
           System.arraycopy(buffer, 0, newbuffer,
103
                                             bufsize - tokenBegin, bufpos);
104
           buffer = newbuffer;
105
106
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
107
           System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
108
           bufline = newbufline;
109
110
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
111
           System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
112
           bufcolumn = newbufcolumn;
113
114
           bufpos += (bufsize - tokenBegin);
115
        }
116
        else
117
        {
118
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
119
           buffer = newbuffer;
120
121
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
122
           bufline = newbufline;
123
124
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
125
           bufcolumn = newbufcolumn;
126
127
           bufpos -= tokenBegin;
128
        }
129
     }
130
     catch (Throwable t)
131
     {
132
        throw new Error(t.getMessage());
133
     }
134
135
     available = (bufsize += 2048);
136
     tokenBegin = 0;
137
  }
138
139
  protected void FillBuff() throws java.io.IOException
140
  {
141
     int i;
142
     if (maxNextCharInd == 4096)
143
        maxNextCharInd = nextCharInd = 0;
144
145
     try {
146
        if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
147
                                            4096 - maxNextCharInd)) == -1)
148
        {
149
           inputStream.close();
150
           throw new java.io.IOException();
151
        }
152
        else
153
           maxNextCharInd += i;
154
        return;
155
     }
156
     catch(java.io.IOException e) {
157
        if (bufpos != 0)
158
        {
159
           --bufpos;
160
           backup(0);
161
        }
162
        else
163
        {
164
           bufline[bufpos] = line;
165
           bufcolumn[bufpos] = column;
166
        }
167
        throw e;
168
     }
169
  }
170
171
  protected char ReadByte() throws java.io.IOException
172
  {
173
     if (++nextCharInd >= maxNextCharInd)
174
        FillBuff();
175
176
     return nextCharBuf[nextCharInd];
177
  }
178
179
  public char BeginToken() throws java.io.IOException
180
  {     
181
     if (inBuf > 0)
182
     {
183
        --inBuf;
184
185
        if (++bufpos == bufsize)
186
           bufpos = 0;
187
188
        tokenBegin = bufpos;
189
        return buffer[bufpos];
190
     }
191
192
     tokenBegin = 0;
193
     bufpos = -1;
194
195
     return readChar();
196
  }     
197
198
  protected void AdjustBuffSize()
199
  {
200
     if (available == bufsize)
201
     {
202
        if (tokenBegin > 2048)
203
        {
204
           bufpos = 0;
205
           available = tokenBegin;
206
        }
207
        else
208
           ExpandBuff(false);
209
     }
210
     else if (available > tokenBegin)
211
        available = bufsize;
212
     else if ((tokenBegin - available) < 2048)
213
        ExpandBuff(true);
214
     else
215
        available = tokenBegin;
216
  }
217
218
  protected void UpdateLineColumn(char c)
219
  {
220
     column++;
221
222
     if (prevCharIsLF)
223
     {
224
        prevCharIsLF = false;
225
        line += (column = 1);
226
     }
227
     else if (prevCharIsCR)
228
     {
229
        prevCharIsCR = false;
230
        if (c == '\n')
231
        {
232
           prevCharIsLF = true;
233
        }
234
        else
235
           line += (column = 1);
236
     }
237
238
     switch (c)
239
     {
240
        case '\r' :
241
           prevCharIsCR = true;
242
           break;
243
        case '\n' :
244
           prevCharIsLF = true;
245
           break;
246
        case '\t' :
247
           column--;
248
           column += (8 - (column & 07));
249
           break;
250
        default :
251
           break;
252
     }
253
254
     bufline[bufpos] = line;
255
     bufcolumn[bufpos] = column;
256
  }
257
258
  public char readChar() throws java.io.IOException
259
  {
260
     if (inBuf > 0)
261
     {
262
        --inBuf;
263
264
        if (++bufpos == bufsize)
265
           bufpos = 0;
266
267
        return buffer[bufpos];
268
     }
269
270
     char c;
271
272
     if (++bufpos == available)
273
        AdjustBuffSize();
274
275
     if ((buffer[bufpos] = c = ReadByte()) == '\\')
276
     {
277
        UpdateLineColumn(c);
278
279
        int backSlashCnt = 1;
280
281
        for (;;) // Read all the backslashes
282
        {
283
           if (++bufpos == available)
284
              AdjustBuffSize();
285
286
           try
287
           {
288
              if ((buffer[bufpos] = c = ReadByte()) != '\\')
289
              {
290
                 UpdateLineColumn(c);
291
                 // found a non-backslash char.
292
                 if ((c == 'u') && ((backSlashCnt & 1) == 1))
293
                 {
294
                    if (--bufpos < 0)
295
                       bufpos = bufsize - 1;
296
297
                    break;
298
                 }
299
300
                 backup(backSlashCnt);
301
                 return '\\';
302
              }
303
           }
304
           catch(java.io.IOException e)
305
           {
306
              if (backSlashCnt > 1)
307
                 backup(backSlashCnt);
308
309
              return '\\';
310
           }
311
312
           UpdateLineColumn(c);
313
           backSlashCnt++;
314
        }
315
316
        // Here, we have seen an odd number of backslash's followed by a 'u'
317
        try
318
        {
319
           while ((c = ReadByte()) == 'u')
320
              ++column;
321
322
           buffer[bufpos] = c = (char)(hexval(c) << 12 |
323
                                       hexval(ReadByte()) << 8 |
324
                                       hexval(ReadByte()) << 4 |
325
                                       hexval(ReadByte()));
326
327
           column += 4;
328
        }
329
        catch(java.io.IOException e)
330
        {
331
           throw new Error("Invalid escape character at line " + line +
332
                                         " column " + column + ".");
333
        }
334
335
        if (backSlashCnt == 1)
336
           return c;
337
        else
338
        {
339
           backup(backSlashCnt - 1);
340
           return '\\';
341
        }
342
     }
343
     else
344
     {
345
        UpdateLineColumn(c);
346
        return (c);
347
     }
348
  }
349
350
  /**
351
   * @deprecated 
352
   * @see #getEndColumn
353
   */
354
355
  public int getColumn() {
356
     return bufcolumn[bufpos];
357
  }
358
359
  /**
360
   * @deprecated 
361
   * @see #getEndLine
362
   */
363
364
  public int getLine() {
365
     return bufline[bufpos];
366
  }
367
368
  public int getEndColumn() {
369
     return bufcolumn[bufpos];
370
  }
371
372
  public int getEndLine() {
373
     return bufline[bufpos];
374
  }
375
376
  public int getBeginColumn() {
377
     return bufcolumn[tokenBegin];
378
  }
379
380
  public int getBeginLine() {
381
     return bufline[tokenBegin];
382
  }
383
384
  public void backup(int amount) {
385
386
    inBuf += amount;
387
    if ((bufpos -= amount) < 0)
388
       bufpos += bufsize;
389
  }
390
391
  public JavaCharStream(java.io.Reader dstream,
392
                 int startline, int startcolumn, int buffersize)
393
  {
394
    inputStream = dstream;
395
    line = startline;
396
    column = startcolumn - 1;
397
398
    available = bufsize = buffersize;
399
    buffer = new char[buffersize];
400
    bufline = new int[buffersize];
401
    bufcolumn = new int[buffersize];
402
    nextCharBuf = new char[4096];
403
  }
404
405
  public JavaCharStream(java.io.Reader dstream,
406
                                        int startline, int startcolumn)
407
  {
408
     this(dstream, startline, startcolumn, 4096);
409
  }
410
411
  public JavaCharStream(java.io.Reader dstream)
412
  {
413
     this(dstream, 1, 1, 4096);
414
  }
415
  public void ReInit(java.io.Reader dstream,
416
                 int startline, int startcolumn, int buffersize)
417
  {
418
    inputStream = dstream;
419
    line = startline;
420
    column = startcolumn - 1;
421
422
    if (buffer == null || buffersize != buffer.length)
423
    {
424
      available = bufsize = buffersize;
425
      buffer = new char[buffersize];
426
      bufline = new int[buffersize];
427
      bufcolumn = new int[buffersize];
428
      nextCharBuf = new char[4096];
429
    }
430
    prevCharIsLF = prevCharIsCR = false;
431
    tokenBegin = inBuf = maxNextCharInd = 0;
432
    nextCharInd = bufpos = -1;
433
  }
434
435
  public void ReInit(java.io.Reader dstream,
436
                                        int startline, int startcolumn)
437
  {
438
     ReInit(dstream, startline, startcolumn, 4096);
439
  }
440
441
  public void ReInit(java.io.Reader dstream)
442
  {
443
     ReInit(dstream, 1, 1, 4096);
444
  }
445
  public JavaCharStream(java.io.InputStream dstream, int startline,
446
  int startcolumn, int buffersize)
447
  {
448
     this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
449
  }
450
451
  public JavaCharStream(java.io.InputStream dstream, int startline,
452
                                                           int startcolumn)
453
  {
454
     this(dstream, startline, startcolumn, 4096);
455
  }
456
457
  public JavaCharStream(java.io.InputStream dstream)
458
  {
459
     this(dstream, 1, 1, 4096);
460
  }
461
462
  public void ReInit(java.io.InputStream dstream, int startline,
463
  int startcolumn, int buffersize)
464
  {
465
     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
466
  }
467
  public void ReInit(java.io.InputStream dstream, int startline,
468
                                                           int startcolumn)
469
  {
470
     ReInit(dstream, startline, startcolumn, 4096);
471
  }
472
  public void ReInit(java.io.InputStream dstream)
473
  {
474
     ReInit(dstream, 1, 1, 4096);
475
  }
476
477
  public String GetImage()
478
  {
479
     if (bufpos >= tokenBegin)
480
        return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
481
     else
482
        return new String(buffer, tokenBegin, bufsize - tokenBegin) +
483
                              new String(buffer, 0, bufpos + 1);
484
  }
485
486
  public char[] GetSuffix(int len)
487
  {
488
     char[] ret = new char[len];
489
490
     if ((bufpos + 1) >= len)
491
        System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
492
     else
493
     {
494
        System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
495
                                                          len - bufpos - 1);
496
        System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
497
     }
498
499
     return ret;
500
  }
501
502
  public void Done()
503
  {
504
     nextCharBuf = null;
505
     buffer = null;
506
     bufline = null;
507
     bufcolumn = null;
508
  }
509
510
  /**
511
   * Method to adjust line and column numbers for the start of a token.
512
   */
513
  public void adjustBeginLineColumn(int newLine, int newCol)
514
  {
515
     int start = tokenBegin;
516
     int len;
517
518
     if (bufpos >= tokenBegin)
519
     {
520
        len = bufpos - tokenBegin + inBuf + 1;
521
     }
522
     else
523
     {
524
        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
525
     }
526
527
     int i = 0, j = 0, k = 0;
528
     int nextColDiff = 0, columnDiff = 0;
529
530
     while (i < len &&
531
            bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
532
     {
533
        bufline[j] = newLine;
534
        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
535
        bufcolumn[j] = newCol + columnDiff;
536
        columnDiff = nextColDiff;
537
        i++;
538
     } 
539
540
     if (i < len)
541
     {
542
        bufline[j] = newLine++;
543
        bufcolumn[j] = newCol + columnDiff;
544
545
        while (i++ < len)
546
        {
547
           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
548
              bufline[j] = newLine++;
549
           else
550
              bufline[j] = newLine;
551
        }
552
     }
553
554
     line = bufline[j];
555
     column = bufcolumn[j];
556
  }
557
558
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLDocumentProvider.java (+204 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import java.io.IOException;
4
import java.util.ArrayList;
5
import java.util.Collection;
6
import java.util.Collections;
7
import java.util.Iterator;
8
import java.util.List;
9
10
import org.eclipse.core.resources.IFile;
11
import org.eclipse.core.resources.IResource;
12
import org.eclipse.core.resources.IStorage;
13
import org.eclipse.core.runtime.CoreException;
14
import org.eclipse.core.runtime.IProgressMonitor;
15
import org.eclipse.core.runtime.SubProgressMonitor;
16
import org.eclipse.core.runtime.jobs.ISchedulingRule;
17
import org.eclipse.core.runtime.jobs.MultiRule;
18
import org.eclipse.emf.common.notify.Notification;
19
import org.eclipse.emf.ecore.EObject;
20
import org.eclipse.emf.ecore.resource.Resource;
21
import org.eclipse.emf.transaction.DemultiplexingListener;
22
import org.eclipse.emf.transaction.NotificationFilter;
23
import org.eclipse.emf.transaction.TransactionalEditingDomain;
24
import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
25
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramDocument;
26
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramModificationListener;
27
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
28
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument;
29
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.document.FileDiagramDocumentProvider;
30
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.document.FileDiagramModificationListener;
31
import org.eclipse.gmf.runtime.notation.Diagram;
32
import org.eclipse.ui.IFileEditorInput;
33
34
/**
35
 * @generated
36
 */
37
public class UMLDocumentProvider extends FileDiagramDocumentProvider {
38
39
	/**
40
	 * @generated
41
	 */
42
	private final String contentObjectURI;
43
44
	/**
45
	 * @generated
46
	 */
47
	public UMLDocumentProvider() {
48
		this(null);
49
	}
50
51
	/**
52
	 * @generated
53
	 */
54
	public UMLDocumentProvider(String rootObjectURI) {
55
		this.contentObjectURI = rootObjectURI;
56
	}
57
58
	/**
59
	 * @generated
60
	 */
61
	protected void setDocumentContentFromStorage(IDocument document, IStorage storage) throws CoreException {
62
		super.setDocumentContentFromStorage(document, storage);
63
		if (contentObjectURI == null || false == document.getContent() instanceof EObject) {
64
			return;
65
		}
66
		EObject currentContent = (EObject) document.getContent();
67
		if (currentContent.eResource().getURIFragment(currentContent) == contentObjectURI) {
68
			return; // already there
69
		}
70
		EObject anotherContentObject = currentContent.eResource().getEObject(contentObjectURI);
71
		document.setContent(anotherContentObject);
72
	}
73
74
	/**
75
	 * @generated
76
	 */
77
	protected void saveDocumentToFile(IDocument document, IFile file, boolean overwrite, IProgressMonitor monitor) throws CoreException {
78
		Diagram diagram = (Diagram) document.getContent();
79
		Resource diagramResource = diagram.eResource();
80
		IDiagramDocument diagramDocument = (IDiagramDocument) document;
81
		TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
82
		List resources = domain.getResourceSet().getResources();
83
84
		monitor.beginTask("Saving diagram", resources.size() + 1); //$NON-NLS-1$
85
		super.saveDocumentToFile(document, file, overwrite, new SubProgressMonitor(monitor, 1));
86
		for (Iterator it = resources.iterator(); it.hasNext();) {
87
			Resource nextResource = (Resource) it.next();
88
			monitor.setTaskName("Saving " + nextResource.getURI()); //$NON-NLS-1$
89
			if (nextResource != diagramResource && nextResource.isLoaded() && (!nextResource.isTrackingModification() || nextResource.isModified())) {
90
				try {
91
					nextResource.save(Collections.EMPTY_MAP);
92
				} catch (IOException e) {
93
					UMLDiagramEditorPlugin.getInstance().logError("Unable to save resource: " + nextResource.getURI(), e); //$NON-NLS-1$
94
				}
95
			}
96
			monitor.worked(1);
97
		}
98
		monitor.done();
99
	}
100
101
	/**
102
	 * @generated
103
	 */
104
	protected ISchedulingRule getSaveRule(Object element) {
105
		IDiagramDocument diagramDocument = getDiagramDocument(element);
106
		if (diagramDocument != null) {
107
			Diagram diagram = diagramDocument.getDiagram();
108
			if (diagram != null) {
109
				Collection rules = new ArrayList();
110
				for (Iterator it = diagramDocument.getEditingDomain().getResourceSet().getResources().iterator(); it.hasNext();) {
111
					IFile nextFile = WorkspaceSynchronizer.getFile((Resource) it.next());
112
					if (nextFile != null) {
113
						rules.add(computeSaveSchedulingRule(nextFile));
114
					}
115
				}
116
				return new MultiRule((ISchedulingRule[]) rules.toArray(new ISchedulingRule[rules.size()]));
117
			}
118
		}
119
		return super.getSaveRule(element);
120
	}
121
122
	/**
123
	 * @generated
124
	 */
125
	protected FileInfo createFileInfo(IDocument document, FileSynchronizer synchronizer, IFileEditorInput input) {
126
		assert document instanceof DiagramDocument;
127
128
		DiagramModificationListener diagramListener = new CustomModificationListener(this, (DiagramDocument) document, input);
129
		DiagramFileInfo info = new DiagramFileInfo(document, synchronizer, diagramListener);
130
131
		diagramListener.startListening();
132
		return info;
133
	}
134
135
	/**
136
	 * @generated
137
	 */
138
	private ISchedulingRule computeSaveSchedulingRule(IResource toCreateOrModify) {
139
		if (toCreateOrModify.exists() && toCreateOrModify.isSynchronized(IResource.DEPTH_ZERO))
140
			return fResourceRuleFactory.modifyRule(toCreateOrModify);
141
142
		IResource parent = toCreateOrModify;
143
		do {
144
			/*
145
			 * XXX This is a workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=67601
146
			 * IResourceRuleFactory.createRule should iterate the hierarchy itself.
147
			 */
148
			toCreateOrModify = parent;
149
			parent = toCreateOrModify.getParent();
150
		} while (parent != null && !parent.exists() && !parent.isSynchronized(IResource.DEPTH_ZERO));
151
152
		return fResourceRuleFactory.createRule(toCreateOrModify);
153
	}
154
155
	/**
156
	 * @generated
157
	 */
158
	private class CustomModificationListener extends FileDiagramModificationListener {
159
160
		/**
161
		 * @generated
162
		 */
163
		private DemultiplexingListener myListener = null;
164
165
		/**
166
		 * @generated
167
		 */
168
		public CustomModificationListener(UMLDocumentProvider documentProviderParameter, DiagramDocument documentParameter, IFileEditorInput inputParameter) {
169
			super(documentProviderParameter, documentParameter, inputParameter);
170
			final DiagramDocument document = documentParameter;
171
			NotificationFilter diagramResourceModifiedFilter = NotificationFilter.createEventTypeFilter(Notification.SET);
172
			myListener = new DemultiplexingListener(diagramResourceModifiedFilter) {
173
174
				protected void handleNotification(TransactionalEditingDomain domain, Notification notification) {
175
					if (notification.getNotifier() instanceof EObject) {
176
						Resource modifiedResource = ((EObject) notification.getNotifier()).eResource();
177
						if (modifiedResource != document.getDiagram().eResource()) {
178
							document.setContent(document.getContent());
179
						}
180
					}
181
182
				}
183
			};
184
		}
185
186
		/**
187
		 * @generated
188
		 */
189
		public void startListening() {
190
			super.startListening();
191
			getEditingDomain().addResourceSetListener(myListener);
192
		}
193
194
		/**
195
		 * @generated
196
		 */
197
		public void stopListening() {
198
			getEditingDomain().removeResourceSetListener(myListener);
199
			super.stopListening();
200
		}
201
202
	}
203
204
}
(-)src/org/eclipse/uml2/diagram/clazz/expressions/UMLOCLFactory.java (+193 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.expressions;
2
3
import java.util.Collections;
4
import java.util.Iterator;
5
import java.util.Map;
6
7
import org.eclipse.core.runtime.IStatus;
8
import org.eclipse.emf.ecore.EClassifier;
9
import org.eclipse.emf.ecore.EEnum;
10
import org.eclipse.emf.ecore.EEnumLiteral;
11
import org.eclipse.emf.ecore.ETypedElement;
12
import org.eclipse.emf.ocl.expressions.ExpressionsFactory;
13
import org.eclipse.emf.ocl.expressions.OCLExpression;
14
import org.eclipse.emf.ocl.expressions.OperationCallExp;
15
import org.eclipse.emf.ocl.expressions.Variable;
16
import org.eclipse.emf.ocl.expressions.util.AbstractVisitor;
17
import org.eclipse.emf.ocl.helper.HelperUtil;
18
import org.eclipse.emf.ocl.helper.IOCLHelper;
19
import org.eclipse.emf.ocl.helper.OCLParsingException;
20
import org.eclipse.emf.ocl.parser.EcoreEnvironment;
21
import org.eclipse.emf.ocl.parser.EcoreEnvironmentFactory;
22
import org.eclipse.emf.ocl.parser.Environment;
23
import org.eclipse.emf.ocl.parser.EvaluationEnvironment;
24
import org.eclipse.emf.ocl.query.Query;
25
import org.eclipse.emf.ocl.query.QueryFactory;
26
import org.eclipse.emf.ocl.types.util.Types;
27
import org.eclipse.emf.ocl.utilities.PredefinedType;
28
import org.eclipse.uml2.diagram.parser.lookup.OCLLookup;
29
30
/**
31
 * @generated 
32
 */
33
public class UMLOCLFactory {
34
35
	/**
36
	 * @generated
37
	 */
38
	public static OCLLookup.Expression getOCLLookupExpression(String body, EClassifier context) {
39
		final UMLAbstractExpression expression = getExpression(body, context);
40
		if (!expression.getStatus().isOK()) {
41
			throw new IllegalArgumentException("Bad OCL:" + body);
42
		}
43
		return new OCLLookup.Expression() {
44
45
			public Object evaluate(Object context) {
46
				return expression.evaluate(context);
47
			}
48
		};
49
	}
50
51
	/**
52
	 * @generated 
53
	 */
54
	private UMLOCLFactory() {
55
	}
56
57
	/**
58
	 * @generated 
59
	 */
60
	public static UMLAbstractExpression getExpression(String body, EClassifier context, Map environment) {
61
		return new Expression(body, context, environment);
62
	}
63
64
	/**
65
	 * @generated 
66
	 */
67
	public static UMLAbstractExpression getExpression(String body, EClassifier context) {
68
		return getExpression(body, context, Collections.EMPTY_MAP);
69
	}
70
71
	/**
72
	 * @generated 
73
	 */
74
	private static class Expression extends UMLAbstractExpression {
75
76
		/**
77
		 * @generated 
78
		 */
79
		private Query query;
80
81
		/**
82
		 * @generated 
83
		 */
84
		public Expression(String body, EClassifier context, Map environment) {
85
			super(body, context, environment);
86
87
			IOCLHelper oclHelper = (environment.isEmpty()) ? HelperUtil.createOCLHelper() : HelperUtil.createOCLHelper(createCustomEnv(environment));
88
			oclHelper.setContext(context());
89
			try {
90
				OCLExpression oclExpression = oclHelper.createQuery(body);
91
				this.query = QueryFactory.eINSTANCE.createQuery(oclExpression);
92
			} catch (OCLParsingException e) {
93
				setStatus(IStatus.ERROR, e.getMessage(), e);
94
			}
95
		}
96
97
		/**
98
		 * @generated 
99
		 */
100
		protected Object doEvaluate(Object context, Map env) {
101
			if (query == null) {
102
				return null;
103
			}
104
			EvaluationEnvironment evalEnv = query.getEvaluationEnvironment();
105
			// init environment
106
			for (Iterator it = env.entrySet().iterator(); it.hasNext();) {
107
				Map.Entry nextEntry = (Map.Entry) it.next();
108
				evalEnv.replace((String) nextEntry.getKey(), nextEntry.getValue());
109
			}
110
111
			try {
112
				initExtentMap(context);
113
				Object result = query.evaluate(context);
114
				return (result != Types.OCL_INVALID) ? result : null;
115
			} finally {
116
				evalEnv.clear();
117
				query.setExtentMap(Collections.EMPTY_MAP);
118
			}
119
		}
120
121
		/**
122
		 * @generated
123
		 */
124
		protected Object performCast(Object value, ETypedElement targetType) {
125
			if (targetType.getEType() instanceof EEnum) {
126
				if (value instanceof EEnumLiteral) {
127
					EEnumLiteral literal = (EEnumLiteral) value;
128
					return (literal.getInstance() != null) ? literal.getInstance() : literal;
129
				}
130
			}
131
			return super.performCast(value, targetType);
132
		}
133
134
		/**
135
		 * @generated
136
		 */
137
		private void initExtentMap(Object context) {
138
			if (query == null || context == null) {
139
				return;
140
			}
141
			final Query queryToInit = query;
142
			final Object extentContext = context;
143
144
			queryToInit.setExtentMap(Collections.EMPTY_MAP);
145
			if (queryToInit.queryText() != null && queryToInit.queryText().indexOf("allInstances") >= 0) {
146
				AbstractVisitor visitior = new AbstractVisitor() {
147
148
					private boolean usesAllInstances = false;
149
150
					public Object visitOperationCallExp(OperationCallExp oc) {
151
						if (!usesAllInstances) {
152
							usesAllInstances = PredefinedType.ALL_INSTANCES == oc.getOperationCode();
153
							if (usesAllInstances) {
154
								queryToInit.setExtentMap(EcoreEnvironmentFactory.ECORE_INSTANCE.createExtentMap(extentContext));
155
							}
156
						}
157
						return super.visitOperationCallExp(oc);
158
					}
159
				};
160
				queryToInit.getExpression().accept(visitior);
161
			}
162
		}
163
164
		/**
165
		 * @generated 
166
		 */
167
		private static EcoreEnvironmentFactory createCustomEnv(Map environment) {
168
			final Map env = environment;
169
			return new EcoreEnvironmentFactory() {
170
171
				public Environment createClassifierContext(Object context) {
172
					Environment ecoreEnv = super.createClassifierContext(context);
173
					for (Iterator it = env.keySet().iterator(); it.hasNext();) {
174
						String varName = (String) it.next();
175
						EClassifier varType = (EClassifier) env.get(varName);
176
						ecoreEnv.addElement(varName, createVar(varName, varType), false);
177
					}
178
					return ecoreEnv;
179
				}
180
			};
181
		}
182
183
		/**
184
		 * @generated 
185
		 */
186
		private static Variable createVar(String name, EClassifier type) {
187
			Variable var = ExpressionsFactory.eINSTANCE.createVariable();
188
			var.setName(name);
189
			var.setType(EcoreEnvironment.getOCLType(type));
190
			return var;
191
		}
192
	}
193
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/property/PropertyParserTokenManager.java (+727 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. PropertyParserTokenManager.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.property;
14
import java.io.*;
15
import org.eclipse.emf.ecore.EClass;
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.uml2.diagram.parser.*;
18
import org.eclipse.uml2.diagram.parser.lookup.LookupResolver;
19
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
20
import org.eclipse.uml2.uml.*;
21
22
public class PropertyParserTokenManager implements PropertyParserConstants
23
{
24
  public  java.io.PrintStream debugStream = System.out;
25
  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
26
private final int jjStopStringLiteralDfa_0(int pos, long active0)
27
{
28
   switch (pos)
29
   {
30
      case 0:
31
         if ((active0 & 0x1fe0000L) != 0L)
32
         {
33
            jjmatchedKind = 26;
34
            return 2;
35
         }
36
         return -1;
37
      case 1:
38
         if ((active0 & 0x1fe0000L) != 0L)
39
         {
40
            jjmatchedKind = 26;
41
            jjmatchedPos = 1;
42
            return 2;
43
         }
44
         return -1;
45
      case 2:
46
         if ((active0 & 0x1fe0000L) != 0L)
47
         {
48
            jjmatchedKind = 26;
49
            jjmatchedPos = 2;
50
            return 2;
51
         }
52
         return -1;
53
      case 3:
54
         if ((active0 & 0x1fe0000L) != 0L)
55
         {
56
            jjmatchedKind = 26;
57
            jjmatchedPos = 3;
58
            return 2;
59
         }
60
         return -1;
61
      case 4:
62
         if ((active0 & 0x40000L) != 0L)
63
            return 2;
64
         if ((active0 & 0x1fa0000L) != 0L)
65
         {
66
            jjmatchedKind = 26;
67
            jjmatchedPos = 4;
68
            return 2;
69
         }
70
         return -1;
71
      case 5:
72
         if ((active0 & 0x800000L) != 0L)
73
            return 2;
74
         if ((active0 & 0x17a0000L) != 0L)
75
         {
76
            jjmatchedKind = 26;
77
            jjmatchedPos = 5;
78
            return 2;
79
         }
80
         return -1;
81
      case 6:
82
         if ((active0 & 0x280000L) != 0L)
83
            return 2;
84
         if ((active0 & 0x1520000L) != 0L)
85
         {
86
            jjmatchedKind = 26;
87
            jjmatchedPos = 6;
88
            return 2;
89
         }
90
         return -1;
91
      case 7:
92
         if ((active0 & 0x20000L) != 0L)
93
            return 2;
94
         if ((active0 & 0x1500000L) != 0L)
95
         {
96
            jjmatchedKind = 26;
97
            jjmatchedPos = 7;
98
            return 2;
99
         }
100
         return -1;
101
      default :
102
         return -1;
103
   }
104
}
105
private final int jjStartNfa_0(int pos, long active0)
106
{
107
   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
108
}
109
private final int jjStopAtPos(int pos, int kind)
110
{
111
   jjmatchedKind = kind;
112
   jjmatchedPos = pos;
113
   return pos + 1;
114
}
115
private final int jjStartNfaWithStates_0(int pos, int kind, int state)
116
{
117
   jjmatchedKind = kind;
118
   jjmatchedPos = pos;
119
   try { curChar = input_stream.readChar(); }
120
   catch(java.io.IOException e) { return pos + 1; }
121
   return jjMoveNfa_0(state, pos + 1);
122
}
123
private final int jjMoveStringLiteralDfa0_0()
124
{
125
   switch(curChar)
126
   {
127
      case 9:
128
         return jjStopAtPos(0, 2);
129
      case 32:
130
         return jjStopAtPos(0, 1);
131
      case 35:
132
         return jjStopAtPos(0, 13);
133
      case 42:
134
         return jjStopAtPos(0, 16);
135
      case 43:
136
         return jjStopAtPos(0, 11);
137
      case 44:
138
         return jjStopAtPos(0, 10);
139
      case 45:
140
         return jjStopAtPos(0, 12);
141
      case 46:
142
         return jjStopAtPos(0, 15);
143
      case 47:
144
         return jjStopAtPos(0, 3);
145
      case 58:
146
         return jjStopAtPos(0, 4);
147
      case 61:
148
         return jjStopAtPos(0, 5);
149
      case 91:
150
         return jjStopAtPos(0, 6);
151
      case 93:
152
         return jjStopAtPos(0, 7);
153
      case 110:
154
         return jjMoveStringLiteralDfa1_0(0x1000000L);
155
      case 111:
156
         return jjMoveStringLiteralDfa1_0(0x200000L);
157
      case 114:
158
         return jjMoveStringLiteralDfa1_0(0x120000L);
159
      case 115:
160
         return jjMoveStringLiteralDfa1_0(0x80000L);
161
      case 117:
162
         return jjMoveStringLiteralDfa1_0(0xc40000L);
163
      case 123:
164
         return jjStopAtPos(0, 8);
165
      case 125:
166
         return jjStopAtPos(0, 9);
167
      case 126:
168
         return jjStopAtPos(0, 14);
169
      default :
170
         return jjMoveNfa_0(1, 0);
171
   }
172
}
173
private final int jjMoveStringLiteralDfa1_0(long active0)
174
{
175
   try { curChar = input_stream.readChar(); }
176
   catch(java.io.IOException e) {
177
      jjStopStringLiteralDfa_0(0, active0);
178
      return 1;
179
   }
180
   switch(curChar)
181
   {
182
      case 101:
183
         return jjMoveStringLiteralDfa2_0(active0, 0x120000L);
184
      case 110:
185
         return jjMoveStringLiteralDfa2_0(active0, 0xc40000L);
186
      case 111:
187
         return jjMoveStringLiteralDfa2_0(active0, 0x1000000L);
188
      case 114:
189
         return jjMoveStringLiteralDfa2_0(active0, 0x200000L);
190
      case 117:
191
         return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
192
      default :
193
         break;
194
   }
195
   return jjStartNfa_0(0, active0);
196
}
197
private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
198
{
199
   if (((active0 &= old0)) == 0L)
200
      return jjStartNfa_0(0, old0); 
201
   try { curChar = input_stream.readChar(); }
202
   catch(java.io.IOException e) {
203
      jjStopStringLiteralDfa_0(1, active0);
204
      return 2;
205
   }
206
   switch(curChar)
207
   {
208
      case 97:
209
         return jjMoveStringLiteralDfa3_0(active0, 0x20000L);
210
      case 98:
211
         return jjMoveStringLiteralDfa3_0(active0, 0x80000L);
212
      case 100:
213
         return jjMoveStringLiteralDfa3_0(active0, 0x300000L);
214
      case 105:
215
         return jjMoveStringLiteralDfa3_0(active0, 0x840000L);
216
      case 110:
217
         return jjMoveStringLiteralDfa3_0(active0, 0x1000000L);
218
      case 111:
219
         return jjMoveStringLiteralDfa3_0(active0, 0x400000L);
220
      default :
221
         break;
222
   }
223
   return jjStartNfa_0(1, active0);
224
}
225
private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
226
{
227
   if (((active0 &= old0)) == 0L)
228
      return jjStartNfa_0(1, old0); 
229
   try { curChar = input_stream.readChar(); }
230
   catch(java.io.IOException e) {
231
      jjStopStringLiteralDfa_0(2, active0);
232
      return 3;
233
   }
234
   switch(curChar)
235
   {
236
      case 100:
237
         return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
238
      case 101:
239
         return jjMoveStringLiteralDfa4_0(active0, 0x300000L);
240
      case 111:
241
         return jjMoveStringLiteralDfa4_0(active0, 0x40000L);
242
      case 113:
243
         return jjMoveStringLiteralDfa4_0(active0, 0x800000L);
244
      case 114:
245
         return jjMoveStringLiteralDfa4_0(active0, 0x400000L);
246
      case 115:
247
         return jjMoveStringLiteralDfa4_0(active0, 0x80000L);
248
      case 117:
249
         return jjMoveStringLiteralDfa4_0(active0, 0x1000000L);
250
      default :
251
         break;
252
   }
253
   return jjStartNfa_0(2, active0);
254
}
255
private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
256
{
257
   if (((active0 &= old0)) == 0L)
258
      return jjStartNfa_0(2, old0); 
259
   try { curChar = input_stream.readChar(); }
260
   catch(java.io.IOException e) {
261
      jjStopStringLiteralDfa_0(3, active0);
262
      return 4;
263
   }
264
   switch(curChar)
265
   {
266
      case 79:
267
         return jjMoveStringLiteralDfa5_0(active0, 0x20000L);
268
      case 100:
269
         return jjMoveStringLiteralDfa5_0(active0, 0x400000L);
270
      case 101:
271
         return jjMoveStringLiteralDfa5_0(active0, 0x80000L);
272
      case 102:
273
         return jjMoveStringLiteralDfa5_0(active0, 0x100000L);
274
      case 110:
275
         if ((active0 & 0x40000L) != 0L)
276
            return jjStartNfaWithStates_0(4, 18, 2);
277
         return jjMoveStringLiteralDfa5_0(active0, 0x1000000L);
278
      case 114:
279
         return jjMoveStringLiteralDfa5_0(active0, 0x200000L);
280
      case 117:
281
         return jjMoveStringLiteralDfa5_0(active0, 0x800000L);
282
      default :
283
         break;
284
   }
285
   return jjStartNfa_0(3, active0);
286
}
287
private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
288
{
289
   if (((active0 &= old0)) == 0L)
290
      return jjStartNfa_0(3, old0); 
291
   try { curChar = input_stream.readChar(); }
292
   catch(java.io.IOException e) {
293
      jjStopStringLiteralDfa_0(4, active0);
294
      return 5;
295
   }
296
   switch(curChar)
297
   {
298
      case 101:
299
         if ((active0 & 0x800000L) != 0L)
300
            return jjStartNfaWithStates_0(5, 23, 2);
301
         return jjMoveStringLiteralDfa6_0(active0, 0x600000L);
302
      case 105:
303
         return jjMoveStringLiteralDfa6_0(active0, 0x1100000L);
304
      case 110:
305
         return jjMoveStringLiteralDfa6_0(active0, 0x20000L);
306
      case 116:
307
         return jjMoveStringLiteralDfa6_0(active0, 0x80000L);
308
      default :
309
         break;
310
   }
311
   return jjStartNfa_0(4, active0);
312
}
313
private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
314
{
315
   if (((active0 &= old0)) == 0L)
316
      return jjStartNfa_0(4, old0); 
317
   try { curChar = input_stream.readChar(); }
318
   catch(java.io.IOException e) {
319
      jjStopStringLiteralDfa_0(5, active0);
320
      return 6;
321
   }
322
   switch(curChar)
323
   {
324
      case 100:
325
         if ((active0 & 0x200000L) != 0L)
326
            return jjStartNfaWithStates_0(6, 21, 2);
327
         break;
328
      case 108:
329
         return jjMoveStringLiteralDfa7_0(active0, 0x20000L);
330
      case 110:
331
         return jjMoveStringLiteralDfa7_0(active0, 0x100000L);
332
      case 113:
333
         return jjMoveStringLiteralDfa7_0(active0, 0x1000000L);
334
      case 114:
335
         return jjMoveStringLiteralDfa7_0(active0, 0x400000L);
336
      case 115:
337
         if ((active0 & 0x80000L) != 0L)
338
            return jjStartNfaWithStates_0(6, 19, 2);
339
         break;
340
      default :
341
         break;
342
   }
343
   return jjStartNfa_0(5, active0);
344
}
345
private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
346
{
347
   if (((active0 &= old0)) == 0L)
348
      return jjStartNfa_0(5, old0); 
349
   try { curChar = input_stream.readChar(); }
350
   catch(java.io.IOException e) {
351
      jjStopStringLiteralDfa_0(6, active0);
352
      return 7;
353
   }
354
   switch(curChar)
355
   {
356
      case 101:
357
         return jjMoveStringLiteralDfa8_0(active0, 0x500000L);
358
      case 117:
359
         return jjMoveStringLiteralDfa8_0(active0, 0x1000000L);
360
      case 121:
361
         if ((active0 & 0x20000L) != 0L)
362
            return jjStartNfaWithStates_0(7, 17, 2);
363
         break;
364
      default :
365
         break;
366
   }
367
   return jjStartNfa_0(6, active0);
368
}
369
private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
370
{
371
   if (((active0 &= old0)) == 0L)
372
      return jjStartNfa_0(6, old0); 
373
   try { curChar = input_stream.readChar(); }
374
   catch(java.io.IOException e) {
375
      jjStopStringLiteralDfa_0(7, active0);
376
      return 8;
377
   }
378
   switch(curChar)
379
   {
380
      case 100:
381
         if ((active0 & 0x400000L) != 0L)
382
            return jjStartNfaWithStates_0(8, 22, 2);
383
         break;
384
      case 101:
385
         if ((active0 & 0x1000000L) != 0L)
386
            return jjStartNfaWithStates_0(8, 24, 2);
387
         break;
388
      case 115:
389
         if ((active0 & 0x100000L) != 0L)
390
            return jjStartNfaWithStates_0(8, 20, 2);
391
         break;
392
      default :
393
         break;
394
   }
395
   return jjStartNfa_0(7, active0);
396
}
397
private final void jjCheckNAdd(int state)
398
{
399
   if (jjrounds[state] != jjround)
400
   {
401
      jjstateSet[jjnewStateCnt++] = state;
402
      jjrounds[state] = jjround;
403
   }
404
}
405
private final void jjAddStates(int start, int end)
406
{
407
   do {
408
      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
409
   } while (start++ != end);
410
}
411
private final void jjCheckNAddTwoStates(int state1, int state2)
412
{
413
   jjCheckNAdd(state1);
414
   jjCheckNAdd(state2);
415
}
416
private final void jjCheckNAddStates(int start, int end)
417
{
418
   do {
419
      jjCheckNAdd(jjnextStates[start]);
420
   } while (start++ != end);
421
}
422
private final void jjCheckNAddStates(int start)
423
{
424
   jjCheckNAdd(jjnextStates[start]);
425
   jjCheckNAdd(jjnextStates[start + 1]);
426
}
427
static final long[] jjbitVec0 = {
428
   0x1ff00000fffffffeL, 0xffffffffffffc000L, 0xffffffffL, 0x600000000000000L
429
};
430
static final long[] jjbitVec2 = {
431
   0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
432
};
433
static final long[] jjbitVec3 = {
434
   0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
435
};
436
static final long[] jjbitVec4 = {
437
   0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
438
};
439
static final long[] jjbitVec5 = {
440
   0xffffffffffffffffL, 0xffffffffffffffffL, 0x0L, 0x0L
441
};
442
static final long[] jjbitVec6 = {
443
   0x3fffffffffffL, 0x0L, 0x0L, 0x0L
444
};
445
private final int jjMoveNfa_0(int startState, int curPos)
446
{
447
   int[] nextStates;
448
   int startsAt = 0;
449
   jjnewStateCnt = 3;
450
   int i = 1;
451
   jjstateSet[0] = startState;
452
   int j, kind = 0x7fffffff;
453
   for (;;)
454
   {
455
      if (++jjround == 0x7fffffff)
456
         ReInitRounds();
457
      if (curChar < 64)
458
      {
459
         long l = 1L << curChar;
460
         MatchLoop: do
461
         {
462
            switch(jjstateSet[--i])
463
            {
464
               case 1:
465
                  if ((0x3ff000000000000L & l) != 0L)
466
                  {
467
                     if (kind > 25)
468
                        kind = 25;
469
                     jjCheckNAdd(0);
470
                  }
471
                  else if (curChar == 36)
472
                  {
473
                     if (kind > 26)
474
                        kind = 26;
475
                     jjCheckNAdd(2);
476
                  }
477
                  break;
478
               case 0:
479
                  if ((0x3ff000000000000L & l) == 0L)
480
                     break;
481
                  if (kind > 25)
482
                     kind = 25;
483
                  jjCheckNAdd(0);
484
                  break;
485
               case 2:
486
                  if ((0x3ff001000000000L & l) == 0L)
487
                     break;
488
                  if (kind > 26)
489
                     kind = 26;
490
                  jjCheckNAdd(2);
491
                  break;
492
               default : break;
493
            }
494
         } while(i != startsAt);
495
      }
496
      else if (curChar < 128)
497
      {
498
         long l = 1L << (curChar & 077);
499
         MatchLoop: do
500
         {
501
            switch(jjstateSet[--i])
502
            {
503
               case 1:
504
               case 2:
505
                  if ((0x7fffffe87fffffeL & l) == 0L)
506
                     break;
507
                  if (kind > 26)
508
                     kind = 26;
509
                  jjCheckNAdd(2);
510
                  break;
511
               default : break;
512
            }
513
         } while(i != startsAt);
514
      }
515
      else
516
      {
517
         int hiByte = (int)(curChar >> 8);
518
         int i1 = hiByte >> 6;
519
         long l1 = 1L << (hiByte & 077);
520
         int i2 = (curChar & 0xff) >> 6;
521
         long l2 = 1L << (curChar & 077);
522
         MatchLoop: do
523
         {
524
            switch(jjstateSet[--i])
525
            {
526
               case 1:
527
               case 2:
528
                  if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
529
                     break;
530
                  if (kind > 26)
531
                     kind = 26;
532
                  jjCheckNAdd(2);
533
                  break;
534
               default : break;
535
            }
536
         } while(i != startsAt);
537
      }
538
      if (kind != 0x7fffffff)
539
      {
540
         jjmatchedKind = kind;
541
         jjmatchedPos = curPos;
542
         kind = 0x7fffffff;
543
      }
544
      ++curPos;
545
      if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
546
         return curPos;
547
      try { curChar = input_stream.readChar(); }
548
      catch(java.io.IOException e) { return curPos; }
549
   }
550
}
551
static final int[] jjnextStates = {
552
};
553
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
554
{
555
   switch(hiByte)
556
   {
557
      case 0:
558
         return ((jjbitVec2[i2] & l2) != 0L);
559
      case 48:
560
         return ((jjbitVec3[i2] & l2) != 0L);
561
      case 49:
562
         return ((jjbitVec4[i2] & l2) != 0L);
563
      case 51:
564
         return ((jjbitVec5[i2] & l2) != 0L);
565
      case 61:
566
         return ((jjbitVec6[i2] & l2) != 0L);
567
      default : 
568
         if ((jjbitVec0[i1] & l1) != 0L)
569
            return true;
570
         return false;
571
   }
572
}
573
public static final String[] jjstrLiteralImages = {
574
"", null, null, "\57", "\72", "\75", "\133", "\135", "\173", "\175", "\54", 
575
"\53", "\55", "\43", "\176", "\56", "\52", "\162\145\141\144\117\156\154\171", 
576
"\165\156\151\157\156", "\163\165\142\163\145\164\163", "\162\145\144\145\146\151\156\145\163", 
577
"\157\162\144\145\162\145\144", "\165\156\157\162\144\145\162\145\144", "\165\156\151\161\165\145", 
578
"\156\157\156\165\156\151\161\165\145", null, null, null, null, };
579
public static final String[] lexStateNames = {
580
   "DEFAULT", 
581
};
582
static final long[] jjtoToken = {
583
   0x7fffff9L, 
584
};
585
static final long[] jjtoSkip = {
586
   0x6L, 
587
};
588
static final long[] jjtoSpecial = {
589
   0x6L, 
590
};
591
protected JavaCharStream input_stream;
592
private final int[] jjrounds = new int[3];
593
private final int[] jjstateSet = new int[6];
594
protected char curChar;
595
public PropertyParserTokenManager(JavaCharStream stream)
596
{
597
   if (JavaCharStream.staticFlag)
598
      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
599
   input_stream = stream;
600
}
601
public PropertyParserTokenManager(JavaCharStream stream, int lexState)
602
{
603
   this(stream);
604
   SwitchTo(lexState);
605
}
606
public void ReInit(JavaCharStream stream)
607
{
608
   jjmatchedPos = jjnewStateCnt = 0;
609
   curLexState = defaultLexState;
610
   input_stream = stream;
611
   ReInitRounds();
612
}
613
private final void ReInitRounds()
614
{
615
   int i;
616
   jjround = 0x80000001;
617
   for (i = 3; i-- > 0;)
618
      jjrounds[i] = 0x80000000;
619
}
620
public void ReInit(JavaCharStream stream, int lexState)
621
{
622
   ReInit(stream);
623
   SwitchTo(lexState);
624
}
625
public void SwitchTo(int lexState)
626
{
627
   if (lexState >= 1 || lexState < 0)
628
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
629
   else
630
      curLexState = lexState;
631
}
632
633
protected Token jjFillToken()
634
{
635
   Token t = Token.newToken(jjmatchedKind);
636
   t.kind = jjmatchedKind;
637
   String im = jjstrLiteralImages[jjmatchedKind];
638
   t.image = (im == null) ? input_stream.GetImage() : im;
639
   t.beginLine = input_stream.getBeginLine();
640
   t.beginColumn = input_stream.getBeginColumn();
641
   t.endLine = input_stream.getEndLine();
642
   t.endColumn = input_stream.getEndColumn();
643
   return t;
644
}
645
646
int curLexState = 0;
647
int defaultLexState = 0;
648
int jjnewStateCnt;
649
int jjround;
650
int jjmatchedPos;
651
int jjmatchedKind;
652
653
public Token getNextToken() 
654
{
655
  int kind;
656
  Token specialToken = null;
657
  Token matchedToken;
658
  int curPos = 0;
659
660
  EOFLoop :
661
  for (;;)
662
  {   
663
   try   
664
   {     
665
      curChar = input_stream.BeginToken();
666
   }     
667
   catch(java.io.IOException e)
668
   {        
669
      jjmatchedKind = 0;
670
      matchedToken = jjFillToken();
671
      matchedToken.specialToken = specialToken;
672
      return matchedToken;
673
   }
674
675
   jjmatchedKind = 0x7fffffff;
676
   jjmatchedPos = 0;
677
   curPos = jjMoveStringLiteralDfa0_0();
678
   if (jjmatchedKind != 0x7fffffff)
679
   {
680
      if (jjmatchedPos + 1 < curPos)
681
         input_stream.backup(curPos - jjmatchedPos - 1);
682
      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
683
      {
684
         matchedToken = jjFillToken();
685
         matchedToken.specialToken = specialToken;
686
         return matchedToken;
687
      }
688
      else
689
      {
690
         if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
691
         {
692
            matchedToken = jjFillToken();
693
            if (specialToken == null)
694
               specialToken = matchedToken;
695
            else
696
            {
697
               matchedToken.specialToken = specialToken;
698
               specialToken = (specialToken.next = matchedToken);
699
            }
700
         }
701
         continue EOFLoop;
702
      }
703
   }
704
   int error_line = input_stream.getEndLine();
705
   int error_column = input_stream.getEndColumn();
706
   String error_after = null;
707
   boolean EOFSeen = false;
708
   try { input_stream.readChar(); input_stream.backup(1); }
709
   catch (java.io.IOException e1) {
710
      EOFSeen = true;
711
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
712
      if (curChar == '\n' || curChar == '\r') {
713
         error_line++;
714
         error_column = 0;
715
      }
716
      else
717
         error_column++;
718
   }
719
   if (!EOFSeen) {
720
      input_stream.backup(1);
721
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
722
   }
723
   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
724
  }
725
}
726
727
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/operation/OperationToString.java (+171 lines)
Added Link Here
1
/*
2
 * Copyright (c) 2006 Borland Software Corporation
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    Michael Golubev (Borland) - initial API and implementation
11
 */
12
13
package org.eclipse.uml2.diagram.clazz.parser.operation;
14
15
import java.util.Arrays;
16
import java.util.Iterator;
17
import java.util.LinkedList;
18
import java.util.List;
19
20
import org.eclipse.emf.ecore.EObject;
21
import org.eclipse.emf.ecore.EStructuralFeature;
22
import org.eclipse.uml2.diagram.parser.AbstractToString;
23
import org.eclipse.uml2.uml.Operation;
24
import org.eclipse.uml2.uml.Parameter;
25
import org.eclipse.uml2.uml.ParameterDirectionKind;
26
import org.eclipse.uml2.uml.UMLPackage;
27
28
public abstract class OperationToString extends AbstractToString {
29
	public static class EDIT extends OperationToString {
30
		public String getToString(EObject object, int flags) {
31
			return getToString(object, true);
32
		}
33
		
34
		public boolean isAffectingFeature(EStructuralFeature feature) {
35
			throw new UnsupportedOperationException();
36
		}
37
	}
38
	
39
	public static class VIEW extends OperationToString implements WithReferences {
40
		private static final List AFFECTING = Arrays.asList(new EStructuralFeature[] {
41
				UMLPackage.eINSTANCE.getNamedElement_Visibility(),
42
				UMLPackage.eINSTANCE.getNamedElement_Name(),
43
				UMLPackage.eINSTANCE.getBehavior_OwnedParameter(),
44
				UMLPackage.eINSTANCE.getParameter_Direction(),
45
				UMLPackage.eINSTANCE.getTypedElement_Type(),
46
				UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue(),
47
				UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue(),
48
				UMLPackage.eINSTANCE.getLiteralUnlimitedNatural_Value(), 
49
				UMLPackage.eINSTANCE.getLiteralInteger_Value(),
50
		});
51
		
52
		public String getToString(EObject object, int flags) {
53
			return getToString(object, false);
54
		}
55
56
		public boolean isAffectingFeature(EStructuralFeature feature) {
57
			return AFFECTING.contains(feature);
58
		}
59
		
60
		public List getAdditionalReferencedElements(EObject object) {
61
			Operation operation = asOperation(object);
62
			List result = new LinkedList(){
63
				public boolean add(Object data) {
64
					return (data != null) && super.add(data);
65
				}
66
			};
67
			result.add(operation);
68
			for (Iterator params = operation.getOwnedParameters().iterator(); params.hasNext();){
69
				Parameter next = (Parameter)params.next();
70
				result.add(next.getType());
71
				result.add(next);
72
				result.add(next.getLowerValue());
73
				result.add(next.getUpperValue());
74
			}
75
			return result;
76
		}
77
	}
78
	
79
	protected String getToString(EObject object, boolean editNotView) {
80
		Operation operation = asOperation(object);
81
		StringBuffer result = new StringBuffer();
82
		
83
		result.append(getVisibility(operation));
84
		appendName(result, operation);
85
		result.append("( ");
86
		
87
		Parameter ret = operation.getReturnResult();
88
		boolean firstWritten = false;
89
		for (Iterator parameters = operation.getOwnedParameters().iterator(); parameters.hasNext();){
90
			Parameter next = (Parameter)parameters.next();
91
			if (next.equals(ret)){
92
				continue;
93
			}
94
			if (firstWritten){
95
				result.append(", ");
96
			}
97
			firstWritten = true;
98
			result.append(getDirection(next));
99
			appendName(result, next);
100
			appendType(result, next);
101
			appendMultiplicity(result, next);
102
			if (editNotView){
103
				appendDefaultParameterValue(result, next);
104
			}
105
			
106
		}
107
		result.append(" )");
108
		
109
		if (ret != null){
110
			appendType(result, ret);
111
		}
112
		if (editNotView){
113
			appendModifiers(result, operation);
114
		}
115
		return result.toString();
116
	}
117
118
	protected void appendDefaultParameterValue(StringBuffer result, Parameter parameter){
119
		String def = parameter.getDefault();
120
		if (!isEmpty(def)){
121
			result.append(" = ");
122
			result.append(def);
123
		}
124
	}
125
	
126
	protected String getDirection(Parameter parameter){
127
		ParameterDirectionKind direction = parameter.getDirection();
128
		switch(direction.getValue()){
129
			case ParameterDirectionKind.IN : 
130
				return ""; //default is omitted
131
			case ParameterDirectionKind.OUT:
132
				return "out ";
133
			case ParameterDirectionKind.INOUT:
134
				return "inout ";
135
			case ParameterDirectionKind.RETURN:
136
				throw new IllegalStateException("Return parameter should not be included into parameters list");
137
		}
138
		
139
		throw new IllegalStateException("Unknown parameter direction kind: " + direction + " for parameter: " + parameter);
140
	}
141
	
142
	protected Operation asOperation(EObject object){
143
		if (false == object instanceof Operation){
144
			throw new IllegalStateException("I can not provide toString for: " + object);
145
		}
146
		return (Operation)object;
147
	}
148
149
	public void appendModifiers(StringBuffer result, Operation operation) {
150
		ModifiersBuilder builder = new ModifiersBuilder();
151
		if (operation.isQuery()){
152
			builder.appendModifier("query");
153
		}
154
		if (operation.isOrdered()){
155
			builder.appendModifier("ordered");
156
		}
157
		if (operation.isUnique()){
158
			builder.appendModifier("unique");
159
		}
160
		for (Iterator redefines = operation.getRedefinedOperations().iterator(); redefines.hasNext();){
161
			Operation next = (Operation) redefines.next();
162
			String nextName = next.getName();
163
			if (!isEmpty(nextName)){
164
				builder.appendModifier("redefines " + nextName);
165
			}
166
		}
167
		
168
		builder.writeInto(result);
169
	}
170
171
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/DependencyClientViewFactory.java (+47 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
10
import org.eclipse.gmf.runtime.notation.NotationFactory;
11
import org.eclipse.gmf.runtime.notation.View;
12
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
13
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
14
15
/**
16
 * @generated
17
 */
18
public class DependencyClientViewFactory extends ConnectionViewFactory {
19
20
	/**
21
	 * @generated 
22
	 */
23
	protected List createStyles(View view) {
24
		List styles = new ArrayList();
25
		styles.add(NotationFactory.eINSTANCE.createRoutingStyle());
26
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
27
		return styles;
28
	}
29
30
	/**
31
	 * @generated
32
	 */
33
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
34
		if (semanticHint == null) {
35
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.DependencyClientEditPart.VISUAL_ID);
36
			view.setType(semanticHint);
37
		}
38
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
39
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
40
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
41
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
42
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
43
			view.getEAnnotations().add(shortcutAnnotation);
44
		}
45
	}
46
47
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/PackageEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class PackageEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/DataTypeViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class DataTypeViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeEditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/instance/JavaCharStream.java (+558 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.instance;
14
15
/**
16
 * An implementation of interface CharStream, where the stream is assumed to
17
 * contain only ASCII characters (with java-like unicode escape processing).
18
 */
19
20
public class JavaCharStream
21
{
22
  public static final boolean staticFlag = false;
23
  static final int hexval(char c) throws java.io.IOException {
24
    switch(c)
25
    {
26
       case '0' :
27
          return 0;
28
       case '1' :
29
          return 1;
30
       case '2' :
31
          return 2;
32
       case '3' :
33
          return 3;
34
       case '4' :
35
          return 4;
36
       case '5' :
37
          return 5;
38
       case '6' :
39
          return 6;
40
       case '7' :
41
          return 7;
42
       case '8' :
43
          return 8;
44
       case '9' :
45
          return 9;
46
47
       case 'a' :
48
       case 'A' :
49
          return 10;
50
       case 'b' :
51
       case 'B' :
52
          return 11;
53
       case 'c' :
54
       case 'C' :
55
          return 12;
56
       case 'd' :
57
       case 'D' :
58
          return 13;
59
       case 'e' :
60
       case 'E' :
61
          return 14;
62
       case 'f' :
63
       case 'F' :
64
          return 15;
65
    }
66
67
    throw new java.io.IOException(); // Should never come here
68
  }
69
70
  public int bufpos = -1;
71
  int bufsize;
72
  int available;
73
  int tokenBegin;
74
  protected int bufline[];
75
  protected int bufcolumn[];
76
77
  protected int column = 0;
78
  protected int line = 1;
79
80
  protected boolean prevCharIsCR = false;
81
  protected boolean prevCharIsLF = false;
82
83
  protected java.io.Reader inputStream;
84
85
  protected char[] nextCharBuf;
86
  protected char[] buffer;
87
  protected int maxNextCharInd = 0;
88
  protected int nextCharInd = -1;
89
  protected int inBuf = 0;
90
91
  protected void ExpandBuff(boolean wrapAround)
92
  {
93
     char[] newbuffer = new char[bufsize + 2048];
94
     int newbufline[] = new int[bufsize + 2048];
95
     int newbufcolumn[] = new int[bufsize + 2048];
96
97
     try
98
     {
99
        if (wrapAround)
100
        {
101
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
102
           System.arraycopy(buffer, 0, newbuffer,
103
                                             bufsize - tokenBegin, bufpos);
104
           buffer = newbuffer;
105
106
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
107
           System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
108
           bufline = newbufline;
109
110
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
111
           System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
112
           bufcolumn = newbufcolumn;
113
114
           bufpos += (bufsize - tokenBegin);
115
        }
116
        else
117
        {
118
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
119
           buffer = newbuffer;
120
121
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
122
           bufline = newbufline;
123
124
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
125
           bufcolumn = newbufcolumn;
126
127
           bufpos -= tokenBegin;
128
        }
129
     }
130
     catch (Throwable t)
131
     {
132
        throw new Error(t.getMessage());
133
     }
134
135
     available = (bufsize += 2048);
136
     tokenBegin = 0;
137
  }
138
139
  protected void FillBuff() throws java.io.IOException
140
  {
141
     int i;
142
     if (maxNextCharInd == 4096)
143
        maxNextCharInd = nextCharInd = 0;
144
145
     try {
146
        if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
147
                                            4096 - maxNextCharInd)) == -1)
148
        {
149
           inputStream.close();
150
           throw new java.io.IOException();
151
        }
152
        else
153
           maxNextCharInd += i;
154
        return;
155
     }
156
     catch(java.io.IOException e) {
157
        if (bufpos != 0)
158
        {
159
           --bufpos;
160
           backup(0);
161
        }
162
        else
163
        {
164
           bufline[bufpos] = line;
165
           bufcolumn[bufpos] = column;
166
        }
167
        throw e;
168
     }
169
  }
170
171
  protected char ReadByte() throws java.io.IOException
172
  {
173
     if (++nextCharInd >= maxNextCharInd)
174
        FillBuff();
175
176
     return nextCharBuf[nextCharInd];
177
  }
178
179
  public char BeginToken() throws java.io.IOException
180
  {     
181
     if (inBuf > 0)
182
     {
183
        --inBuf;
184
185
        if (++bufpos == bufsize)
186
           bufpos = 0;
187
188
        tokenBegin = bufpos;
189
        return buffer[bufpos];
190
     }
191
192
     tokenBegin = 0;
193
     bufpos = -1;
194
195
     return readChar();
196
  }     
197
198
  protected void AdjustBuffSize()
199
  {
200
     if (available == bufsize)
201
     {
202
        if (tokenBegin > 2048)
203
        {
204
           bufpos = 0;
205
           available = tokenBegin;
206
        }
207
        else
208
           ExpandBuff(false);
209
     }
210
     else if (available > tokenBegin)
211
        available = bufsize;
212
     else if ((tokenBegin - available) < 2048)
213
        ExpandBuff(true);
214
     else
215
        available = tokenBegin;
216
  }
217
218
  protected void UpdateLineColumn(char c)
219
  {
220
     column++;
221
222
     if (prevCharIsLF)
223
     {
224
        prevCharIsLF = false;
225
        line += (column = 1);
226
     }
227
     else if (prevCharIsCR)
228
     {
229
        prevCharIsCR = false;
230
        if (c == '\n')
231
        {
232
           prevCharIsLF = true;
233
        }
234
        else
235
           line += (column = 1);
236
     }
237
238
     switch (c)
239
     {
240
        case '\r' :
241
           prevCharIsCR = true;
242
           break;
243
        case '\n' :
244
           prevCharIsLF = true;
245
           break;
246
        case '\t' :
247
           column--;
248
           column += (8 - (column & 07));
249
           break;
250
        default :
251
           break;
252
     }
253
254
     bufline[bufpos] = line;
255
     bufcolumn[bufpos] = column;
256
  }
257
258
  public char readChar() throws java.io.IOException
259
  {
260
     if (inBuf > 0)
261
     {
262
        --inBuf;
263
264
        if (++bufpos == bufsize)
265
           bufpos = 0;
266
267
        return buffer[bufpos];
268
     }
269
270
     char c;
271
272
     if (++bufpos == available)
273
        AdjustBuffSize();
274
275
     if ((buffer[bufpos] = c = ReadByte()) == '\\')
276
     {
277
        UpdateLineColumn(c);
278
279
        int backSlashCnt = 1;
280
281
        for (;;) // Read all the backslashes
282
        {
283
           if (++bufpos == available)
284
              AdjustBuffSize();
285
286
           try
287
           {
288
              if ((buffer[bufpos] = c = ReadByte()) != '\\')
289
              {
290
                 UpdateLineColumn(c);
291
                 // found a non-backslash char.
292
                 if ((c == 'u') && ((backSlashCnt & 1) == 1))
293
                 {
294
                    if (--bufpos < 0)
295
                       bufpos = bufsize - 1;
296
297
                    break;
298
                 }
299
300
                 backup(backSlashCnt);
301
                 return '\\';
302
              }
303
           }
304
           catch(java.io.IOException e)
305
           {
306
              if (backSlashCnt > 1)
307
                 backup(backSlashCnt);
308
309
              return '\\';
310
           }
311
312
           UpdateLineColumn(c);
313
           backSlashCnt++;
314
        }
315
316
        // Here, we have seen an odd number of backslash's followed by a 'u'
317
        try
318
        {
319
           while ((c = ReadByte()) == 'u')
320
              ++column;
321
322
           buffer[bufpos] = c = (char)(hexval(c) << 12 |
323
                                       hexval(ReadByte()) << 8 |
324
                                       hexval(ReadByte()) << 4 |
325
                                       hexval(ReadByte()));
326
327
           column += 4;
328
        }
329
        catch(java.io.IOException e)
330
        {
331
           throw new Error("Invalid escape character at line " + line +
332
                                         " column " + column + ".");
333
        }
334
335
        if (backSlashCnt == 1)
336
           return c;
337
        else
338
        {
339
           backup(backSlashCnt - 1);
340
           return '\\';
341
        }
342
     }
343
     else
344
     {
345
        UpdateLineColumn(c);
346
        return (c);
347
     }
348
  }
349
350
  /**
351
   * @deprecated 
352
   * @see #getEndColumn
353
   */
354
355
  public int getColumn() {
356
     return bufcolumn[bufpos];
357
  }
358
359
  /**
360
   * @deprecated 
361
   * @see #getEndLine
362
   */
363
364
  public int getLine() {
365
     return bufline[bufpos];
366
  }
367
368
  public int getEndColumn() {
369
     return bufcolumn[bufpos];
370
  }
371
372
  public int getEndLine() {
373
     return bufline[bufpos];
374
  }
375
376
  public int getBeginColumn() {
377
     return bufcolumn[tokenBegin];
378
  }
379
380
  public int getBeginLine() {
381
     return bufline[tokenBegin];
382
  }
383
384
  public void backup(int amount) {
385
386
    inBuf += amount;
387
    if ((bufpos -= amount) < 0)
388
       bufpos += bufsize;
389
  }
390
391
  public JavaCharStream(java.io.Reader dstream,
392
                 int startline, int startcolumn, int buffersize)
393
  {
394
    inputStream = dstream;
395
    line = startline;
396
    column = startcolumn - 1;
397
398
    available = bufsize = buffersize;
399
    buffer = new char[buffersize];
400
    bufline = new int[buffersize];
401
    bufcolumn = new int[buffersize];
402
    nextCharBuf = new char[4096];
403
  }
404
405
  public JavaCharStream(java.io.Reader dstream,
406
                                        int startline, int startcolumn)
407
  {
408
     this(dstream, startline, startcolumn, 4096);
409
  }
410
411
  public JavaCharStream(java.io.Reader dstream)
412
  {
413
     this(dstream, 1, 1, 4096);
414
  }
415
  public void ReInit(java.io.Reader dstream,
416
                 int startline, int startcolumn, int buffersize)
417
  {
418
    inputStream = dstream;
419
    line = startline;
420
    column = startcolumn - 1;
421
422
    if (buffer == null || buffersize != buffer.length)
423
    {
424
      available = bufsize = buffersize;
425
      buffer = new char[buffersize];
426
      bufline = new int[buffersize];
427
      bufcolumn = new int[buffersize];
428
      nextCharBuf = new char[4096];
429
    }
430
    prevCharIsLF = prevCharIsCR = false;
431
    tokenBegin = inBuf = maxNextCharInd = 0;
432
    nextCharInd = bufpos = -1;
433
  }
434
435
  public void ReInit(java.io.Reader dstream,
436
                                        int startline, int startcolumn)
437
  {
438
     ReInit(dstream, startline, startcolumn, 4096);
439
  }
440
441
  public void ReInit(java.io.Reader dstream)
442
  {
443
     ReInit(dstream, 1, 1, 4096);
444
  }
445
  public JavaCharStream(java.io.InputStream dstream, int startline,
446
  int startcolumn, int buffersize)
447
  {
448
     this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
449
  }
450
451
  public JavaCharStream(java.io.InputStream dstream, int startline,
452
                                                           int startcolumn)
453
  {
454
     this(dstream, startline, startcolumn, 4096);
455
  }
456
457
  public JavaCharStream(java.io.InputStream dstream)
458
  {
459
     this(dstream, 1, 1, 4096);
460
  }
461
462
  public void ReInit(java.io.InputStream dstream, int startline,
463
  int startcolumn, int buffersize)
464
  {
465
     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
466
  }
467
  public void ReInit(java.io.InputStream dstream, int startline,
468
                                                           int startcolumn)
469
  {
470
     ReInit(dstream, startline, startcolumn, 4096);
471
  }
472
  public void ReInit(java.io.InputStream dstream)
473
  {
474
     ReInit(dstream, 1, 1, 4096);
475
  }
476
477
  public String GetImage()
478
  {
479
     if (bufpos >= tokenBegin)
480
        return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
481
     else
482
        return new String(buffer, tokenBegin, bufsize - tokenBegin) +
483
                              new String(buffer, 0, bufpos + 1);
484
  }
485
486
  public char[] GetSuffix(int len)
487
  {
488
     char[] ret = new char[len];
489
490
     if ((bufpos + 1) >= len)
491
        System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
492
     else
493
     {
494
        System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
495
                                                          len - bufpos - 1);
496
        System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
497
     }
498
499
     return ret;
500
  }
501
502
  public void Done()
503
  {
504
     nextCharBuf = null;
505
     buffer = null;
506
     bufline = null;
507
     bufcolumn = null;
508
  }
509
510
  /**
511
   * Method to adjust line and column numbers for the start of a token.
512
   */
513
  public void adjustBeginLineColumn(int newLine, int newCol)
514
  {
515
     int start = tokenBegin;
516
     int len;
517
518
     if (bufpos >= tokenBegin)
519
     {
520
        len = bufpos - tokenBegin + inBuf + 1;
521
     }
522
     else
523
     {
524
        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
525
     }
526
527
     int i = 0, j = 0, k = 0;
528
     int nextColDiff = 0, columnDiff = 0;
529
530
     while (i < len &&
531
            bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
532
     {
533
        bufline[j] = newLine;
534
        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
535
        bufcolumn[j] = newCol + columnDiff;
536
        columnDiff = nextColDiff;
537
        i++;
538
     } 
539
540
     if (i < len)
541
     {
542
        bufline[j] = newLine++;
543
        bufcolumn[j] = newCol + columnDiff;
544
545
        while (i++ < len)
546
        {
547
           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
548
              bufline[j] = newLine++;
549
           else
550
              bufline[j] = newLine;
551
        }
552
     }
553
554
     line = bufline[j];
555
     column = bufcolumn[j];
556
  }
557
558
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/DataTypeEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class DataTypeEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/InstanceSpecificationEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class InstanceSpecificationEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationNameViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class AssociationNameViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(40));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PropertyViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class PropertyViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.PropertyEditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Enumeration2ViewFactory.java (+58 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationAttributesEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationLiteralsEditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationNameEditPart;
16
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationOperationsEditPart;
17
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
18
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
19
20
/**
21
 * @generated
22
 */
23
public class Enumeration2ViewFactory extends AbstractShapeViewFactory {
24
25
	/**
26
	 * @generated 
27
	 */
28
	protected List createStyles(View view) {
29
		List styles = new ArrayList();
30
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
31
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
32
		styles.add(NotationFactory.eINSTANCE.createFillStyle());
33
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
34
		return styles;
35
	}
36
37
	/**
38
	 * @generated
39
	 */
40
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
41
		if (semanticHint == null) {
42
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Enumeration2EditPart.VISUAL_ID);
43
			view.setType(semanticHint);
44
		}
45
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(EnumerationNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
53
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(EnumerationLiteralsEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
54
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(EnumerationAttributesEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
55
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(EnumerationOperationsEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
56
	}
57
58
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/end/association-end.jj (+350 lines)
Added Link Here
1
options {
2
  JAVA_UNICODE_ESCAPE = true;
3
  STATIC=false;
4
}
5
6
PARSER_BEGIN(AssociationEndParser)
7
8
/*
9
 * Copyright (c) 2006 Borland Software Corporation
10
 * 
11
 * All rights reserved. This program and the accompanying materials
12
 * are made available under the terms of the Eclipse Public License v1.0
13
 * which accompanies this distribution, and is available at
14
 * http://www.eclipse.org/legal/epl-v10.html
15
 *
16
 * Contributors:
17
 *    Michael Golubev (Borland) - initial API and implementation
18
 */
19
package org.eclipse.uml2.diagram.clazz.parser.association.end;
20
21
import java.io.*;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EObject;
24
import org.eclipse.uml2.diagram.parser.*;
25
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
26
import org.eclipse.uml2.uml.*;
27
28
public class AssociationEndParser extends ExternalParserBase {
29
	private Property mySubject;
30
31
    public AssociationEndParser(){
32
    	this(new StringReader(""));
33
    }
34
    
35
    public AssociationEndParser(LookupSuite lookup){
36
    	this();
37
    	setLookupSuite(lookup);
38
    }
39
40
	public EClass getSubjectClass(){
41
		// though we expects the Property instance, the input object is still Association 
42
		// @see createSubjectPrototype()
43
		return UMLPackage.eINSTANCE.getAssociation();
44
	}
45
	
46
    public EObject createSubjectPrototype() {
47
    	return UMLFactory.eINSTANCE.createProperty();
48
    }
49
	
50
	public void parse(EObject target, String text) throws ExternalParserException {
51
		checkContext();
52
		ReInit(new StringReader(text));
53
		mySubject = (Property)target;
54
		Declaration();
55
		mySubject = null;
56
	}
57
	
58
	protected static int parseInt(Token t) throws ParseException {
59
		if (t.kind != AssociationEndParserConstants.INTEGER_LITERAL){
60
			throw new IllegalStateException("Token: " + t + ", image: " + t.image);
61
		}
62
		try {
63
			return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
64
		} catch (NumberFormatException e){
65
			throw new ParseException("Not supported integer value:" + t.image);
66
		}
67
	}
68
	
69
}
70
71
PARSER_END(AssociationEndParser)
72
73
/* WHITE SPACE */
74
75
SPECIAL_TOKEN :
76
{
77
  " "
78
| "\t"
79
}
80
81
/* SEPARATORS */
82
TOKEN :
83
{
84
	< SLASH: "/" >
85
|	< COLON: ":" >
86
|	< EQUALS: "=" >
87
|	< LBRACKET: "[" >
88
|	< RBRACKET: "]" >
89
|	< LCURLY: "{" >
90
|	< RCURLY: "}" >
91
|	< COMMA: "," >
92
}
93
94
/* SPECIAL_MEANING */
95
TOKEN :
96
{
97
	< PLUS: "+" >
98
|	< MINUS: "-" >
99
|	< NUMBER_SIGN: "#" >
100
|	< TILDE: "~" >
101
|	< DOT: "." >
102
|	< STAR: "*" >
103
}
104
105
/* MODIFIERS */
106
TOKEN :
107
{
108
	< READ_ONLY: "readOnly" >
109
|	< UNION: "union" >
110
|	< SUBSETS: "subsets" >
111
|	< REDEFINES: "redefines" >
112
|	< ORDERED: "ordered" >
113
|	< UNORDERED: "unordered" > 
114
|	< UNIQUE: "unique" >
115
|	< NON_UNIQUE: "nonunique" >
116
}
117
	
118
/* LITERALS */
119
TOKEN: 
120
{
121
	< INTEGER_LITERAL: ["0"-"9"] (["0"-"9"])* >
122
}
123
  
124
TOKEN :
125
{
126
  < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
127
|
128
  < #LETTER:
129
      [
130
       "\u0024",
131
       "\u0041"-"\u005a",
132
       "\u005f",
133
       "\u0061"-"\u007a",
134
       "\u00c0"-"\u00d6",
135
       "\u00d8"-"\u00f6",
136
       "\u00f8"-"\u00ff",
137
       "\u0100"-"\u1fff",
138
       "\u3040"-"\u318f",
139
       "\u3300"-"\u337f",
140
       "\u3400"-"\u3d2d",
141
       "\u4e00"-"\u9fff",
142
       "\uf900"-"\ufaff"
143
      ]
144
  >
145
|
146
  < #DIGIT:
147
      [
148
       "\u0030"-"\u0039",
149
       "\u0660"-"\u0669",
150
       "\u06f0"-"\u06f9",
151
       "\u0966"-"\u096f",
152
       "\u09e6"-"\u09ef",
153
       "\u0a66"-"\u0a6f",
154
       "\u0ae6"-"\u0aef",
155
       "\u0b66"-"\u0b6f",
156
       "\u0be7"-"\u0bef",
157
       "\u0c66"-"\u0c6f",
158
       "\u0ce6"-"\u0cef",
159
       "\u0d66"-"\u0d6f",
160
       "\u0e50"-"\u0e59",
161
       "\u0ed0"-"\u0ed9",
162
       "\u1040"-"\u1049"
163
      ]
164
  >
165
}
166
167
void Declaration() :
168
{}
169
{
170
	(
171
		[ Visibility() ]
172
		[ IsDerived() ]
173
		PropertyName()
174
		[ Multiplicity() ]
175
		[ PropertyModifiers() ]
176
	) <EOF>
177
}
178
179
void PropertyName() :
180
{
181
	String name;
182
}
183
{
184
	name = NameWithSpaces() 
185
	{
186
		mySubject.setName(name);
187
	}
188
}
189
190
void Visibility() :
191
{ 
192
	VisibilityKind kind;
193
}
194
{
195
	(
196
		<PLUS> { kind = VisibilityKind.PUBLIC_LITERAL; }
197
	|
198
		<MINUS> { kind = VisibilityKind.PRIVATE_LITERAL; }
199
	|
200
		<NUMBER_SIGN> { kind = VisibilityKind.PROTECTED_LITERAL; }
201
	|
202
		<TILDE> { kind = VisibilityKind.PACKAGE_LITERAL; }
203
	)
204
	{
205
		mySubject.setVisibility(kind);
206
	}
207
}
208
209
void Multiplicity() :
210
{}
211
{
212
	MultiplicityRange() 
213
	/* XXX: Parse conflict in case of empty DefaultValue, consider "a:int[5]{unique}"  
214
	[ MultiplicityDesignator() ] 
215
	*/
216
}
217
218
/* XXX: Parse conflict in case of empty default value
219
void MultiplicityDesignator() :
220
{ }
221
{
222
	<LCURLY> 
223
	(
224
		( MultiplicityUnique() [ MultiplicityOrdered() ] ) 
225
		|
226
		( MultiplicityOrdered() [ MultiplicityUnique() ] ) 
227
	) 
228
	<RCURLY>
229
}
230
231
void MultiplicityUnique() :
232
{}
233
{
234
		<UNIQUE> { mySubject.setIsUnique(true); }
235
	|
236
		<NON_UNIQUE> { mySubject.setIsUnique(false); }	
237
}
238
239
void MultiplicityOrdered() :
240
{}
241
{
242
		<ORDERED> { mySubject.setIsOrdered(true); }
243
	|
244
		<UNORDERED> { mySubject.setIsOrdered(false); }
245
}
246
247
*/
248
249
/* XXX: ValueSpecification -- how to parse */
250
void MultiplicityRange() :
251
{
252
	Token tLower = null;
253
	Token tUpper;
254
}
255
{
256
	<LBRACKET>
257
	(
258
		[ LOOKAHEAD(2) tLower = <INTEGER_LITERAL> <DOT> <DOT> { mySubject.setLower(parseInt(tLower)); } ] 
259
		(
260
			tUpper = <STAR> 
261
			{ 
262
				if (tLower == null){
263
					mySubject.setLower(0);
264
				}
265
				mySubject.setUpper(LiteralUnlimitedNatural.UNLIMITED); 
266
			}
267
		| 
268
			tUpper = <INTEGER_LITERAL> 
269
			{ 
270
				if (tLower == null){
271
					mySubject.setLower(parseInt(tUpper));
272
				}
273
				mySubject.setUpper(parseInt(tUpper)); 
274
			}
275
		)
276
	)
277
	<RBRACKET>
278
}
279
280
void IsDerived() :
281
{}
282
{
283
	<SLASH> { mySubject.setIsDerived(true); }
284
}
285
286
String NameWithSpaces() :
287
{
288
	StringBuffer result = new StringBuffer();
289
	Token t;
290
}
291
{
292
	(
293
		t = <IDENTIFIER> { result.append(t.image); } 
294
		( t = <IDENTIFIER> { result.append(' '); result.append(t.image); } ) *
295
	)
296
	{
297
		return result.toString();
298
	}
299
}
300
301
void SimpleTokenPropertyModifier() :
302
{}
303
{
304
	(
305
		<READ_ONLY> { mySubject.setIsReadOnly(true); }
306
	|
307
		<UNION> { mySubject.setIsDerivedUnion(true); }
308
	|
309
		<ORDERED> { mySubject.setIsOrdered(true); }
310
	|
311
		<UNORDERED> { mySubject.setIsOrdered(false); }
312
	|
313
		<UNIQUE> { mySubject.setIsUnique(true); }
314
	|
315
		<NON_UNIQUE> { mySubject.setIsUnique(false); }
316
	)
317
}
318
319
void ReferencingPropertyModifier() :
320
{
321
	String name;
322
}
323
{
324
	(
325
		<SUBSETS> name = NameWithSpaces() 
326
		{ 
327
			Property subsets = lookup(Property.class, name); 
328
			if (subsets != null) {
329
				mySubject.getSubsettedProperties().add(subsets);
330
			}
331
		}
332
	|
333
		<REDEFINES> name = NameWithSpaces() 
334
		{ 
335
			RedefinableElement redefines = lookup(RedefinableElement.class, name); 
336
			if (redefines != null) {
337
				mySubject.getRedefinedElements().add(redefines);
338
			}
339
		}
340
	)
341
}
342
343
void PropertyModifiers() :
344
{}
345
{
346
	<LCURLY> 
347
	( SimpleTokenPropertyModifier() | ReferencingPropertyModifier() )
348
	( <COMMA> ( SimpleTokenPropertyModifier() | ReferencingPropertyModifier() ) )*
349
	<RCURLY>
350
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/instance/Token.java (+92 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.instance;
14
15
/**
16
 * Describes the input token stream.
17
 */
18
19
public class Token {
20
21
  /**
22
   * An integer that describes the kind of this token.  This numbering
23
   * system is determined by JavaCCParser, and a table of these numbers is
24
   * stored in the file ...Constants.java.
25
   */
26
  public int kind;
27
28
  /**
29
   * beginLine and beginColumn describe the position of the first character
30
   * of this token; endLine and endColumn describe the position of the
31
   * last character of this token.
32
   */
33
  public int beginLine, beginColumn, endLine, endColumn;
34
35
  /**
36
   * The string image of the token.
37
   */
38
  public String image;
39
40
  /**
41
   * A reference to the next regular (non-special) token from the input
42
   * stream.  If this is the last token from the input stream, or if the
43
   * token manager has not read tokens beyond this one, this field is
44
   * set to null.  This is true only if this token is also a regular
45
   * token.  Otherwise, see below for a description of the contents of
46
   * this field.
47
   */
48
  public Token next;
49
50
  /**
51
   * This field is used to access special tokens that occur prior to this
52
   * token, but after the immediately preceding regular (non-special) token.
53
   * If there are no such special tokens, this field is set to null.
54
   * When there are more than one such special token, this field refers
55
   * to the last of these special tokens, which in turn refers to the next
56
   * previous special token through its specialToken field, and so on
57
   * until the first special token (whose specialToken field is null).
58
   * The next fields of special tokens refer to other special tokens that
59
   * immediately follow it (without an intervening regular token).  If there
60
   * is no such token, this field is null.
61
   */
62
  public Token specialToken;
63
64
  /**
65
   * Returns the image.
66
   */
67
  public String toString()
68
  {
69
     return image;
70
  }
71
72
  /**
73
   * Returns a new Token object, by default. However, if you want, you
74
   * can create and return subclass objects based on the value of ofKind.
75
   * Simply add the cases to the switch for all those special cases.
76
   * For example, if you have a subclass of Token called IDToken that
77
   * you want to create if ofKind is ID, simlpy add something like :
78
   *
79
   *    case MyParserConstants.ID : return new IDToken();
80
   *
81
   * to the following switch statement. Then you can cast matchedToken
82
   * variable to the appropriate type and use it in your lexical actions.
83
   */
84
  public static final Token newToken(int ofKind)
85
  {
86
     switch(ofKind)
87
     {
88
       default : return new Token();
89
     }
90
  }
91
92
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Property2ViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class Property2ViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Property2EditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/PropertyEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class PropertyEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PackageOtherViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class PackageOtherViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.PackageOtherEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/DependencyNameViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class DependencyNameViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(5));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/end/AssociationEndParser.java (+618 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. AssociationEndParser.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.end;
14
15
import java.io.*;
16
import org.eclipse.emf.ecore.EClass;
17
import org.eclipse.emf.ecore.EObject;
18
import org.eclipse.uml2.diagram.parser.*;
19
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
20
import org.eclipse.uml2.uml.*;
21
22
public class AssociationEndParser extends ExternalParserBase implements AssociationEndParserConstants {
23
        private Property mySubject;
24
25
    public AssociationEndParser(){
26
        this(new StringReader(""));
27
    }
28
29
    public AssociationEndParser(LookupSuite lookup){
30
        this();
31
        setLookupSuite(lookup);
32
    }
33
34
        public EClass getSubjectClass(){
35
                // though we expects the Property instance, the input object is still Association 
36
                // @see createSubjectPrototype()
37
                return UMLPackage.eINSTANCE.getAssociation();
38
        }
39
40
    public EObject createSubjectPrototype() {
41
        return UMLFactory.eINSTANCE.createProperty();
42
    }
43
44
        public void parse(EObject target, String text) throws ExternalParserException {
45
                checkContext();
46
                ReInit(new StringReader(text));
47
                mySubject = (Property)target;
48
                Declaration();
49
                mySubject = null;
50
        }
51
52
        protected static int parseInt(Token t) throws ParseException {
53
                if (t.kind != AssociationEndParserConstants.INTEGER_LITERAL){
54
                        throw new IllegalStateException("Token: " + t + ", image: " + t.image);
55
                }
56
                try {
57
                        return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
58
                } catch (NumberFormatException e){
59
                        throw new ParseException("Not supported integer value:" + t.image);
60
                }
61
        }
62
63
  final public void Declaration() throws ParseException {
64
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
65
    case PLUS:
66
    case MINUS:
67
    case NUMBER_SIGN:
68
    case TILDE:
69
      Visibility();
70
      break;
71
    default:
72
      jj_la1[0] = jj_gen;
73
      ;
74
    }
75
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
76
    case SLASH:
77
      IsDerived();
78
      break;
79
    default:
80
      jj_la1[1] = jj_gen;
81
      ;
82
    }
83
    PropertyName();
84
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
85
    case LBRACKET:
86
      Multiplicity();
87
      break;
88
    default:
89
      jj_la1[2] = jj_gen;
90
      ;
91
    }
92
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
93
    case LCURLY:
94
      PropertyModifiers();
95
      break;
96
    default:
97
      jj_la1[3] = jj_gen;
98
      ;
99
    }
100
    jj_consume_token(0);
101
  }
102
103
  final public void PropertyName() throws ParseException {
104
        String name;
105
    name = NameWithSpaces();
106
                mySubject.setName(name);
107
  }
108
109
  final public void Visibility() throws ParseException {
110
        VisibilityKind kind;
111
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
112
    case PLUS:
113
      jj_consume_token(PLUS);
114
                         kind = VisibilityKind.PUBLIC_LITERAL;
115
      break;
116
    case MINUS:
117
      jj_consume_token(MINUS);
118
                          kind = VisibilityKind.PRIVATE_LITERAL;
119
      break;
120
    case NUMBER_SIGN:
121
      jj_consume_token(NUMBER_SIGN);
122
                                kind = VisibilityKind.PROTECTED_LITERAL;
123
      break;
124
    case TILDE:
125
      jj_consume_token(TILDE);
126
                          kind = VisibilityKind.PACKAGE_LITERAL;
127
      break;
128
    default:
129
      jj_la1[4] = jj_gen;
130
      jj_consume_token(-1);
131
      throw new ParseException();
132
    }
133
                mySubject.setVisibility(kind);
134
  }
135
136
  final public void Multiplicity() throws ParseException {
137
    MultiplicityRange();
138
  }
139
140
/* XXX: Parse conflict in case of empty default value
141
void MultiplicityDesignator() :
142
{ }
143
{
144
	<LCURLY> 
145
	(
146
		( MultiplicityUnique() [ MultiplicityOrdered() ] ) 
147
		|
148
		( MultiplicityOrdered() [ MultiplicityUnique() ] ) 
149
	) 
150
	<RCURLY>
151
}
152
153
void MultiplicityUnique() :
154
{}
155
{
156
		<UNIQUE> { mySubject.setIsUnique(true); }
157
	|
158
		<NON_UNIQUE> { mySubject.setIsUnique(false); }	
159
}
160
161
void MultiplicityOrdered() :
162
{}
163
{
164
		<ORDERED> { mySubject.setIsOrdered(true); }
165
	|
166
		<UNORDERED> { mySubject.setIsOrdered(false); }
167
}
168
169
*/
170
171
/* XXX: ValueSpecification -- how to parse */
172
  final public void MultiplicityRange() throws ParseException {
173
        Token tLower = null;
174
        Token tUpper;
175
    jj_consume_token(LBRACKET);
176
    if (jj_2_1(2)) {
177
      tLower = jj_consume_token(INTEGER_LITERAL);
178
      jj_consume_token(DOT);
179
      jj_consume_token(DOT);
180
                                                                        mySubject.setLower(parseInt(tLower));
181
    } else {
182
      ;
183
    }
184
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
185
    case STAR:
186
      tUpper = jj_consume_token(STAR);
187
                                if (tLower == null){
188
                                        mySubject.setLower(0);
189
                                }
190
                                mySubject.setUpper(LiteralUnlimitedNatural.UNLIMITED);
191
      break;
192
    case INTEGER_LITERAL:
193
      tUpper = jj_consume_token(INTEGER_LITERAL);
194
                                if (tLower == null){
195
                                        mySubject.setLower(parseInt(tUpper));
196
                                }
197
                                mySubject.setUpper(parseInt(tUpper));
198
      break;
199
    default:
200
      jj_la1[5] = jj_gen;
201
      jj_consume_token(-1);
202
      throw new ParseException();
203
    }
204
    jj_consume_token(RBRACKET);
205
  }
206
207
  final public void IsDerived() throws ParseException {
208
    jj_consume_token(SLASH);
209
                  mySubject.setIsDerived(true);
210
  }
211
212
  final public String NameWithSpaces() throws ParseException {
213
        StringBuffer result = new StringBuffer();
214
        Token t;
215
    t = jj_consume_token(IDENTIFIER);
216
                                   result.append(t.image);
217
    label_1:
218
    while (true) {
219
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
220
      case IDENTIFIER:
221
        ;
222
        break;
223
      default:
224
        jj_la1[6] = jj_gen;
225
        break label_1;
226
      }
227
      t = jj_consume_token(IDENTIFIER);
228
                                     result.append(' '); result.append(t.image);
229
    }
230
                {if (true) return result.toString();}
231
    throw new Error("Missing return statement in function");
232
  }
233
234
  final public void SimpleTokenPropertyModifier() throws ParseException {
235
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
236
    case READ_ONLY:
237
      jj_consume_token(READ_ONLY);
238
                              mySubject.setIsReadOnly(true);
239
      break;
240
    case UNION:
241
      jj_consume_token(UNION);
242
                          mySubject.setIsDerivedUnion(true);
243
      break;
244
    case ORDERED:
245
      jj_consume_token(ORDERED);
246
                            mySubject.setIsOrdered(true);
247
      break;
248
    case UNORDERED:
249
      jj_consume_token(UNORDERED);
250
                              mySubject.setIsOrdered(false);
251
      break;
252
    case UNIQUE:
253
      jj_consume_token(UNIQUE);
254
                           mySubject.setIsUnique(true);
255
      break;
256
    case NON_UNIQUE:
257
      jj_consume_token(NON_UNIQUE);
258
                               mySubject.setIsUnique(false);
259
      break;
260
    default:
261
      jj_la1[7] = jj_gen;
262
      jj_consume_token(-1);
263
      throw new ParseException();
264
    }
265
  }
266
267
  final public void ReferencingPropertyModifier() throws ParseException {
268
        String name;
269
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
270
    case SUBSETS:
271
      jj_consume_token(SUBSETS);
272
      name = NameWithSpaces();
273
                        Property subsets = lookup(Property.class, name);
274
                        if (subsets != null) {
275
                                mySubject.getSubsettedProperties().add(subsets);
276
                        }
277
      break;
278
    case REDEFINES:
279
      jj_consume_token(REDEFINES);
280
      name = NameWithSpaces();
281
                        RedefinableElement redefines = lookup(RedefinableElement.class, name);
282
                        if (redefines != null) {
283
                                mySubject.getRedefinedElements().add(redefines);
284
                        }
285
      break;
286
    default:
287
      jj_la1[8] = jj_gen;
288
      jj_consume_token(-1);
289
      throw new ParseException();
290
    }
291
  }
292
293
  final public void PropertyModifiers() throws ParseException {
294
    jj_consume_token(LCURLY);
295
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
296
    case READ_ONLY:
297
    case UNION:
298
    case ORDERED:
299
    case UNORDERED:
300
    case UNIQUE:
301
    case NON_UNIQUE:
302
      SimpleTokenPropertyModifier();
303
      break;
304
    case SUBSETS:
305
    case REDEFINES:
306
      ReferencingPropertyModifier();
307
      break;
308
    default:
309
      jj_la1[9] = jj_gen;
310
      jj_consume_token(-1);
311
      throw new ParseException();
312
    }
313
    label_2:
314
    while (true) {
315
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
316
      case COMMA:
317
        ;
318
        break;
319
      default:
320
        jj_la1[10] = jj_gen;
321
        break label_2;
322
      }
323
      jj_consume_token(COMMA);
324
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
325
      case READ_ONLY:
326
      case UNION:
327
      case ORDERED:
328
      case UNORDERED:
329
      case UNIQUE:
330
      case NON_UNIQUE:
331
        SimpleTokenPropertyModifier();
332
        break;
333
      case SUBSETS:
334
      case REDEFINES:
335
        ReferencingPropertyModifier();
336
        break;
337
      default:
338
        jj_la1[11] = jj_gen;
339
        jj_consume_token(-1);
340
        throw new ParseException();
341
      }
342
    }
343
    jj_consume_token(RCURLY);
344
  }
345
346
  final private boolean jj_2_1(int xla) {
347
    jj_la = xla; jj_lastpos = jj_scanpos = token;
348
    try { return !jj_3_1(); }
349
    catch(LookaheadSuccess ls) { return true; }
350
    finally { jj_save(0, xla); }
351
  }
352
353
  final private boolean jj_3_1() {
354
    if (jj_scan_token(INTEGER_LITERAL)) return true;
355
    if (jj_scan_token(DOT)) return true;
356
    return false;
357
  }
358
359
  public AssociationEndParserTokenManager token_source;
360
  JavaCharStream jj_input_stream;
361
  public Token token, jj_nt;
362
  private int jj_ntk;
363
  private Token jj_scanpos, jj_lastpos;
364
  private int jj_la;
365
  public boolean lookingAhead = false;
366
  private boolean jj_semLA;
367
  private int jj_gen;
368
  final private int[] jj_la1 = new int[12];
369
  static private int[] jj_la1_0;
370
  static {
371
      jj_la1_0();
372
   }
373
   private static void jj_la1_0() {
374
      jj_la1_0 = new int[] {0x7800,0x8,0x40,0x100,0x7800,0x2010000,0x4000000,0x1e60000,0x180000,0x1fe0000,0x400,0x1fe0000,};
375
   }
376
  final private JJCalls[] jj_2_rtns = new JJCalls[1];
377
  private boolean jj_rescan = false;
378
  private int jj_gc = 0;
379
380
  public AssociationEndParser(java.io.InputStream stream) {
381
    jj_input_stream = new JavaCharStream(stream, 1, 1);
382
    token_source = new AssociationEndParserTokenManager(jj_input_stream);
383
    token = new Token();
384
    jj_ntk = -1;
385
    jj_gen = 0;
386
    for (int i = 0; i < 12; i++) jj_la1[i] = -1;
387
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
388
  }
389
390
  public void ReInit(java.io.InputStream stream) {
391
    jj_input_stream.ReInit(stream, 1, 1);
392
    token_source.ReInit(jj_input_stream);
393
    token = new Token();
394
    jj_ntk = -1;
395
    jj_gen = 0;
396
    for (int i = 0; i < 12; i++) jj_la1[i] = -1;
397
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
398
  }
399
400
  public AssociationEndParser(java.io.Reader stream) {
401
    jj_input_stream = new JavaCharStream(stream, 1, 1);
402
    token_source = new AssociationEndParserTokenManager(jj_input_stream);
403
    token = new Token();
404
    jj_ntk = -1;
405
    jj_gen = 0;
406
    for (int i = 0; i < 12; i++) jj_la1[i] = -1;
407
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
408
  }
409
410
  public void ReInit(java.io.Reader stream) {
411
    jj_input_stream.ReInit(stream, 1, 1);
412
    token_source.ReInit(jj_input_stream);
413
    token = new Token();
414
    jj_ntk = -1;
415
    jj_gen = 0;
416
    for (int i = 0; i < 12; i++) jj_la1[i] = -1;
417
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
418
  }
419
420
  public AssociationEndParser(AssociationEndParserTokenManager tm) {
421
    token_source = tm;
422
    token = new Token();
423
    jj_ntk = -1;
424
    jj_gen = 0;
425
    for (int i = 0; i < 12; i++) jj_la1[i] = -1;
426
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
427
  }
428
429
  public void ReInit(AssociationEndParserTokenManager tm) {
430
    token_source = tm;
431
    token = new Token();
432
    jj_ntk = -1;
433
    jj_gen = 0;
434
    for (int i = 0; i < 12; i++) jj_la1[i] = -1;
435
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
436
  }
437
438
  final private Token jj_consume_token(int kind) throws ParseException {
439
    Token oldToken;
440
    if ((oldToken = token).next != null) token = token.next;
441
    else token = token.next = token_source.getNextToken();
442
    jj_ntk = -1;
443
    if (token.kind == kind) {
444
      jj_gen++;
445
      if (++jj_gc > 100) {
446
        jj_gc = 0;
447
        for (int i = 0; i < jj_2_rtns.length; i++) {
448
          JJCalls c = jj_2_rtns[i];
449
          while (c != null) {
450
            if (c.gen < jj_gen) c.first = null;
451
            c = c.next;
452
          }
453
        }
454
      }
455
      return token;
456
    }
457
    token = oldToken;
458
    jj_kind = kind;
459
    throw generateParseException();
460
  }
461
462
  static private final class LookaheadSuccess extends java.lang.Error { }
463
  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
464
  final private boolean jj_scan_token(int kind) {
465
    if (jj_scanpos == jj_lastpos) {
466
      jj_la--;
467
      if (jj_scanpos.next == null) {
468
        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
469
      } else {
470
        jj_lastpos = jj_scanpos = jj_scanpos.next;
471
      }
472
    } else {
473
      jj_scanpos = jj_scanpos.next;
474
    }
475
    if (jj_rescan) {
476
      int i = 0; Token tok = token;
477
      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
478
      if (tok != null) jj_add_error_token(kind, i);
479
    }
480
    if (jj_scanpos.kind != kind) return true;
481
    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
482
    return false;
483
  }
484
485
  final public Token getNextToken() {
486
    if (token.next != null) token = token.next;
487
    else token = token.next = token_source.getNextToken();
488
    jj_ntk = -1;
489
    jj_gen++;
490
    return token;
491
  }
492
493
  final public Token getToken(int index) {
494
    Token t = lookingAhead ? jj_scanpos : token;
495
    for (int i = 0; i < index; i++) {
496
      if (t.next != null) t = t.next;
497
      else t = t.next = token_source.getNextToken();
498
    }
499
    return t;
500
  }
501
502
  final private int jj_ntk() {
503
    if ((jj_nt=token.next) == null)
504
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
505
    else
506
      return (jj_ntk = jj_nt.kind);
507
  }
508
509
  private java.util.Vector jj_expentries = new java.util.Vector();
510
  private int[] jj_expentry;
511
  private int jj_kind = -1;
512
  private int[] jj_lasttokens = new int[100];
513
  private int jj_endpos;
514
515
  private void jj_add_error_token(int kind, int pos) {
516
    if (pos >= 100) return;
517
    if (pos == jj_endpos + 1) {
518
      jj_lasttokens[jj_endpos++] = kind;
519
    } else if (jj_endpos != 0) {
520
      jj_expentry = new int[jj_endpos];
521
      for (int i = 0; i < jj_endpos; i++) {
522
        jj_expentry[i] = jj_lasttokens[i];
523
      }
524
      boolean exists = false;
525
      for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
526
        int[] oldentry = (int[])(e.nextElement());
527
        if (oldentry.length == jj_expentry.length) {
528
          exists = true;
529
          for (int i = 0; i < jj_expentry.length; i++) {
530
            if (oldentry[i] != jj_expentry[i]) {
531
              exists = false;
532
              break;
533
            }
534
          }
535
          if (exists) break;
536
        }
537
      }
538
      if (!exists) jj_expentries.addElement(jj_expentry);
539
      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
540
    }
541
  }
542
543
  public ParseException generateParseException() {
544
    jj_expentries.removeAllElements();
545
    boolean[] la1tokens = new boolean[29];
546
    for (int i = 0; i < 29; i++) {
547
      la1tokens[i] = false;
548
    }
549
    if (jj_kind >= 0) {
550
      la1tokens[jj_kind] = true;
551
      jj_kind = -1;
552
    }
553
    for (int i = 0; i < 12; i++) {
554
      if (jj_la1[i] == jj_gen) {
555
        for (int j = 0; j < 32; j++) {
556
          if ((jj_la1_0[i] & (1<<j)) != 0) {
557
            la1tokens[j] = true;
558
          }
559
        }
560
      }
561
    }
562
    for (int i = 0; i < 29; i++) {
563
      if (la1tokens[i]) {
564
        jj_expentry = new int[1];
565
        jj_expentry[0] = i;
566
        jj_expentries.addElement(jj_expentry);
567
      }
568
    }
569
    jj_endpos = 0;
570
    jj_rescan_token();
571
    jj_add_error_token(0, 0);
572
    int[][] exptokseq = new int[jj_expentries.size()][];
573
    for (int i = 0; i < jj_expentries.size(); i++) {
574
      exptokseq[i] = (int[])jj_expentries.elementAt(i);
575
    }
576
    return new ParseException(token, exptokseq, tokenImage);
577
  }
578
579
  final public void enable_tracing() {
580
  }
581
582
  final public void disable_tracing() {
583
  }
584
585
  final private void jj_rescan_token() {
586
    jj_rescan = true;
587
    for (int i = 0; i < 1; i++) {
588
      JJCalls p = jj_2_rtns[i];
589
      do {
590
        if (p.gen > jj_gen) {
591
          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
592
          switch (i) {
593
            case 0: jj_3_1(); break;
594
          }
595
        }
596
        p = p.next;
597
      } while (p != null);
598
    }
599
    jj_rescan = false;
600
  }
601
602
  final private void jj_save(int index, int xla) {
603
    JJCalls p = jj_2_rtns[index];
604
    while (p.gen > jj_gen) {
605
      if (p.next == null) { p = p.next = new JJCalls(); break; }
606
      p = p.next;
607
    }
608
    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
609
  }
610
611
  static final class JJCalls {
612
    int gen;
613
    Token first;
614
    int arg;
615
    JJCalls next;
616
  }
617
618
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationViewFactory.java (+62 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName2EditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName3EditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName4EditPart;
16
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName5EditPart;
17
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName6EditPart;
18
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName7EditPart;
19
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationNameEditPart;
20
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
21
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
22
23
/**
24
 * @generated
25
 */
26
public class AssociationViewFactory extends ConnectionViewFactory {
27
28
	/**
29
	 * @generated 
30
	 */
31
	protected List createStyles(View view) {
32
		List styles = new ArrayList();
33
		styles.add(NotationFactory.eINSTANCE.createRoutingStyle());
34
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
35
		return styles;
36
	}
37
38
	/**
39
	 * @generated
40
	 */
41
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
42
		if (semanticHint == null) {
43
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.AssociationEditPart.VISUAL_ID);
44
			view.setType(semanticHint);
45
		}
46
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
47
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
48
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
49
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
50
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
51
			view.getEAnnotations().add(shortcutAnnotation);
52
		}
53
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(AssociationNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
54
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(AssociationName2EditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
55
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(AssociationName3EditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
56
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(AssociationName4EditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
57
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(AssociationName5EditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
58
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(AssociationName6EditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
59
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(AssociationName7EditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
60
	}
61
62
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/end/AssociationEndApplyStrategy.java (+39 lines)
Added Link Here
1
/*
2
 * Copyright (c) 2006 Borland Software Corporation
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    Michael Golubev (Borland) - initial API and implementation
11
 */
12
13
package org.eclipse.uml2.diagram.clazz.parser.association.end;
14
15
import java.util.List;
16
17
import org.eclipse.emf.ecore.EObject;
18
import org.eclipse.uml2.diagram.clazz.association.AssociationEndConvention;
19
import org.eclipse.uml2.diagram.parser.BasicApplyStrategy;
20
import org.eclipse.uml2.uml.Association;
21
22
public class AssociationEndApplyStrategy extends BasicApplyStrategy {
23
	private final boolean mySourceNotTarget;
24
25
	public AssociationEndApplyStrategy(boolean sourceNotTarget){
26
		mySourceNotTarget = sourceNotTarget;
27
	}
28
	
29
	@Override
30
	public List apply(EObject modelObject, EObject parsedObject) {
31
		if (false == modelObject instanceof Association){
32
			throw new IllegalStateException("Can not apply, association expected: " + modelObject);
33
		}
34
		Association association = (Association)modelObject;
35
		EObject end = AssociationEndConvention.getMemberEnd(association, mySourceNotTarget);
36
		return super.apply(end, parsedObject);
37
	}
38
39
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/operation/OperationParser.java (+869 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. OperationParser.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.operation;
14
15
import java.io.*;
16
import org.eclipse.emf.ecore.EClass;
17
import org.eclipse.emf.ecore.EObject;
18
import org.eclipse.uml2.diagram.parser.*;
19
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
20
import org.eclipse.uml2.uml.*;
21
22
/**
23
 * JavaCC does not support any "include" construct. 
24
 * This parser shares a lot of delcrations (mainly at the tokens level) 
25
 * with other parsers (see PropertyParser, etc)
26
 * but we do not yet know how to avoid duplication of the delarations. 
27
 */
28
public class OperationParser extends ExternalParserBase implements OperationParserConstants {
29
        private OperationAdapter myOperation;
30
        private ParameterAdapter myCurrentParameter;
31
32
        private static interface TypeGate {
33
                public void setType(Type type);
34
                public void setName(String name);
35
        }
36
37
        private static interface MultiplicityGate {
38
                public void setIsOrdered(boolean ordered);
39
                public void setIsUnique(boolean unique);
40
                public void setLower(int lower);
41
                public void setUpper(int upper);
42
        }
43
44
        private static class ParameterAdapter implements TypeGate, MultiplicityGate {
45
                private final Parameter myParameter;
46
47
                public ParameterAdapter(){
48
                        myParameter = UMLFactory.eINSTANCE.createParameter();
49
                }
50
51
                public Parameter getParameter(){
52
                        return myParameter;
53
                }
54
55
                public void setType(Type type){
56
                        myParameter.setType(type);
57
                }
58
59
                public void setName(String name){
60
                        myParameter.setName(name);
61
                }
62
63
                public void setIsOrdered(boolean value) {
64
                        myParameter.setIsOrdered(value);
65
                }
66
67
                public void setIsUnique(boolean value) {
68
                        myParameter.setIsUnique(value);
69
                }
70
71
                public void setLower(int value) {
72
                        myParameter.setLower(value);
73
                }
74
75
                public void setUpper(int value) {
76
                        myParameter.setUpper(value);
77
                }
78
        }
79
80
        private static class OperationAdapter implements TypeGate, MultiplicityGate {
81
                private final Operation myOperation;
82
83
                public OperationAdapter(Operation operation){
84
                        myOperation = operation;
85
                        if (myOperation.getReturnResult() == null){
86
                                myOperation.createReturnResult(null, null);
87
                        }
88
                }
89
90
                public Operation getOperation(){
91
                        return myOperation;
92
                }
93
94
                public void setType(Type type) {
95
                        myOperation.setType(type);
96
                }
97
98
                public void setName(String name){
99
                        myOperation.setName(name);
100
                }
101
102
                public void setIsOrdered(boolean ordered) {
103
                        myOperation.setIsOrdered(ordered);
104
                }
105
106
                public void setIsUnique(boolean value) {
107
                        myOperation.setIsUnique(value);
108
                }
109
110
                public void setLower(int value) {
111
                        myOperation.setLower(value);
112
                }
113
114
                public void setUpper(int value) {
115
                        myOperation.setUpper(value);
116
                }
117
118
        }
119
120
    public OperationParser(){
121
        this(new StringReader(""));
122
    }
123
124
    public OperationParser(LookupSuite lookup){
125
        this();
126
        setLookupSuite(lookup);
127
    }
128
129
        public EClass getSubjectClass(){
130
                return UMLPackage.eINSTANCE.getOperation();
131
        }
132
133
        public void parse(EObject target, String text) throws ExternalParserException {
134
                checkContext();
135
                ReInit(new StringReader(text));
136
                myOperation = new OperationAdapter((Operation)target);
137
                myCurrentParameter = null;
138
                Declaration();
139
                myOperation = null;
140
        }
141
142
        protected static int parseInt(Token t) throws ParseException {
143
                if (t.kind != OperationParserConstants.INTEGER_LITERAL){
144
                        throw new IllegalStateException("Token: " + t + ", image: " + t.image);
145
                }
146
                try {
147
                        return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
148
                } catch (NumberFormatException e){
149
                        throw new ParseException("Not supported integer value:" + t.image);
150
                }
151
        }
152
153
        private MultiplicityGate getCurrentMultiplicityElement(){
154
                return myCurrentParameter != null ? myCurrentParameter : (MultiplicityGate)myOperation;
155
        }
156
157
        private TypeGate getCurrentTypedElement(){
158
                return myCurrentParameter != null ? myCurrentParameter : (TypeGate)myOperation;
159
        }
160
161
        private Operation getOperation(){
162
                return myOperation.getOperation();
163
        }
164
165
        private Parameter getCurrentParameter(){
166
                if (myCurrentParameter == null){
167
                        throw new IllegalStateException("We are not in the parameter list. Check BNF");
168
                }
169
                return myCurrentParameter.getParameter();
170
        }
171
172
        private void registerParameter() {
173
                getOperation().getOwnedParameters().add(getCurrentParameter());
174
                myCurrentParameter = null;
175
        }
176
177
        private void startParameter() {
178
                myCurrentParameter = new ParameterAdapter();
179
        }
180
181
  final public void Declaration() throws ParseException {
182
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
183
    case PLUS:
184
    case MINUS:
185
    case NUMBER_SIGN:
186
    case TILDE:
187
      Visibility();
188
      break;
189
    default:
190
      jj_la1[0] = jj_gen;
191
      ;
192
    }
193
    Name();
194
    jj_consume_token(LPAREN);
195
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
196
    case IN:
197
    case OUT:
198
    case IN_OUT:
199
    case IDENTIFIER:
200
      ParametersList();
201
      break;
202
    default:
203
      jj_la1[1] = jj_gen;
204
      ;
205
    }
206
    jj_consume_token(RPAREN);
207
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
208
    case COLON:
209
      Type();
210
      break;
211
    default:
212
      jj_la1[2] = jj_gen;
213
      ;
214
    }
215
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
216
    case LCURLY:
217
      OperationModifiers();
218
      break;
219
    default:
220
      jj_la1[3] = jj_gen;
221
      ;
222
    }
223
    jj_consume_token(0);
224
  }
225
226
  final public void ParametersList() throws ParseException {
227
    Parameter();
228
    label_1:
229
    while (true) {
230
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
231
      case COMMA:
232
        ;
233
        break;
234
      default:
235
        jj_la1[4] = jj_gen;
236
        break label_1;
237
      }
238
      jj_consume_token(COMMA);
239
      Parameter();
240
    }
241
  }
242
243
  final public void Parameter() throws ParseException {
244
        startParameter();
245
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
246
    case IN:
247
    case OUT:
248
    case IN_OUT:
249
      ParameterDirection();
250
      break;
251
    default:
252
      jj_la1[5] = jj_gen;
253
      ;
254
    }
255
    Name();
256
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
257
    case COLON:
258
      Type();
259
      break;
260
    default:
261
      jj_la1[6] = jj_gen;
262
      ;
263
    }
264
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
265
    case LBRACKET:
266
      Multiplicity();
267
      break;
268
    default:
269
      jj_la1[7] = jj_gen;
270
      ;
271
    }
272
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
273
    case EQUALS:
274
      DefaultValue();
275
      break;
276
    default:
277
      jj_la1[8] = jj_gen;
278
      ;
279
    }
280
                registerParameter();
281
  }
282
283
  final public void ParameterDirection() throws ParseException {
284
        ParameterDirectionKind kind;
285
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
286
    case IN:
287
      jj_consume_token(IN);
288
                       kind = ParameterDirectionKind.IN_LITERAL;
289
      break;
290
    case OUT:
291
      jj_consume_token(OUT);
292
                        kind = ParameterDirectionKind.OUT_LITERAL;
293
      break;
294
    case IN_OUT:
295
      jj_consume_token(IN_OUT);
296
                           kind = ParameterDirectionKind.INOUT_LITERAL;
297
      break;
298
    default:
299
      jj_la1[9] = jj_gen;
300
      jj_consume_token(-1);
301
      throw new ParseException();
302
    }
303
                getCurrentParameter().setDirection(kind);
304
  }
305
306
  final public void Visibility() throws ParseException {
307
        VisibilityKind kind;
308
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
309
    case PLUS:
310
      jj_consume_token(PLUS);
311
                         kind = VisibilityKind.PUBLIC_LITERAL;
312
      break;
313
    case MINUS:
314
      jj_consume_token(MINUS);
315
                          kind = VisibilityKind.PRIVATE_LITERAL;
316
      break;
317
    case NUMBER_SIGN:
318
      jj_consume_token(NUMBER_SIGN);
319
                                kind = VisibilityKind.PROTECTED_LITERAL;
320
      break;
321
    case TILDE:
322
      jj_consume_token(TILDE);
323
                          kind = VisibilityKind.PACKAGE_LITERAL;
324
      break;
325
    default:
326
      jj_la1[10] = jj_gen;
327
      jj_consume_token(-1);
328
      throw new ParseException();
329
    }
330
                getOperation().setVisibility(kind);
331
  }
332
333
  final public void Name() throws ParseException {
334
        String name;
335
    name = NameWithSpaces();
336
                getCurrentTypedElement().setName(name);
337
  }
338
339
  final public void Multiplicity() throws ParseException {
340
    MultiplicityRange();
341
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
342
    case LCURLY:
343
      MultiplicityDesignator();
344
      break;
345
    default:
346
      jj_la1[11] = jj_gen;
347
      ;
348
    }
349
  }
350
351
  final public void MultiplicityDesignator() throws ParseException {
352
    jj_consume_token(LCURLY);
353
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
354
    case UNIQUE:
355
    case NON_UNIQUE:
356
      MultiplicityUnique();
357
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
358
      case ORDERED:
359
      case UNORDERED:
360
        MultiplicityOrdered();
361
        break;
362
      default:
363
        jj_la1[12] = jj_gen;
364
        ;
365
      }
366
      break;
367
    case ORDERED:
368
    case UNORDERED:
369
      MultiplicityOrdered();
370
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
371
      case UNIQUE:
372
      case NON_UNIQUE:
373
        MultiplicityUnique();
374
        break;
375
      default:
376
        jj_la1[13] = jj_gen;
377
        ;
378
      }
379
      break;
380
    default:
381
      jj_la1[14] = jj_gen;
382
      jj_consume_token(-1);
383
      throw new ParseException();
384
    }
385
    jj_consume_token(RCURLY);
386
  }
387
388
  final public void MultiplicityUnique() throws ParseException {
389
        MultiplicityGate multiplicity = getCurrentMultiplicityElement();
390
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
391
    case UNIQUE:
392
      jj_consume_token(UNIQUE);
393
                           multiplicity.setIsUnique(true);
394
      break;
395
    case NON_UNIQUE:
396
      jj_consume_token(NON_UNIQUE);
397
                               multiplicity.setIsUnique(false);
398
      break;
399
    default:
400
      jj_la1[15] = jj_gen;
401
      jj_consume_token(-1);
402
      throw new ParseException();
403
    }
404
  }
405
406
  final public void MultiplicityOrdered() throws ParseException {
407
        MultiplicityGate multiplicity = getCurrentMultiplicityElement();
408
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
409
    case ORDERED:
410
      jj_consume_token(ORDERED);
411
                            multiplicity.setIsOrdered(true);
412
      break;
413
    case UNORDERED:
414
      jj_consume_token(UNORDERED);
415
                              multiplicity.setIsOrdered(false);
416
      break;
417
    default:
418
      jj_la1[16] = jj_gen;
419
      jj_consume_token(-1);
420
      throw new ParseException();
421
    }
422
  }
423
424
/* XXX: ValueSpecification -- how to parse */
425
  final public void MultiplicityRange() throws ParseException {
426
        Token tLower = null;
427
        Token tUpper;
428
        MultiplicityGate multiplicity = getCurrentMultiplicityElement();
429
    jj_consume_token(LBRACKET);
430
    if (jj_2_1(2)) {
431
      tLower = jj_consume_token(INTEGER_LITERAL);
432
      jj_consume_token(DOT);
433
      jj_consume_token(DOT);
434
                                                                        multiplicity.setLower(parseInt(tLower));
435
    } else {
436
      ;
437
    }
438
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
439
    case STAR:
440
      tUpper = jj_consume_token(STAR);
441
                                if (tLower == null){
442
                                        multiplicity.setLower(0);
443
                                }
444
                                multiplicity.setUpper(LiteralUnlimitedNatural.UNLIMITED);
445
      break;
446
    case INTEGER_LITERAL:
447
      tUpper = jj_consume_token(INTEGER_LITERAL);
448
                                if (tLower == null){
449
                                        multiplicity.setLower(parseInt(tUpper));
450
                                }
451
                                multiplicity.setUpper(parseInt(tUpper));
452
      break;
453
    default:
454
      jj_la1[17] = jj_gen;
455
      jj_consume_token(-1);
456
      throw new ParseException();
457
    }
458
    jj_consume_token(RBRACKET);
459
  }
460
461
  final public void Type() throws ParseException {
462
        String type;
463
    jj_consume_token(COLON);
464
    type = NameWithSpaces();
465
                                          getCurrentTypedElement().setType(lookup(Type.class, type));
466
  }
467
468
  final public String NameWithSpaces() throws ParseException {
469
        StringBuffer result = new StringBuffer();
470
        Token t;
471
    t = jj_consume_token(IDENTIFIER);
472
                                   result.append(t.image);
473
    label_2:
474
    while (true) {
475
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
476
      case IDENTIFIER:
477
        ;
478
        break;
479
      default:
480
        jj_la1[18] = jj_gen;
481
        break label_2;
482
      }
483
      t = jj_consume_token(IDENTIFIER);
484
                                     result.append(' '); result.append(t.image);
485
    }
486
                {if (true) return result.toString();}
487
    throw new Error("Missing return statement in function");
488
  }
489
490
  final public void DefaultValue() throws ParseException {
491
        Token t;
492
    jj_consume_token(EQUALS);
493
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
494
    case IDENTIFIER:
495
      t = jj_consume_token(IDENTIFIER);
496
      break;
497
    case INTEGER_LITERAL:
498
      t = jj_consume_token(INTEGER_LITERAL);
499
500
      break;
501
    default:
502
      jj_la1[19] = jj_gen;
503
      jj_consume_token(-1);
504
      throw new ParseException();
505
    }
506
                getCurrentParameter().setDefault(t.image);
507
  }
508
509
  final public void SimpleTokenPropertyModifier() throws ParseException {
510
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
511
    case QUERY:
512
      jj_consume_token(QUERY);
513
                          getOperation().setIsQuery(true);
514
      break;
515
    case ORDERED:
516
      jj_consume_token(ORDERED);
517
                            getOperation().setIsOrdered(true);
518
      break;
519
    case UNORDERED:
520
      jj_consume_token(UNORDERED);
521
                              getOperation().setIsOrdered(false);
522
      break;
523
    case UNIQUE:
524
      jj_consume_token(UNIQUE);
525
                           getOperation().setIsUnique(true);
526
      break;
527
    case NON_UNIQUE:
528
      jj_consume_token(NON_UNIQUE);
529
                               getOperation().setIsUnique(false);
530
      break;
531
    default:
532
      jj_la1[20] = jj_gen;
533
      jj_consume_token(-1);
534
      throw new ParseException();
535
    }
536
  }
537
538
  final public void ReferencingPropertyModifier() throws ParseException {
539
        String name;
540
    jj_consume_token(REDEFINES);
541
    name = NameWithSpaces();
542
                RedefinableElement redefines = lookup(RedefinableElement.class, name);
543
                if (redefines != null) {
544
                        getOperation().getRedefinedElements().add(redefines);
545
                }
546
  }
547
548
  final public void OperationModifiers() throws ParseException {
549
    jj_consume_token(LCURLY);
550
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
551
    case ORDERED:
552
    case UNORDERED:
553
    case UNIQUE:
554
    case NON_UNIQUE:
555
    case QUERY:
556
      SimpleTokenPropertyModifier();
557
      break;
558
    case REDEFINES:
559
      ReferencingPropertyModifier();
560
      break;
561
    default:
562
      jj_la1[21] = jj_gen;
563
      jj_consume_token(-1);
564
      throw new ParseException();
565
    }
566
    label_3:
567
    while (true) {
568
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
569
      case COMMA:
570
        ;
571
        break;
572
      default:
573
        jj_la1[22] = jj_gen;
574
        break label_3;
575
      }
576
      jj_consume_token(COMMA);
577
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
578
      case ORDERED:
579
      case UNORDERED:
580
      case UNIQUE:
581
      case NON_UNIQUE:
582
      case QUERY:
583
        SimpleTokenPropertyModifier();
584
        break;
585
      case REDEFINES:
586
        ReferencingPropertyModifier();
587
        break;
588
      default:
589
        jj_la1[23] = jj_gen;
590
        jj_consume_token(-1);
591
        throw new ParseException();
592
      }
593
    }
594
    jj_consume_token(RCURLY);
595
  }
596
597
  final private boolean jj_2_1(int xla) {
598
    jj_la = xla; jj_lastpos = jj_scanpos = token;
599
    try { return !jj_3_1(); }
600
    catch(LookaheadSuccess ls) { return true; }
601
    finally { jj_save(0, xla); }
602
  }
603
604
  final private boolean jj_3_1() {
605
    if (jj_scan_token(INTEGER_LITERAL)) return true;
606
    if (jj_scan_token(DOT)) return true;
607
    return false;
608
  }
609
610
  public OperationParserTokenManager token_source;
611
  JavaCharStream jj_input_stream;
612
  public Token token, jj_nt;
613
  private int jj_ntk;
614
  private Token jj_scanpos, jj_lastpos;
615
  private int jj_la;
616
  public boolean lookingAhead = false;
617
  private boolean jj_semLA;
618
  private int jj_gen;
619
  final private int[] jj_la1 = new int[24];
620
  static private int[] jj_la1_0;
621
  static {
622
      jj_la1_0();
623
   }
624
   private static void jj_la1_0() {
625
      jj_la1_0 = new int[] {0x1e000,0x2e000000,0x10,0x100,0x1000,0xe000000,0x10,0x40,0x20,0xe000000,0x1e000,0x100,0x300000,0xc00000,0xf00000,0xc00000,0x300000,0x10040000,0x20000000,0x30000000,0x1f00000,0x1f80000,0x1000,0x1f80000,};
626
   }
627
  final private JJCalls[] jj_2_rtns = new JJCalls[1];
628
  private boolean jj_rescan = false;
629
  private int jj_gc = 0;
630
631
  public OperationParser(java.io.InputStream stream) {
632
    jj_input_stream = new JavaCharStream(stream, 1, 1);
633
    token_source = new OperationParserTokenManager(jj_input_stream);
634
    token = new Token();
635
    jj_ntk = -1;
636
    jj_gen = 0;
637
    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
638
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
639
  }
640
641
  public void ReInit(java.io.InputStream stream) {
642
    jj_input_stream.ReInit(stream, 1, 1);
643
    token_source.ReInit(jj_input_stream);
644
    token = new Token();
645
    jj_ntk = -1;
646
    jj_gen = 0;
647
    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
648
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
649
  }
650
651
  public OperationParser(java.io.Reader stream) {
652
    jj_input_stream = new JavaCharStream(stream, 1, 1);
653
    token_source = new OperationParserTokenManager(jj_input_stream);
654
    token = new Token();
655
    jj_ntk = -1;
656
    jj_gen = 0;
657
    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
658
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
659
  }
660
661
  public void ReInit(java.io.Reader stream) {
662
    jj_input_stream.ReInit(stream, 1, 1);
663
    token_source.ReInit(jj_input_stream);
664
    token = new Token();
665
    jj_ntk = -1;
666
    jj_gen = 0;
667
    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
668
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
669
  }
670
671
  public OperationParser(OperationParserTokenManager tm) {
672
    token_source = tm;
673
    token = new Token();
674
    jj_ntk = -1;
675
    jj_gen = 0;
676
    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
677
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
678
  }
679
680
  public void ReInit(OperationParserTokenManager tm) {
681
    token_source = tm;
682
    token = new Token();
683
    jj_ntk = -1;
684
    jj_gen = 0;
685
    for (int i = 0; i < 24; i++) jj_la1[i] = -1;
686
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
687
  }
688
689
  final private Token jj_consume_token(int kind) throws ParseException {
690
    Token oldToken;
691
    if ((oldToken = token).next != null) token = token.next;
692
    else token = token.next = token_source.getNextToken();
693
    jj_ntk = -1;
694
    if (token.kind == kind) {
695
      jj_gen++;
696
      if (++jj_gc > 100) {
697
        jj_gc = 0;
698
        for (int i = 0; i < jj_2_rtns.length; i++) {
699
          JJCalls c = jj_2_rtns[i];
700
          while (c != null) {
701
            if (c.gen < jj_gen) c.first = null;
702
            c = c.next;
703
          }
704
        }
705
      }
706
      return token;
707
    }
708
    token = oldToken;
709
    jj_kind = kind;
710
    throw generateParseException();
711
  }
712
713
  static private final class LookaheadSuccess extends java.lang.Error { }
714
  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
715
  final private boolean jj_scan_token(int kind) {
716
    if (jj_scanpos == jj_lastpos) {
717
      jj_la--;
718
      if (jj_scanpos.next == null) {
719
        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
720
      } else {
721
        jj_lastpos = jj_scanpos = jj_scanpos.next;
722
      }
723
    } else {
724
      jj_scanpos = jj_scanpos.next;
725
    }
726
    if (jj_rescan) {
727
      int i = 0; Token tok = token;
728
      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
729
      if (tok != null) jj_add_error_token(kind, i);
730
    }
731
    if (jj_scanpos.kind != kind) return true;
732
    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
733
    return false;
734
  }
735
736
  final public Token getNextToken() {
737
    if (token.next != null) token = token.next;
738
    else token = token.next = token_source.getNextToken();
739
    jj_ntk = -1;
740
    jj_gen++;
741
    return token;
742
  }
743
744
  final public Token getToken(int index) {
745
    Token t = lookingAhead ? jj_scanpos : token;
746
    for (int i = 0; i < index; i++) {
747
      if (t.next != null) t = t.next;
748
      else t = t.next = token_source.getNextToken();
749
    }
750
    return t;
751
  }
752
753
  final private int jj_ntk() {
754
    if ((jj_nt=token.next) == null)
755
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
756
    else
757
      return (jj_ntk = jj_nt.kind);
758
  }
759
760
  private java.util.Vector jj_expentries = new java.util.Vector();
761
  private int[] jj_expentry;
762
  private int jj_kind = -1;
763
  private int[] jj_lasttokens = new int[100];
764
  private int jj_endpos;
765
766
  private void jj_add_error_token(int kind, int pos) {
767
    if (pos >= 100) return;
768
    if (pos == jj_endpos + 1) {
769
      jj_lasttokens[jj_endpos++] = kind;
770
    } else if (jj_endpos != 0) {
771
      jj_expentry = new int[jj_endpos];
772
      for (int i = 0; i < jj_endpos; i++) {
773
        jj_expentry[i] = jj_lasttokens[i];
774
      }
775
      boolean exists = false;
776
      for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
777
        int[] oldentry = (int[])(e.nextElement());
778
        if (oldentry.length == jj_expentry.length) {
779
          exists = true;
780
          for (int i = 0; i < jj_expentry.length; i++) {
781
            if (oldentry[i] != jj_expentry[i]) {
782
              exists = false;
783
              break;
784
            }
785
          }
786
          if (exists) break;
787
        }
788
      }
789
      if (!exists) jj_expentries.addElement(jj_expentry);
790
      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
791
    }
792
  }
793
794
  public ParseException generateParseException() {
795
    jj_expentries.removeAllElements();
796
    boolean[] la1tokens = new boolean[32];
797
    for (int i = 0; i < 32; i++) {
798
      la1tokens[i] = false;
799
    }
800
    if (jj_kind >= 0) {
801
      la1tokens[jj_kind] = true;
802
      jj_kind = -1;
803
    }
804
    for (int i = 0; i < 24; i++) {
805
      if (jj_la1[i] == jj_gen) {
806
        for (int j = 0; j < 32; j++) {
807
          if ((jj_la1_0[i] & (1<<j)) != 0) {
808
            la1tokens[j] = true;
809
          }
810
        }
811
      }
812
    }
813
    for (int i = 0; i < 32; i++) {
814
      if (la1tokens[i]) {
815
        jj_expentry = new int[1];
816
        jj_expentry[0] = i;
817
        jj_expentries.addElement(jj_expentry);
818
      }
819
    }
820
    jj_endpos = 0;
821
    jj_rescan_token();
822
    jj_add_error_token(0, 0);
823
    int[][] exptokseq = new int[jj_expentries.size()][];
824
    for (int i = 0; i < jj_expentries.size(); i++) {
825
      exptokseq[i] = (int[])jj_expentries.elementAt(i);
826
    }
827
    return new ParseException(token, exptokseq, tokenImage);
828
  }
829
830
  final public void enable_tracing() {
831
  }
832
833
  final public void disable_tracing() {
834
  }
835
836
  final private void jj_rescan_token() {
837
    jj_rescan = true;
838
    for (int i = 0; i < 1; i++) {
839
      JJCalls p = jj_2_rtns[i];
840
      do {
841
        if (p.gen > jj_gen) {
842
          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
843
          switch (i) {
844
            case 0: jj_3_1(); break;
845
          }
846
        }
847
        p = p.next;
848
      } while (p != null);
849
    }
850
    jj_rescan = false;
851
  }
852
853
  final private void jj_save(int index, int xla) {
854
    JJCalls p = jj_2_rtns[index];
855
    while (p.gen > jj_gen) {
856
      if (p.next == null) { p = p.next = new JJCalls(); break; }
857
      p = p.next;
858
    }
859
    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
860
  }
861
862
  static final class JJCalls {
863
    int gen;
864
    Token first;
865
    int arg;
866
    JJCalls next;
867
  }
868
869
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Operation2ViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class Operation2ViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Operation2EditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)META-INF/MANIFEST.MF (+48 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %pluginName
4
Bundle-SymbolicName: org.eclipse.uml2.diagram.clazz; singleton:=true
5
Bundle-Version: 1.0.0.qualifier
6
Bundle-ClassPath: .
7
Bundle-Activator: org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin
8
Bundle-Vendor: %providerName
9
Bundle-Localization: plugin
10
Export-Package: org.eclipse.uml2.diagram.clazz.edit.parts,
11
 org.eclipse.uml2.diagram.clazz.parser.operation;x-friends:="org.eclipse.uml2.diagram.clazz.test",
12
 org.eclipse.uml2.diagram.clazz.parser.property;x-friends:="org.eclipse.uml2.diagram.clazz.test",
13
 org.eclipse.uml2.diagram.clazz.part,
14
 org.eclipse.uml2.diagram.clazz.providers
15
Require-Bundle: org.eclipse.core.runtime,
16
 org.eclipse.core.resources,
17
 org.eclipse.jface,
18
 org.eclipse.ui.ide,
19
 org.eclipse.ui.views,
20
 org.eclipse.ui.workbench,
21
 org.eclipse.ui.workbench.texteditor,
22
 org.eclipse.ui.navigator,
23
 org.eclipse.emf.ecore,
24
 org.eclipse.emf.ecore.xmi,
25
 org.eclipse.emf.edit.ui,
26
 org.eclipse.gef;visibility:=reexport,
27
 org.eclipse.gmf.runtime.emf.core,
28
 org.eclipse.gmf.runtime.emf.commands.core,
29
 org.eclipse.gmf.runtime.emf.ui.properties,
30
 org.eclipse.gmf.runtime.diagram.ui,
31
 org.eclipse.gmf.runtime.diagram.ui.properties,
32
 org.eclipse.gmf.runtime.diagram.ui.providers,
33
 org.eclipse.gmf.runtime.diagram.ui.providers.ide,
34
 org.eclipse.gmf.runtime.diagram.ui.render,
35
 org.eclipse.gmf.runtime.diagram.ui.resources.editor,
36
 org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
37
 org.eclipse.gmf.runtime.notation.providers,
38
 org.eclipse.uml2.uml;visibility:=reexport,
39
 org.eclipse.uml2.uml.edit;visibility:=reexport,
40
 org.eclipse.emf.ecore;visibility:=reexport,
41
 org.eclipse.emf.ecore.edit;visibility:=reexport,
42
 org.eclipse.emf.query.ocl;visibility:=reexport,
43
 org.eclipse.emf.ocl;visibility:=reexport,
44
 org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport,
45
 org.eclipse.draw2d;visibility:=reexport,
46
 org.eclipse.uml2.diagram.common;visibility:=reexport,
47
 org.eclipse.uml2.diagram.parser
48
Eclipse-LazyStart: true
(-)src/org/eclipse/uml2/diagram/clazz/providers/UMLViewProvider.java (+401 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.providers;
2
3
import org.eclipse.core.runtime.IAdaptable;
4
import org.eclipse.emf.ecore.EClass;
5
import org.eclipse.emf.ecore.EObject;
6
import org.eclipse.gmf.runtime.diagram.core.providers.AbstractViewProvider;
7
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
8
import org.eclipse.gmf.runtime.notation.View;
9
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClass2EditPart;
10
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassAttributesEditPart;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassClassesEditPart;
12
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassEditPart;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassNameEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassOperationsEditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationEditPart;
16
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName2EditPart;
17
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName3EditPart;
18
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName4EditPart;
19
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName5EditPart;
20
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName6EditPart;
21
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName7EditPart;
22
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationNameEditPart;
23
import org.eclipse.uml2.diagram.clazz.edit.parts.Class2EditPart;
24
import org.eclipse.uml2.diagram.clazz.edit.parts.Class3EditPart;
25
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassAttributesEditPart;
26
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassClassesEditPart;
27
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassEditPart;
28
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassNameEditPart;
29
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassOperationsEditPart;
30
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintCompartmentEditPart;
31
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintEditPart;
32
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintNameEditPart;
33
import org.eclipse.uml2.diagram.clazz.edit.parts.DataType2EditPart;
34
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeAttributesEditPart;
35
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeEditPart;
36
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeNameEditPart;
37
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeOperationsEditPart;
38
import org.eclipse.uml2.diagram.clazz.edit.parts.Dependency2EditPart;
39
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyEditPart;
40
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyName2EditPart;
41
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyNameEditPart;
42
import org.eclipse.uml2.diagram.clazz.edit.parts.Enumeration2EditPart;
43
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationAttributesEditPart;
44
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationEditPart;
45
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationLiteralEditPart;
46
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationLiteralsEditPart;
47
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationNameEditPart;
48
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationOperationsEditPart;
49
import org.eclipse.uml2.diagram.clazz.edit.parts.GeneralizationEditPart;
50
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecification2EditPart;
51
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationEditPart;
52
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationNameEditPart;
53
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationSlotsEditPart;
54
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceEditPart;
55
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceNameEditPart;
56
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceRealizationEditPart;
57
import org.eclipse.uml2.diagram.clazz.edit.parts.LiteralStringEditPart;
58
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation2EditPart;
59
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation3EditPart;
60
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation4EditPart;
61
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation5EditPart;
62
import org.eclipse.uml2.diagram.clazz.edit.parts.OperationEditPart;
63
import org.eclipse.uml2.diagram.clazz.edit.parts.Package2EditPart;
64
import org.eclipse.uml2.diagram.clazz.edit.parts.Package3EditPart;
65
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageClassifiersEditPart;
66
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
67
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageNameEditPart;
68
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageOtherEditPart;
69
import org.eclipse.uml2.diagram.clazz.edit.parts.PackagePackagesEditPart;
70
import org.eclipse.uml2.diagram.clazz.edit.parts.PortEditPart;
71
import org.eclipse.uml2.diagram.clazz.edit.parts.PortNameEditPart;
72
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveType2EditPart;
73
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeAttributesEditPart;
74
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeEditPart;
75
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeNameEditPart;
76
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeOperationsEditPart;
77
import org.eclipse.uml2.diagram.clazz.edit.parts.Property2EditPart;
78
import org.eclipse.uml2.diagram.clazz.edit.parts.Property3EditPart;
79
import org.eclipse.uml2.diagram.clazz.edit.parts.Property4EditPart;
80
import org.eclipse.uml2.diagram.clazz.edit.parts.Property5EditPart;
81
import org.eclipse.uml2.diagram.clazz.edit.parts.Property6EditPart;
82
import org.eclipse.uml2.diagram.clazz.edit.parts.PropertyEditPart;
83
import org.eclipse.uml2.diagram.clazz.edit.parts.PropertyNameEditPart;
84
import org.eclipse.uml2.diagram.clazz.edit.parts.SlotEditPart;
85
import org.eclipse.uml2.diagram.clazz.edit.parts.UsageEditPart;
86
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
87
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationClass2ViewFactory;
88
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationClassAttributesViewFactory;
89
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationClassClassesViewFactory;
90
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationClassNameViewFactory;
91
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationClassOperationsViewFactory;
92
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationClassViewFactory;
93
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationName2ViewFactory;
94
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationName3ViewFactory;
95
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationName4ViewFactory;
96
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationName5ViewFactory;
97
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationName6ViewFactory;
98
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationName7ViewFactory;
99
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationNameViewFactory;
100
import org.eclipse.uml2.diagram.clazz.view.factories.AssociationViewFactory;
101
import org.eclipse.uml2.diagram.clazz.view.factories.Class2ViewFactory;
102
import org.eclipse.uml2.diagram.clazz.view.factories.Class3ViewFactory;
103
import org.eclipse.uml2.diagram.clazz.view.factories.ClassAttributesViewFactory;
104
import org.eclipse.uml2.diagram.clazz.view.factories.ClassClassesViewFactory;
105
import org.eclipse.uml2.diagram.clazz.view.factories.ClassNameViewFactory;
106
import org.eclipse.uml2.diagram.clazz.view.factories.ClassOperationsViewFactory;
107
import org.eclipse.uml2.diagram.clazz.view.factories.ClassViewFactory;
108
import org.eclipse.uml2.diagram.clazz.view.factories.ConstraintCompartmentViewFactory;
109
import org.eclipse.uml2.diagram.clazz.view.factories.ConstraintConstrainedElementViewFactory;
110
import org.eclipse.uml2.diagram.clazz.view.factories.ConstraintNameViewFactory;
111
import org.eclipse.uml2.diagram.clazz.view.factories.ConstraintViewFactory;
112
import org.eclipse.uml2.diagram.clazz.view.factories.DataType2ViewFactory;
113
import org.eclipse.uml2.diagram.clazz.view.factories.DataTypeAttributesViewFactory;
114
import org.eclipse.uml2.diagram.clazz.view.factories.DataTypeNameViewFactory;
115
import org.eclipse.uml2.diagram.clazz.view.factories.DataTypeOperationsViewFactory;
116
import org.eclipse.uml2.diagram.clazz.view.factories.DataTypeViewFactory;
117
import org.eclipse.uml2.diagram.clazz.view.factories.Dependency2ViewFactory;
118
import org.eclipse.uml2.diagram.clazz.view.factories.DependencyClientViewFactory;
119
import org.eclipse.uml2.diagram.clazz.view.factories.DependencyName2ViewFactory;
120
import org.eclipse.uml2.diagram.clazz.view.factories.DependencyNameViewFactory;
121
import org.eclipse.uml2.diagram.clazz.view.factories.DependencySupplierViewFactory;
122
import org.eclipse.uml2.diagram.clazz.view.factories.DependencyViewFactory;
123
import org.eclipse.uml2.diagram.clazz.view.factories.Enumeration2ViewFactory;
124
import org.eclipse.uml2.diagram.clazz.view.factories.EnumerationAttributesViewFactory;
125
import org.eclipse.uml2.diagram.clazz.view.factories.EnumerationLiteralViewFactory;
126
import org.eclipse.uml2.diagram.clazz.view.factories.EnumerationLiteralsViewFactory;
127
import org.eclipse.uml2.diagram.clazz.view.factories.EnumerationNameViewFactory;
128
import org.eclipse.uml2.diagram.clazz.view.factories.EnumerationOperationsViewFactory;
129
import org.eclipse.uml2.diagram.clazz.view.factories.EnumerationViewFactory;
130
import org.eclipse.uml2.diagram.clazz.view.factories.GeneralizationViewFactory;
131
import org.eclipse.uml2.diagram.clazz.view.factories.InstanceSpecification2ViewFactory;
132
import org.eclipse.uml2.diagram.clazz.view.factories.InstanceSpecificationNameViewFactory;
133
import org.eclipse.uml2.diagram.clazz.view.factories.InstanceSpecificationSlotsViewFactory;
134
import org.eclipse.uml2.diagram.clazz.view.factories.InstanceSpecificationViewFactory;
135
import org.eclipse.uml2.diagram.clazz.view.factories.InterfaceNameViewFactory;
136
import org.eclipse.uml2.diagram.clazz.view.factories.InterfaceRealizationViewFactory;
137
import org.eclipse.uml2.diagram.clazz.view.factories.InterfaceViewFactory;
138
import org.eclipse.uml2.diagram.clazz.view.factories.LiteralStringViewFactory;
139
import org.eclipse.uml2.diagram.clazz.view.factories.Operation2ViewFactory;
140
import org.eclipse.uml2.diagram.clazz.view.factories.Operation3ViewFactory;
141
import org.eclipse.uml2.diagram.clazz.view.factories.Operation4ViewFactory;
142
import org.eclipse.uml2.diagram.clazz.view.factories.Operation5ViewFactory;
143
import org.eclipse.uml2.diagram.clazz.view.factories.OperationViewFactory;
144
import org.eclipse.uml2.diagram.clazz.view.factories.Package2ViewFactory;
145
import org.eclipse.uml2.diagram.clazz.view.factories.Package3ViewFactory;
146
import org.eclipse.uml2.diagram.clazz.view.factories.PackageClassifiersViewFactory;
147
import org.eclipse.uml2.diagram.clazz.view.factories.PackageNameViewFactory;
148
import org.eclipse.uml2.diagram.clazz.view.factories.PackageOtherViewFactory;
149
import org.eclipse.uml2.diagram.clazz.view.factories.PackagePackagesViewFactory;
150
import org.eclipse.uml2.diagram.clazz.view.factories.PackageViewFactory;
151
import org.eclipse.uml2.diagram.clazz.view.factories.PortNameViewFactory;
152
import org.eclipse.uml2.diagram.clazz.view.factories.PortViewFactory;
153
import org.eclipse.uml2.diagram.clazz.view.factories.PrimitiveType2ViewFactory;
154
import org.eclipse.uml2.diagram.clazz.view.factories.PrimitiveTypeAttributesViewFactory;
155
import org.eclipse.uml2.diagram.clazz.view.factories.PrimitiveTypeNameViewFactory;
156
import org.eclipse.uml2.diagram.clazz.view.factories.PrimitiveTypeOperationsViewFactory;
157
import org.eclipse.uml2.diagram.clazz.view.factories.PrimitiveTypeViewFactory;
158
import org.eclipse.uml2.diagram.clazz.view.factories.Property2ViewFactory;
159
import org.eclipse.uml2.diagram.clazz.view.factories.Property3ViewFactory;
160
import org.eclipse.uml2.diagram.clazz.view.factories.Property4ViewFactory;
161
import org.eclipse.uml2.diagram.clazz.view.factories.Property5ViewFactory;
162
import org.eclipse.uml2.diagram.clazz.view.factories.Property6ViewFactory;
163
import org.eclipse.uml2.diagram.clazz.view.factories.PropertyNameViewFactory;
164
import org.eclipse.uml2.diagram.clazz.view.factories.PropertyViewFactory;
165
import org.eclipse.uml2.diagram.clazz.view.factories.SlotViewFactory;
166
import org.eclipse.uml2.diagram.clazz.view.factories.UsageViewFactory;
167
168
/**
169
 * @generated
170
 */
171
public class UMLViewProvider extends AbstractViewProvider {
172
173
	/**
174
	 * @generated
175
	 */
176
	protected Class getDiagramViewClass(IAdaptable semanticAdapter, String diagramKind) {
177
		EObject semanticElement = getSemanticElement(semanticAdapter);
178
		if (PackageEditPart.MODEL_ID.equals(diagramKind) && UMLVisualIDRegistry.getDiagramVisualID(semanticElement) != -1) {
179
			return PackageViewFactory.class;
180
		}
181
		return null;
182
	}
183
184
	/**
185
	 * @generated
186
	 */
187
	protected Class getNodeViewClass(IAdaptable semanticAdapter, View containerView, String semanticHint) {
188
		if (containerView == null) {
189
			return null;
190
		}
191
		IElementType elementType = getSemanticElementType(semanticAdapter);
192
		if (elementType != null && !UMLElementTypes.isKnownElementType(elementType)) {
193
			return null;
194
		}
195
		EClass semanticType = getSemanticEClass(semanticAdapter);
196
		EObject semanticElement = getSemanticElement(semanticAdapter);
197
		int nodeVID = UMLVisualIDRegistry.getNodeVisualID(containerView, semanticElement, semanticType, semanticHint);
198
		switch (nodeVID) {
199
		case Package2EditPart.VISUAL_ID:
200
			return Package2ViewFactory.class;
201
		case PackageNameEditPart.VISUAL_ID:
202
			return PackageNameViewFactory.class;
203
		case Class2EditPart.VISUAL_ID:
204
			return Class2ViewFactory.class;
205
		case ClassNameEditPart.VISUAL_ID:
206
			return ClassNameViewFactory.class;
207
		case AssociationClass2EditPart.VISUAL_ID:
208
			return AssociationClass2ViewFactory.class;
209
		case AssociationClassNameEditPart.VISUAL_ID:
210
			return AssociationClassNameViewFactory.class;
211
		case DataType2EditPart.VISUAL_ID:
212
			return DataType2ViewFactory.class;
213
		case DataTypeNameEditPart.VISUAL_ID:
214
			return DataTypeNameViewFactory.class;
215
		case PrimitiveType2EditPart.VISUAL_ID:
216
			return PrimitiveType2ViewFactory.class;
217
		case PrimitiveTypeNameEditPart.VISUAL_ID:
218
			return PrimitiveTypeNameViewFactory.class;
219
		case Enumeration2EditPart.VISUAL_ID:
220
			return Enumeration2ViewFactory.class;
221
		case EnumerationNameEditPart.VISUAL_ID:
222
			return EnumerationNameViewFactory.class;
223
		case InterfaceEditPart.VISUAL_ID:
224
			return InterfaceViewFactory.class;
225
		case InterfaceNameEditPart.VISUAL_ID:
226
			return InterfaceNameViewFactory.class;
227
		case ConstraintEditPart.VISUAL_ID:
228
			return ConstraintViewFactory.class;
229
		case ConstraintNameEditPart.VISUAL_ID:
230
			return ConstraintNameViewFactory.class;
231
		case InstanceSpecification2EditPart.VISUAL_ID:
232
			return InstanceSpecification2ViewFactory.class;
233
		case InstanceSpecificationNameEditPart.VISUAL_ID:
234
			return InstanceSpecificationNameViewFactory.class;
235
		case DependencyEditPart.VISUAL_ID:
236
			return DependencyViewFactory.class;
237
		case DependencyNameEditPart.VISUAL_ID:
238
			return DependencyNameViewFactory.class;
239
		case Package3EditPart.VISUAL_ID:
240
			return Package3ViewFactory.class;
241
		case ClassEditPart.VISUAL_ID:
242
			return ClassViewFactory.class;
243
		case DataTypeEditPart.VISUAL_ID:
244
			return DataTypeViewFactory.class;
245
		case PrimitiveTypeEditPart.VISUAL_ID:
246
			return PrimitiveTypeViewFactory.class;
247
		case EnumerationEditPart.VISUAL_ID:
248
			return EnumerationViewFactory.class;
249
		case AssociationClassEditPart.VISUAL_ID:
250
			return AssociationClassViewFactory.class;
251
		case InstanceSpecificationEditPart.VISUAL_ID:
252
			return InstanceSpecificationViewFactory.class;
253
		case PropertyEditPart.VISUAL_ID:
254
			return PropertyViewFactory.class;
255
		case OperationEditPart.VISUAL_ID:
256
			return OperationViewFactory.class;
257
		case Class3EditPart.VISUAL_ID:
258
			return Class3ViewFactory.class;
259
		case PortEditPart.VISUAL_ID:
260
			return PortViewFactory.class;
261
		case PortNameEditPart.VISUAL_ID:
262
			return PortNameViewFactory.class;
263
		case Property2EditPart.VISUAL_ID:
264
			return Property2ViewFactory.class;
265
		case Operation2EditPart.VISUAL_ID:
266
			return Operation2ViewFactory.class;
267
		case Property3EditPart.VISUAL_ID:
268
			return Property3ViewFactory.class;
269
		case Operation3EditPart.VISUAL_ID:
270
			return Operation3ViewFactory.class;
271
		case Property4EditPart.VISUAL_ID:
272
			return Property4ViewFactory.class;
273
		case Operation4EditPart.VISUAL_ID:
274
			return Operation4ViewFactory.class;
275
		case EnumerationLiteralEditPart.VISUAL_ID:
276
			return EnumerationLiteralViewFactory.class;
277
		case Property5EditPart.VISUAL_ID:
278
			return Property5ViewFactory.class;
279
		case Operation5EditPart.VISUAL_ID:
280
			return Operation5ViewFactory.class;
281
		case LiteralStringEditPart.VISUAL_ID:
282
			return LiteralStringViewFactory.class;
283
		case SlotEditPart.VISUAL_ID:
284
			return SlotViewFactory.class;
285
		case PackagePackagesEditPart.VISUAL_ID:
286
			return PackagePackagesViewFactory.class;
287
		case PackageClassifiersEditPart.VISUAL_ID:
288
			return PackageClassifiersViewFactory.class;
289
		case PackageOtherEditPart.VISUAL_ID:
290
			return PackageOtherViewFactory.class;
291
		case ClassAttributesEditPart.VISUAL_ID:
292
			return ClassAttributesViewFactory.class;
293
		case ClassOperationsEditPart.VISUAL_ID:
294
			return ClassOperationsViewFactory.class;
295
		case ClassClassesEditPart.VISUAL_ID:
296
			return ClassClassesViewFactory.class;
297
		case AssociationClassAttributesEditPart.VISUAL_ID:
298
			return AssociationClassAttributesViewFactory.class;
299
		case AssociationClassOperationsEditPart.VISUAL_ID:
300
			return AssociationClassOperationsViewFactory.class;
301
		case AssociationClassClassesEditPart.VISUAL_ID:
302
			return AssociationClassClassesViewFactory.class;
303
		case DataTypeAttributesEditPart.VISUAL_ID:
304
			return DataTypeAttributesViewFactory.class;
305
		case DataTypeOperationsEditPart.VISUAL_ID:
306
			return DataTypeOperationsViewFactory.class;
307
		case PrimitiveTypeAttributesEditPart.VISUAL_ID:
308
			return PrimitiveTypeAttributesViewFactory.class;
309
		case PrimitiveTypeOperationsEditPart.VISUAL_ID:
310
			return PrimitiveTypeOperationsViewFactory.class;
311
		case EnumerationLiteralsEditPart.VISUAL_ID:
312
			return EnumerationLiteralsViewFactory.class;
313
		case EnumerationAttributesEditPart.VISUAL_ID:
314
			return EnumerationAttributesViewFactory.class;
315
		case EnumerationOperationsEditPart.VISUAL_ID:
316
			return EnumerationOperationsViewFactory.class;
317
		case ConstraintCompartmentEditPart.VISUAL_ID:
318
			return ConstraintCompartmentViewFactory.class;
319
		case InstanceSpecificationSlotsEditPart.VISUAL_ID:
320
			return InstanceSpecificationSlotsViewFactory.class;
321
		case DependencyName2EditPart.VISUAL_ID:
322
			return DependencyName2ViewFactory.class;
323
		case PropertyNameEditPart.VISUAL_ID:
324
			return PropertyNameViewFactory.class;
325
		case AssociationNameEditPart.VISUAL_ID:
326
			return AssociationNameViewFactory.class;
327
		case AssociationName2EditPart.VISUAL_ID:
328
			return AssociationName2ViewFactory.class;
329
		case AssociationName3EditPart.VISUAL_ID:
330
			return AssociationName3ViewFactory.class;
331
		case AssociationName4EditPart.VISUAL_ID:
332
			return AssociationName4ViewFactory.class;
333
		case AssociationName5EditPart.VISUAL_ID:
334
			return AssociationName5ViewFactory.class;
335
		case AssociationName6EditPart.VISUAL_ID:
336
			return AssociationName6ViewFactory.class;
337
		case AssociationName7EditPart.VISUAL_ID:
338
			return AssociationName7ViewFactory.class;
339
		}
340
		return null;
341
	}
342
343
	/**
344
	 * @generated
345
	 */
346
	protected Class getEdgeViewClass(IAdaptable semanticAdapter, View containerView, String semanticHint) {
347
		IElementType elementType = getSemanticElementType(semanticAdapter);
348
		if (elementType != null && !UMLElementTypes.isKnownElementType(elementType)) {
349
			return null;
350
		}
351
		if (UMLElementTypes.ConstraintConstrainedElement_4004.equals(elementType)) {
352
			return ConstraintConstrainedElementViewFactory.class;
353
		}
354
		if (UMLElementTypes.DependencySupplier_4006.equals(elementType)) {
355
			return DependencySupplierViewFactory.class;
356
		}
357
		if (UMLElementTypes.DependencyClient_4007.equals(elementType)) {
358
			return DependencyClientViewFactory.class;
359
		}
360
		EClass semanticType = getSemanticEClass(semanticAdapter);
361
		if (semanticType == null) {
362
			return null;
363
		}
364
		EObject semanticElement = getSemanticElement(semanticAdapter);
365
		int linkVID = UMLVisualIDRegistry.getLinkWithClassVisualID(semanticElement, semanticType);
366
		switch (linkVID) {
367
		case GeneralizationEditPart.VISUAL_ID:
368
			return GeneralizationViewFactory.class;
369
		case Dependency2EditPart.VISUAL_ID:
370
			return Dependency2ViewFactory.class;
371
		case Property6EditPart.VISUAL_ID:
372
			return Property6ViewFactory.class;
373
		case AssociationEditPart.VISUAL_ID:
374
			return AssociationViewFactory.class;
375
		case InterfaceRealizationEditPart.VISUAL_ID:
376
			return InterfaceRealizationViewFactory.class;
377
		case UsageEditPart.VISUAL_ID:
378
			return UsageViewFactory.class;
379
		}
380
		return getUnrecognizedConnectorViewClass(semanticAdapter, containerView, semanticHint);
381
	}
382
383
	/**
384
	 * @generated
385
	 */
386
	private IElementType getSemanticElementType(IAdaptable semanticAdapter) {
387
		if (semanticAdapter == null) {
388
			return null;
389
		}
390
		return (IElementType) semanticAdapter.getAdapter(IElementType.class);
391
	}
392
393
	/**
394
	 * @generated
395
	 */
396
	private Class getUnrecognizedConnectorViewClass(IAdaptable semanticAdapter, View containerView, String semanticHint) {
397
		// Handle unrecognized child node classes here
398
		return null;
399
	}
400
401
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLDiagramFileCreator.java (+118 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import java.io.ByteArrayInputStream;
4
import java.io.InputStream;
5
6
import org.eclipse.core.resources.IFile;
7
import org.eclipse.core.resources.IResource;
8
import org.eclipse.core.resources.IResourceStatus;
9
import org.eclipse.core.resources.ResourcesPlugin;
10
import org.eclipse.core.runtime.CoreException;
11
import org.eclipse.core.runtime.IPath;
12
import org.eclipse.core.runtime.NullProgressMonitor;
13
import org.eclipse.jface.dialogs.ErrorDialog;
14
import org.eclipse.swt.widgets.Shell;
15
16
/**
17
 * @generated
18
 */
19
public class UMLDiagramFileCreator {
20
21
	/**
22
	 * @generated
23
	 */
24
	private static UMLDiagramFileCreator INSTANCE = new UMLDiagramFileCreator();
25
26
	/**
27
	 * @generated
28
	 */
29
	public static UMLDiagramFileCreator getInstance() {
30
		return INSTANCE;
31
	}
32
33
	/**
34
	 * @generated
35
	 */
36
	public static boolean exists(IPath path) {
37
		return ResourcesPlugin.getWorkspace().getRoot().exists(path);
38
	}
39
40
	/**
41
	 * @generated
42
	 */
43
	public String getExtension() {
44
		return ".umlclass_diagram"; //$NON-NLS-1$
45
	}
46
47
	/**
48
	 * @generated
49
	 */
50
	public String getUniqueFileName(IPath containerPath, String fileName) {
51
		int nFileNumber = 1;
52
		fileName = removeExtensionFromFileName(fileName);
53
		String newFileName = fileName;
54
		IPath diagramFilePath = containerPath.append(appendExtensionToFileName(newFileName));
55
		IPath modelFilePath = containerPath.append(newFileName + ".uml"); //$NON-NLS-1$
56
		while (exists(diagramFilePath) || exists(modelFilePath)) {
57
			nFileNumber++;
58
			newFileName = fileName + nFileNumber;
59
			diagramFilePath = containerPath.append(appendExtensionToFileName(newFileName));
60
			modelFilePath = containerPath.append(newFileName + ".uml"); //$NON-NLS-1$
61
		}
62
		return newFileName;
63
	}
64
65
	/**
66
	 * @generated
67
	 */
68
	public String appendExtensionToFileName(String fileName) {
69
		if (!fileName.endsWith(getExtension())) {
70
			return fileName + getExtension();
71
		}
72
		return fileName;
73
	}
74
75
	/**
76
	 * @generated
77
	 */
78
	private String removeExtensionFromFileName(String fileName) {
79
		if (fileName.endsWith(getExtension())) {
80
			return fileName.substring(0, fileName.length() - getExtension().length());
81
		}
82
		return fileName;
83
	}
84
85
	/**
86
	 * @generated
87
	 */
88
	public IFile createNewFile(IPath containerPath, String fileName, InputStream initialContents, Shell shell) {
89
		IPath newFilePath = containerPath.append(appendExtensionToFileName(fileName));
90
		IFile newFileHandle = ResourcesPlugin.getWorkspace().getRoot().getFile(newFilePath);
91
		try {
92
			createFile(newFileHandle, initialContents);
93
		} catch (CoreException e) {
94
			ErrorDialog.openError(shell, "Creation Problems", null, e.getStatus());
95
			return null;
96
		}
97
		return newFileHandle;
98
	}
99
100
	/**
101
	 * @generated
102
	 */
103
	protected void createFile(IFile fileHandle, InputStream contents) throws CoreException {
104
		try {
105
			if (contents == null) {
106
				contents = new ByteArrayInputStream(new byte[0]);
107
			}
108
			fileHandle.create(contents, false, new NullProgressMonitor());
109
		} catch (CoreException e) {
110
			// If the file already existed locally, just refresh to get contents
111
			if (e.getStatus().getCode() == IResourceStatus.PATH_OCCUPIED) {
112
				fileHandle.refreshLocal(IResource.DEPTH_ZERO, null);
113
			} else {
114
				throw e;
115
			}
116
		}
117
	}
118
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PropertyNameViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class PropertyNameViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(40));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/DependencySupplierViewFactory.java (+47 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
10
import org.eclipse.gmf.runtime.notation.NotationFactory;
11
import org.eclipse.gmf.runtime.notation.View;
12
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
13
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
14
15
/**
16
 * @generated
17
 */
18
public class DependencySupplierViewFactory extends ConnectionViewFactory {
19
20
	/**
21
	 * @generated 
22
	 */
23
	protected List createStyles(View view) {
24
		List styles = new ArrayList();
25
		styles.add(NotationFactory.eINSTANCE.createRoutingStyle());
26
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
27
		return styles;
28
	}
29
30
	/**
31
	 * @generated
32
	 */
33
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
34
		if (semanticHint == null) {
35
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.DependencySupplierEditPart.VISUAL_ID);
36
			view.setType(semanticHint);
37
		}
38
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
39
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
40
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
41
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
42
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
43
			view.getEAnnotations().add(shortcutAnnotation);
44
		}
45
	}
46
47
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/operation/JavaCharStream.java (+558 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.operation;
14
15
/**
16
 * An implementation of interface CharStream, where the stream is assumed to
17
 * contain only ASCII characters (with java-like unicode escape processing).
18
 */
19
20
public class JavaCharStream
21
{
22
  public static final boolean staticFlag = false;
23
  static final int hexval(char c) throws java.io.IOException {
24
    switch(c)
25
    {
26
       case '0' :
27
          return 0;
28
       case '1' :
29
          return 1;
30
       case '2' :
31
          return 2;
32
       case '3' :
33
          return 3;
34
       case '4' :
35
          return 4;
36
       case '5' :
37
          return 5;
38
       case '6' :
39
          return 6;
40
       case '7' :
41
          return 7;
42
       case '8' :
43
          return 8;
44
       case '9' :
45
          return 9;
46
47
       case 'a' :
48
       case 'A' :
49
          return 10;
50
       case 'b' :
51
       case 'B' :
52
          return 11;
53
       case 'c' :
54
       case 'C' :
55
          return 12;
56
       case 'd' :
57
       case 'D' :
58
          return 13;
59
       case 'e' :
60
       case 'E' :
61
          return 14;
62
       case 'f' :
63
       case 'F' :
64
          return 15;
65
    }
66
67
    throw new java.io.IOException(); // Should never come here
68
  }
69
70
  public int bufpos = -1;
71
  int bufsize;
72
  int available;
73
  int tokenBegin;
74
  protected int bufline[];
75
  protected int bufcolumn[];
76
77
  protected int column = 0;
78
  protected int line = 1;
79
80
  protected boolean prevCharIsCR = false;
81
  protected boolean prevCharIsLF = false;
82
83
  protected java.io.Reader inputStream;
84
85
  protected char[] nextCharBuf;
86
  protected char[] buffer;
87
  protected int maxNextCharInd = 0;
88
  protected int nextCharInd = -1;
89
  protected int inBuf = 0;
90
91
  protected void ExpandBuff(boolean wrapAround)
92
  {
93
     char[] newbuffer = new char[bufsize + 2048];
94
     int newbufline[] = new int[bufsize + 2048];
95
     int newbufcolumn[] = new int[bufsize + 2048];
96
97
     try
98
     {
99
        if (wrapAround)
100
        {
101
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
102
           System.arraycopy(buffer, 0, newbuffer,
103
                                             bufsize - tokenBegin, bufpos);
104
           buffer = newbuffer;
105
106
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
107
           System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
108
           bufline = newbufline;
109
110
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
111
           System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
112
           bufcolumn = newbufcolumn;
113
114
           bufpos += (bufsize - tokenBegin);
115
        }
116
        else
117
        {
118
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
119
           buffer = newbuffer;
120
121
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
122
           bufline = newbufline;
123
124
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
125
           bufcolumn = newbufcolumn;
126
127
           bufpos -= tokenBegin;
128
        }
129
     }
130
     catch (Throwable t)
131
     {
132
        throw new Error(t.getMessage());
133
     }
134
135
     available = (bufsize += 2048);
136
     tokenBegin = 0;
137
  }
138
139
  protected void FillBuff() throws java.io.IOException
140
  {
141
     int i;
142
     if (maxNextCharInd == 4096)
143
        maxNextCharInd = nextCharInd = 0;
144
145
     try {
146
        if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
147
                                            4096 - maxNextCharInd)) == -1)
148
        {
149
           inputStream.close();
150
           throw new java.io.IOException();
151
        }
152
        else
153
           maxNextCharInd += i;
154
        return;
155
     }
156
     catch(java.io.IOException e) {
157
        if (bufpos != 0)
158
        {
159
           --bufpos;
160
           backup(0);
161
        }
162
        else
163
        {
164
           bufline[bufpos] = line;
165
           bufcolumn[bufpos] = column;
166
        }
167
        throw e;
168
     }
169
  }
170
171
  protected char ReadByte() throws java.io.IOException
172
  {
173
     if (++nextCharInd >= maxNextCharInd)
174
        FillBuff();
175
176
     return nextCharBuf[nextCharInd];
177
  }
178
179
  public char BeginToken() throws java.io.IOException
180
  {     
181
     if (inBuf > 0)
182
     {
183
        --inBuf;
184
185
        if (++bufpos == bufsize)
186
           bufpos = 0;
187
188
        tokenBegin = bufpos;
189
        return buffer[bufpos];
190
     }
191
192
     tokenBegin = 0;
193
     bufpos = -1;
194
195
     return readChar();
196
  }     
197
198
  protected void AdjustBuffSize()
199
  {
200
     if (available == bufsize)
201
     {
202
        if (tokenBegin > 2048)
203
        {
204
           bufpos = 0;
205
           available = tokenBegin;
206
        }
207
        else
208
           ExpandBuff(false);
209
     }
210
     else if (available > tokenBegin)
211
        available = bufsize;
212
     else if ((tokenBegin - available) < 2048)
213
        ExpandBuff(true);
214
     else
215
        available = tokenBegin;
216
  }
217
218
  protected void UpdateLineColumn(char c)
219
  {
220
     column++;
221
222
     if (prevCharIsLF)
223
     {
224
        prevCharIsLF = false;
225
        line += (column = 1);
226
     }
227
     else if (prevCharIsCR)
228
     {
229
        prevCharIsCR = false;
230
        if (c == '\n')
231
        {
232
           prevCharIsLF = true;
233
        }
234
        else
235
           line += (column = 1);
236
     }
237
238
     switch (c)
239
     {
240
        case '\r' :
241
           prevCharIsCR = true;
242
           break;
243
        case '\n' :
244
           prevCharIsLF = true;
245
           break;
246
        case '\t' :
247
           column--;
248
           column += (8 - (column & 07));
249
           break;
250
        default :
251
           break;
252
     }
253
254
     bufline[bufpos] = line;
255
     bufcolumn[bufpos] = column;
256
  }
257
258
  public char readChar() throws java.io.IOException
259
  {
260
     if (inBuf > 0)
261
     {
262
        --inBuf;
263
264
        if (++bufpos == bufsize)
265
           bufpos = 0;
266
267
        return buffer[bufpos];
268
     }
269
270
     char c;
271
272
     if (++bufpos == available)
273
        AdjustBuffSize();
274
275
     if ((buffer[bufpos] = c = ReadByte()) == '\\')
276
     {
277
        UpdateLineColumn(c);
278
279
        int backSlashCnt = 1;
280
281
        for (;;) // Read all the backslashes
282
        {
283
           if (++bufpos == available)
284
              AdjustBuffSize();
285
286
           try
287
           {
288
              if ((buffer[bufpos] = c = ReadByte()) != '\\')
289
              {
290
                 UpdateLineColumn(c);
291
                 // found a non-backslash char.
292
                 if ((c == 'u') && ((backSlashCnt & 1) == 1))
293
                 {
294
                    if (--bufpos < 0)
295
                       bufpos = bufsize - 1;
296
297
                    break;
298
                 }
299
300
                 backup(backSlashCnt);
301
                 return '\\';
302
              }
303
           }
304
           catch(java.io.IOException e)
305
           {
306
              if (backSlashCnt > 1)
307
                 backup(backSlashCnt);
308
309
              return '\\';
310
           }
311
312
           UpdateLineColumn(c);
313
           backSlashCnt++;
314
        }
315
316
        // Here, we have seen an odd number of backslash's followed by a 'u'
317
        try
318
        {
319
           while ((c = ReadByte()) == 'u')
320
              ++column;
321
322
           buffer[bufpos] = c = (char)(hexval(c) << 12 |
323
                                       hexval(ReadByte()) << 8 |
324
                                       hexval(ReadByte()) << 4 |
325
                                       hexval(ReadByte()));
326
327
           column += 4;
328
        }
329
        catch(java.io.IOException e)
330
        {
331
           throw new Error("Invalid escape character at line " + line +
332
                                         " column " + column + ".");
333
        }
334
335
        if (backSlashCnt == 1)
336
           return c;
337
        else
338
        {
339
           backup(backSlashCnt - 1);
340
           return '\\';
341
        }
342
     }
343
     else
344
     {
345
        UpdateLineColumn(c);
346
        return (c);
347
     }
348
  }
349
350
  /**
351
   * @deprecated 
352
   * @see #getEndColumn
353
   */
354
355
  public int getColumn() {
356
     return bufcolumn[bufpos];
357
  }
358
359
  /**
360
   * @deprecated 
361
   * @see #getEndLine
362
   */
363
364
  public int getLine() {
365
     return bufline[bufpos];
366
  }
367
368
  public int getEndColumn() {
369
     return bufcolumn[bufpos];
370
  }
371
372
  public int getEndLine() {
373
     return bufline[bufpos];
374
  }
375
376
  public int getBeginColumn() {
377
     return bufcolumn[tokenBegin];
378
  }
379
380
  public int getBeginLine() {
381
     return bufline[tokenBegin];
382
  }
383
384
  public void backup(int amount) {
385
386
    inBuf += amount;
387
    if ((bufpos -= amount) < 0)
388
       bufpos += bufsize;
389
  }
390
391
  public JavaCharStream(java.io.Reader dstream,
392
                 int startline, int startcolumn, int buffersize)
393
  {
394
    inputStream = dstream;
395
    line = startline;
396
    column = startcolumn - 1;
397
398
    available = bufsize = buffersize;
399
    buffer = new char[buffersize];
400
    bufline = new int[buffersize];
401
    bufcolumn = new int[buffersize];
402
    nextCharBuf = new char[4096];
403
  }
404
405
  public JavaCharStream(java.io.Reader dstream,
406
                                        int startline, int startcolumn)
407
  {
408
     this(dstream, startline, startcolumn, 4096);
409
  }
410
411
  public JavaCharStream(java.io.Reader dstream)
412
  {
413
     this(dstream, 1, 1, 4096);
414
  }
415
  public void ReInit(java.io.Reader dstream,
416
                 int startline, int startcolumn, int buffersize)
417
  {
418
    inputStream = dstream;
419
    line = startline;
420
    column = startcolumn - 1;
421
422
    if (buffer == null || buffersize != buffer.length)
423
    {
424
      available = bufsize = buffersize;
425
      buffer = new char[buffersize];
426
      bufline = new int[buffersize];
427
      bufcolumn = new int[buffersize];
428
      nextCharBuf = new char[4096];
429
    }
430
    prevCharIsLF = prevCharIsCR = false;
431
    tokenBegin = inBuf = maxNextCharInd = 0;
432
    nextCharInd = bufpos = -1;
433
  }
434
435
  public void ReInit(java.io.Reader dstream,
436
                                        int startline, int startcolumn)
437
  {
438
     ReInit(dstream, startline, startcolumn, 4096);
439
  }
440
441
  public void ReInit(java.io.Reader dstream)
442
  {
443
     ReInit(dstream, 1, 1, 4096);
444
  }
445
  public JavaCharStream(java.io.InputStream dstream, int startline,
446
  int startcolumn, int buffersize)
447
  {
448
     this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
449
  }
450
451
  public JavaCharStream(java.io.InputStream dstream, int startline,
452
                                                           int startcolumn)
453
  {
454
     this(dstream, startline, startcolumn, 4096);
455
  }
456
457
  public JavaCharStream(java.io.InputStream dstream)
458
  {
459
     this(dstream, 1, 1, 4096);
460
  }
461
462
  public void ReInit(java.io.InputStream dstream, int startline,
463
  int startcolumn, int buffersize)
464
  {
465
     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
466
  }
467
  public void ReInit(java.io.InputStream dstream, int startline,
468
                                                           int startcolumn)
469
  {
470
     ReInit(dstream, startline, startcolumn, 4096);
471
  }
472
  public void ReInit(java.io.InputStream dstream)
473
  {
474
     ReInit(dstream, 1, 1, 4096);
475
  }
476
477
  public String GetImage()
478
  {
479
     if (bufpos >= tokenBegin)
480
        return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
481
     else
482
        return new String(buffer, tokenBegin, bufsize - tokenBegin) +
483
                              new String(buffer, 0, bufpos + 1);
484
  }
485
486
  public char[] GetSuffix(int len)
487
  {
488
     char[] ret = new char[len];
489
490
     if ((bufpos + 1) >= len)
491
        System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
492
     else
493
     {
494
        System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
495
                                                          len - bufpos - 1);
496
        System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
497
     }
498
499
     return ret;
500
  }
501
502
  public void Done()
503
  {
504
     nextCharBuf = null;
505
     buffer = null;
506
     bufline = null;
507
     bufcolumn = null;
508
  }
509
510
  /**
511
   * Method to adjust line and column numbers for the start of a token.
512
   */
513
  public void adjustBeginLineColumn(int newLine, int newCol)
514
  {
515
     int start = tokenBegin;
516
     int len;
517
518
     if (bufpos >= tokenBegin)
519
     {
520
        len = bufpos - tokenBegin + inBuf + 1;
521
     }
522
     else
523
     {
524
        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
525
     }
526
527
     int i = 0, j = 0, k = 0;
528
     int nextColDiff = 0, columnDiff = 0;
529
530
     while (i < len &&
531
            bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
532
     {
533
        bufline[j] = newLine;
534
        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
535
        bufcolumn[j] = newCol + columnDiff;
536
        columnDiff = nextColDiff;
537
        i++;
538
     } 
539
540
     if (i < len)
541
     {
542
        bufline[j] = newLine++;
543
        bufcolumn[j] = newCol + columnDiff;
544
545
        while (i++ < len)
546
        {
547
           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
548
              bufline[j] = newLine++;
549
           else
550
              bufline[j] = newLine;
551
        }
552
     }
553
554
     line = bufline[j];
555
     column = bufcolumn[j];
556
  }
557
558
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/property/JavaCharStream.java (+547 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 3.0 */
2
package org.eclipse.uml2.diagram.clazz.parser.property;
3
4
/**
5
 * An implementation of interface CharStream, where the stream is assumed to
6
 * contain only ASCII characters (with java-like unicode escape processing).
7
 */
8
9
public class JavaCharStream
10
{
11
  public static final boolean staticFlag = false;
12
  static final int hexval(char c) throws java.io.IOException {
13
    switch(c)
14
    {
15
       case '0' :
16
          return 0;
17
       case '1' :
18
          return 1;
19
       case '2' :
20
          return 2;
21
       case '3' :
22
          return 3;
23
       case '4' :
24
          return 4;
25
       case '5' :
26
          return 5;
27
       case '6' :
28
          return 6;
29
       case '7' :
30
          return 7;
31
       case '8' :
32
          return 8;
33
       case '9' :
34
          return 9;
35
36
       case 'a' :
37
       case 'A' :
38
          return 10;
39
       case 'b' :
40
       case 'B' :
41
          return 11;
42
       case 'c' :
43
       case 'C' :
44
          return 12;
45
       case 'd' :
46
       case 'D' :
47
          return 13;
48
       case 'e' :
49
       case 'E' :
50
          return 14;
51
       case 'f' :
52
       case 'F' :
53
          return 15;
54
    }
55
56
    throw new java.io.IOException(); // Should never come here
57
  }
58
59
  public int bufpos = -1;
60
  int bufsize;
61
  int available;
62
  int tokenBegin;
63
  protected int bufline[];
64
  protected int bufcolumn[];
65
66
  protected int column = 0;
67
  protected int line = 1;
68
69
  protected boolean prevCharIsCR = false;
70
  protected boolean prevCharIsLF = false;
71
72
  protected java.io.Reader inputStream;
73
74
  protected char[] nextCharBuf;
75
  protected char[] buffer;
76
  protected int maxNextCharInd = 0;
77
  protected int nextCharInd = -1;
78
  protected int inBuf = 0;
79
80
  protected void ExpandBuff(boolean wrapAround)
81
  {
82
     char[] newbuffer = new char[bufsize + 2048];
83
     int newbufline[] = new int[bufsize + 2048];
84
     int newbufcolumn[] = new int[bufsize + 2048];
85
86
     try
87
     {
88
        if (wrapAround)
89
        {
90
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
91
           System.arraycopy(buffer, 0, newbuffer,
92
                                             bufsize - tokenBegin, bufpos);
93
           buffer = newbuffer;
94
95
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
96
           System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
97
           bufline = newbufline;
98
99
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
100
           System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
101
           bufcolumn = newbufcolumn;
102
103
           bufpos += (bufsize - tokenBegin);
104
        }
105
        else
106
        {
107
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
108
           buffer = newbuffer;
109
110
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
111
           bufline = newbufline;
112
113
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
114
           bufcolumn = newbufcolumn;
115
116
           bufpos -= tokenBegin;
117
        }
118
     }
119
     catch (Throwable t)
120
     {
121
        throw new Error(t.getMessage());
122
     }
123
124
     available = (bufsize += 2048);
125
     tokenBegin = 0;
126
  }
127
128
  protected void FillBuff() throws java.io.IOException
129
  {
130
     int i;
131
     if (maxNextCharInd == 4096)
132
        maxNextCharInd = nextCharInd = 0;
133
134
     try {
135
        if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
136
                                            4096 - maxNextCharInd)) == -1)
137
        {
138
           inputStream.close();
139
           throw new java.io.IOException();
140
        }
141
        else
142
           maxNextCharInd += i;
143
        return;
144
     }
145
     catch(java.io.IOException e) {
146
        if (bufpos != 0)
147
        {
148
           --bufpos;
149
           backup(0);
150
        }
151
        else
152
        {
153
           bufline[bufpos] = line;
154
           bufcolumn[bufpos] = column;
155
        }
156
        throw e;
157
     }
158
  }
159
160
  protected char ReadByte() throws java.io.IOException
161
  {
162
     if (++nextCharInd >= maxNextCharInd)
163
        FillBuff();
164
165
     return nextCharBuf[nextCharInd];
166
  }
167
168
  public char BeginToken() throws java.io.IOException
169
  {     
170
     if (inBuf > 0)
171
     {
172
        --inBuf;
173
174
        if (++bufpos == bufsize)
175
           bufpos = 0;
176
177
        tokenBegin = bufpos;
178
        return buffer[bufpos];
179
     }
180
181
     tokenBegin = 0;
182
     bufpos = -1;
183
184
     return readChar();
185
  }     
186
187
  protected void AdjustBuffSize()
188
  {
189
     if (available == bufsize)
190
     {
191
        if (tokenBegin > 2048)
192
        {
193
           bufpos = 0;
194
           available = tokenBegin;
195
        }
196
        else
197
           ExpandBuff(false);
198
     }
199
     else if (available > tokenBegin)
200
        available = bufsize;
201
     else if ((tokenBegin - available) < 2048)
202
        ExpandBuff(true);
203
     else
204
        available = tokenBegin;
205
  }
206
207
  protected void UpdateLineColumn(char c)
208
  {
209
     column++;
210
211
     if (prevCharIsLF)
212
     {
213
        prevCharIsLF = false;
214
        line += (column = 1);
215
     }
216
     else if (prevCharIsCR)
217
     {
218
        prevCharIsCR = false;
219
        if (c == '\n')
220
        {
221
           prevCharIsLF = true;
222
        }
223
        else
224
           line += (column = 1);
225
     }
226
227
     switch (c)
228
     {
229
        case '\r' :
230
           prevCharIsCR = true;
231
           break;
232
        case '\n' :
233
           prevCharIsLF = true;
234
           break;
235
        case '\t' :
236
           column--;
237
           column += (8 - (column & 07));
238
           break;
239
        default :
240
           break;
241
     }
242
243
     bufline[bufpos] = line;
244
     bufcolumn[bufpos] = column;
245
  }
246
247
  public char readChar() throws java.io.IOException
248
  {
249
     if (inBuf > 0)
250
     {
251
        --inBuf;
252
253
        if (++bufpos == bufsize)
254
           bufpos = 0;
255
256
        return buffer[bufpos];
257
     }
258
259
     char c;
260
261
     if (++bufpos == available)
262
        AdjustBuffSize();
263
264
     if ((buffer[bufpos] = c = ReadByte()) == '\\')
265
     {
266
        UpdateLineColumn(c);
267
268
        int backSlashCnt = 1;
269
270
        for (;;) // Read all the backslashes
271
        {
272
           if (++bufpos == available)
273
              AdjustBuffSize();
274
275
           try
276
           {
277
              if ((buffer[bufpos] = c = ReadByte()) != '\\')
278
              {
279
                 UpdateLineColumn(c);
280
                 // found a non-backslash char.
281
                 if ((c == 'u') && ((backSlashCnt & 1) == 1))
282
                 {
283
                    if (--bufpos < 0)
284
                       bufpos = bufsize - 1;
285
286
                    break;
287
                 }
288
289
                 backup(backSlashCnt);
290
                 return '\\';
291
              }
292
           }
293
           catch(java.io.IOException e)
294
           {
295
              if (backSlashCnt > 1)
296
                 backup(backSlashCnt);
297
298
              return '\\';
299
           }
300
301
           UpdateLineColumn(c);
302
           backSlashCnt++;
303
        }
304
305
        // Here, we have seen an odd number of backslash's followed by a 'u'
306
        try
307
        {
308
           while ((c = ReadByte()) == 'u')
309
              ++column;
310
311
           buffer[bufpos] = c = (char)(hexval(c) << 12 |
312
                                       hexval(ReadByte()) << 8 |
313
                                       hexval(ReadByte()) << 4 |
314
                                       hexval(ReadByte()));
315
316
           column += 4;
317
        }
318
        catch(java.io.IOException e)
319
        {
320
           throw new Error("Invalid escape character at line " + line +
321
                                         " column " + column + ".");
322
        }
323
324
        if (backSlashCnt == 1)
325
           return c;
326
        else
327
        {
328
           backup(backSlashCnt - 1);
329
           return '\\';
330
        }
331
     }
332
     else
333
     {
334
        UpdateLineColumn(c);
335
        return (c);
336
     }
337
  }
338
339
  /**
340
   * @deprecated 
341
   * @see #getEndColumn
342
   */
343
344
  public int getColumn() {
345
     return bufcolumn[bufpos];
346
  }
347
348
  /**
349
   * @deprecated 
350
   * @see #getEndLine
351
   */
352
353
  public int getLine() {
354
     return bufline[bufpos];
355
  }
356
357
  public int getEndColumn() {
358
     return bufcolumn[bufpos];
359
  }
360
361
  public int getEndLine() {
362
     return bufline[bufpos];
363
  }
364
365
  public int getBeginColumn() {
366
     return bufcolumn[tokenBegin];
367
  }
368
369
  public int getBeginLine() {
370
     return bufline[tokenBegin];
371
  }
372
373
  public void backup(int amount) {
374
375
    inBuf += amount;
376
    if ((bufpos -= amount) < 0)
377
       bufpos += bufsize;
378
  }
379
380
  public JavaCharStream(java.io.Reader dstream,
381
                 int startline, int startcolumn, int buffersize)
382
  {
383
    inputStream = dstream;
384
    line = startline;
385
    column = startcolumn - 1;
386
387
    available = bufsize = buffersize;
388
    buffer = new char[buffersize];
389
    bufline = new int[buffersize];
390
    bufcolumn = new int[buffersize];
391
    nextCharBuf = new char[4096];
392
  }
393
394
  public JavaCharStream(java.io.Reader dstream,
395
                                        int startline, int startcolumn)
396
  {
397
     this(dstream, startline, startcolumn, 4096);
398
  }
399
400
  public JavaCharStream(java.io.Reader dstream)
401
  {
402
     this(dstream, 1, 1, 4096);
403
  }
404
  public void ReInit(java.io.Reader dstream,
405
                 int startline, int startcolumn, int buffersize)
406
  {
407
    inputStream = dstream;
408
    line = startline;
409
    column = startcolumn - 1;
410
411
    if (buffer == null || buffersize != buffer.length)
412
    {
413
      available = bufsize = buffersize;
414
      buffer = new char[buffersize];
415
      bufline = new int[buffersize];
416
      bufcolumn = new int[buffersize];
417
      nextCharBuf = new char[4096];
418
    }
419
    prevCharIsLF = prevCharIsCR = false;
420
    tokenBegin = inBuf = maxNextCharInd = 0;
421
    nextCharInd = bufpos = -1;
422
  }
423
424
  public void ReInit(java.io.Reader dstream,
425
                                        int startline, int startcolumn)
426
  {
427
     ReInit(dstream, startline, startcolumn, 4096);
428
  }
429
430
  public void ReInit(java.io.Reader dstream)
431
  {
432
     ReInit(dstream, 1, 1, 4096);
433
  }
434
  public JavaCharStream(java.io.InputStream dstream, int startline,
435
  int startcolumn, int buffersize)
436
  {
437
     this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
438
  }
439
440
  public JavaCharStream(java.io.InputStream dstream, int startline,
441
                                                           int startcolumn)
442
  {
443
     this(dstream, startline, startcolumn, 4096);
444
  }
445
446
  public JavaCharStream(java.io.InputStream dstream)
447
  {
448
     this(dstream, 1, 1, 4096);
449
  }
450
451
  public void ReInit(java.io.InputStream dstream, int startline,
452
  int startcolumn, int buffersize)
453
  {
454
     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
455
  }
456
  public void ReInit(java.io.InputStream dstream, int startline,
457
                                                           int startcolumn)
458
  {
459
     ReInit(dstream, startline, startcolumn, 4096);
460
  }
461
  public void ReInit(java.io.InputStream dstream)
462
  {
463
     ReInit(dstream, 1, 1, 4096);
464
  }
465
466
  public String GetImage()
467
  {
468
     if (bufpos >= tokenBegin)
469
        return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
470
     else
471
        return new String(buffer, tokenBegin, bufsize - tokenBegin) +
472
                              new String(buffer, 0, bufpos + 1);
473
  }
474
475
  public char[] GetSuffix(int len)
476
  {
477
     char[] ret = new char[len];
478
479
     if ((bufpos + 1) >= len)
480
        System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
481
     else
482
     {
483
        System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
484
                                                          len - bufpos - 1);
485
        System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
486
     }
487
488
     return ret;
489
  }
490
491
  public void Done()
492
  {
493
     nextCharBuf = null;
494
     buffer = null;
495
     bufline = null;
496
     bufcolumn = null;
497
  }
498
499
  /**
500
   * Method to adjust line and column numbers for the start of a token.
501
   */
502
  public void adjustBeginLineColumn(int newLine, int newCol)
503
  {
504
     int start = tokenBegin;
505
     int len;
506
507
     if (bufpos >= tokenBegin)
508
     {
509
        len = bufpos - tokenBegin + inBuf + 1;
510
     }
511
     else
512
     {
513
        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
514
     }
515
516
     int i = 0, j = 0, k = 0;
517
     int nextColDiff = 0, columnDiff = 0;
518
519
     while (i < len &&
520
            bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
521
     {
522
        bufline[j] = newLine;
523
        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
524
        bufcolumn[j] = newCol + columnDiff;
525
        columnDiff = nextColDiff;
526
        i++;
527
     } 
528
529
     if (i < len)
530
     {
531
        bufline[j] = newLine++;
532
        bufcolumn[j] = newCol + columnDiff;
533
534
        while (i++ < len)
535
        {
536
           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
537
              bufline[j] = newLine++;
538
           else
539
              bufline[j] = newLine;
540
        }
541
     }
542
543
     line = bufline[j];
544
     column = bufcolumn[j];
545
  }
546
547
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/AssociationClassEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class AssociationClassEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/slot/SlotToString.java (+116 lines)
Added Link Here
1
/*
2
 * Copyright (c) 2006 Borland Software Corporation
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    Michael Golubev (Borland) - initial API and implementation
11
 */
12
13
package org.eclipse.uml2.diagram.clazz.parser.slot;
14
15
import java.util.Arrays;
16
import java.util.Iterator;
17
import java.util.LinkedList;
18
import java.util.List;
19
20
import org.eclipse.emf.ecore.EObject;
21
import org.eclipse.emf.ecore.EStructuralFeature;
22
import org.eclipse.uml2.diagram.parser.AbstractToString;
23
import org.eclipse.uml2.uml.Expression;
24
import org.eclipse.uml2.uml.LiteralInteger;
25
import org.eclipse.uml2.uml.LiteralString;
26
import org.eclipse.uml2.uml.Slot;
27
import org.eclipse.uml2.uml.StructuralFeature;
28
import org.eclipse.uml2.uml.UMLPackage;
29
import org.eclipse.uml2.uml.ValueSpecification;
30
31
public abstract class SlotToString extends AbstractToString {
32
	public static class EDIT extends SlotToString {
33
		public boolean isAffectingFeature(EStructuralFeature feature) {
34
			throw new UnsupportedOperationException("I am edit toString, I am not expected to be asked");
35
		}
36
	}
37
	
38
	public static class VIEW extends SlotToString implements WithReferences {
39
		private static final List AFFECTING = Arrays.asList(new EStructuralFeature[] {
40
			UMLPackage.eINSTANCE.getSlot_Value(),
41
			UMLPackage.eINSTANCE.getSlot_DefiningFeature(),
42
			UMLPackage.eINSTANCE.getExpression_Symbol(),
43
			UMLPackage.eINSTANCE.getLiteralString_Value(), 
44
			UMLPackage.eINSTANCE.getLiteralInteger_Value(),
45
		});
46
		
47
		public boolean isAffectingFeature(EStructuralFeature feature) {
48
			return AFFECTING.contains(feature);
49
		}
50
		
51
		public List getAdditionalReferencedElements(EObject object) {
52
			Slot slot = asSlot(object);
53
			List result = new LinkedList();
54
			result.add(slot);
55
			StructuralFeature definingFeature = slot.getDefiningFeature();
56
			if (definingFeature != null){
57
				result.add(definingFeature);
58
			}
59
			result.addAll(slot.getValues());
60
			return result;
61
		}
62
		
63
	}
64
	
65
	public String getToString(EObject object, int flags) {
66
		Slot slot = asSlot(object);
67
		StringBuffer result = new StringBuffer();
68
		appendFeatureName(result, slot);
69
		appendSlotValue(result, slot);
70
		return result.toString();
71
	}
72
	
73
	protected void appendFeatureName(StringBuffer result, Slot slot){
74
		StructuralFeature feature = slot.getDefiningFeature();
75
		appendName(result, feature);
76
	}
77
	
78
	/**
79
	 * FIXME: It is unclear from the spec how multiple values should be shown. For now assuming only one value
80
	 */
81
	protected void appendSlotValue(StringBuffer result, Slot slot){
82
		for (Iterator values = slot.getValues().iterator(); values.hasNext();){
83
			ValueSpecification next = (ValueSpecification)values.next();
84
			String nextDisplayValue = getSlotValue(next);
85
			if (!isEmpty(nextDisplayValue)){
86
				result.append(" = ").append(nextDisplayValue);
87
				//FIXME: for now stop on first success
88
				break;
89
			}
90
		}
91
	}
92
	
93
	protected String getSlotValue(ValueSpecification value){
94
		if (value instanceof LiteralString){
95
			LiteralString literal = (LiteralString)value;
96
			return "\"" + literal.getValue() + "\"";
97
		}
98
		if (value instanceof LiteralInteger){
99
			LiteralInteger literal = (LiteralInteger)value;
100
			return String.valueOf(literal.getValue());
101
		}
102
		if (value instanceof Expression){
103
			Expression expression = (Expression)value;
104
			return expression.getSymbol();
105
		}
106
		return null;
107
	}
108
	
109
	protected Slot asSlot(EObject object){
110
		if (false == object instanceof Slot){
111
			throw new IllegalStateException("I can not provide toString for: " + object);
112
		}
113
		return (Slot)object;
114
	}
115
	
116
}
(-)src/org/eclipse/uml2/diagram/clazz/sheet/UMLSheetLabelProvider.java (+78 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.sheet;
2
3
import org.eclipse.core.runtime.IAdaptable;
4
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
5
import org.eclipse.gef.EditPart;
6
import org.eclipse.gmf.runtime.notation.View;
7
import org.eclipse.jface.viewers.DecoratingLabelProvider;
8
import org.eclipse.jface.viewers.IStructuredSelection;
9
import org.eclipse.swt.graphics.Image;
10
import org.eclipse.uml2.diagram.clazz.navigator.UMLNavigatorGroup;
11
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
12
13
/**
14
 * @generated
15
 */
16
public class UMLSheetLabelProvider extends DecoratingLabelProvider {
17
18
	/**
19
	 * @generated
20
	 */
21
	public UMLSheetLabelProvider() {
22
		super(new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()), null);
23
	}
24
25
	/**
26
	 * @generated
27
	 */
28
	public String getText(Object element) {
29
		Object selected = unwrap(element);
30
		if (selected instanceof UMLNavigatorGroup) {
31
			return ((UMLNavigatorGroup) selected).getGroupName();
32
		}
33
		return super.getText(selected);
34
	}
35
36
	/**
37
	 * @generated
38
	 */
39
	public Image getImage(Object element) {
40
		return super.getImage(unwrap(element));
41
	}
42
43
	/**
44
	 * @generated
45
	 */
46
	private Object unwrap(Object element) {
47
		if (element instanceof IStructuredSelection) {
48
			return unwrap(((IStructuredSelection) element).getFirstElement());
49
		}
50
		if (element instanceof EditPart) {
51
			return unwrapEditPart((EditPart) element);
52
		}
53
		if (element instanceof IAdaptable) {
54
			View view = (View) ((IAdaptable) element).getAdapter(View.class);
55
			if (view != null) {
56
				return unwrapView(view);
57
			}
58
		}
59
		return element;
60
	}
61
62
	/**
63
	 * @generated
64
	 */
65
	private Object unwrapEditPart(EditPart p) {
66
		if (p.getModel() instanceof View) {
67
			return unwrapView((View) p.getModel());
68
		}
69
		return p.getModel();
70
	}
71
72
	/**
73
	 * @generated
74
	 */
75
	private Object unwrapView(View view) {
76
		return view.getElement() == null ? view : view.getElement();
77
	}
78
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/Class2EditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class Class2EditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/providers/UMLEditPartProvider.java (+141 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.providers;
2
3
import java.lang.ref.WeakReference;
4
5
import org.eclipse.gef.EditPart;
6
import org.eclipse.gef.EditPartFactory;
7
import org.eclipse.gmf.runtime.common.core.service.IOperation;
8
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
9
import org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider;
10
import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
11
import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.UMLEditPartFactory;
15
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
16
17
/**
18
 * @generated
19
 */
20
public class UMLEditPartProvider extends AbstractEditPartProvider {
21
22
	/**
23
	 * @generated
24
	 */
25
	private EditPartFactory factory;
26
27
	/**
28
	 * @generated
29
	 */
30
	private boolean allowCaching;
31
32
	/**
33
	 * @generated
34
	 */
35
	private WeakReference cachedPart;
36
37
	/**
38
	 * @generated
39
	 */
40
	private WeakReference cachedView;
41
42
	/**
43
	 * @generated
44
	 */
45
	public UMLEditPartProvider() {
46
		setFactory(new UMLEditPartFactory());
47
		setAllowCaching(true);
48
	}
49
50
	/**
51
	 * @generated
52
	 */
53
	public final EditPartFactory getFactory() {
54
		return factory;
55
	}
56
57
	/**
58
	 * @generated
59
	 */
60
	protected void setFactory(EditPartFactory factory) {
61
		this.factory = factory;
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	public final boolean isAllowCaching() {
68
		return allowCaching;
69
	}
70
71
	/**
72
	 * @generated
73
	 */
74
	protected synchronized void setAllowCaching(boolean allowCaching) {
75
		this.allowCaching = allowCaching;
76
		if (!allowCaching) {
77
			cachedPart = null;
78
			cachedView = null;
79
		}
80
	}
81
82
	/**
83
	 * @generated
84
	 */
85
	protected IGraphicalEditPart createEditPart(View view) {
86
		EditPart part = factory.createEditPart(null, view);
87
		if (part instanceof IGraphicalEditPart) {
88
			return (IGraphicalEditPart) part;
89
		}
90
		return null;
91
	}
92
93
	/**
94
	 * @generated
95
	 */
96
	protected IGraphicalEditPart getCachedPart(View view) {
97
		if (cachedView != null && cachedView.get() == view) {
98
			return (IGraphicalEditPart) cachedPart.get();
99
		}
100
		return null;
101
	}
102
103
	/**
104
	 * @generated
105
	 */
106
	public synchronized IGraphicalEditPart createGraphicEditPart(View view) {
107
		if (isAllowCaching()) {
108
			IGraphicalEditPart part = getCachedPart(view);
109
			cachedPart = null;
110
			cachedView = null;
111
			if (part != null) {
112
				return part;
113
			}
114
		}
115
		return createEditPart(view);
116
	}
117
118
	/**
119
	 * @generated
120
	 */
121
	public synchronized boolean provides(IOperation operation) {
122
		if (operation instanceof CreateGraphicEditPartOperation) {
123
			View view = ((IEditPartOperation) operation).getView();
124
			if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view))) {
125
				return false;
126
			}
127
			if (isAllowCaching() && getCachedPart(view) != null) {
128
				return true;
129
			}
130
			IGraphicalEditPart part = createEditPart(view);
131
			if (part != null) {
132
				if (isAllowCaching()) {
133
					cachedPart = new WeakReference(part);
134
					cachedView = new WeakReference(view);
135
				}
136
				return true;
137
			}
138
		}
139
		return false;
140
	}
141
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/InterfaceNameViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class InterfaceNameViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(5));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationClassClassesViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class AssociationClassClassesViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassClassesEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-).classpath (+8 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="src" path="custom-src"/>
5
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
6
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
7
	<classpathentry kind="output" path="bin"/>
8
</classpath>
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/slot/TokenMgrError.java (+144 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.slot;
14
15
public class TokenMgrError extends Error
16
{
17
   /*
18
    * Ordinals for various reasons why an Error of this type can be thrown.
19
    */
20
21
   /**
22
    * Lexical error occured.
23
    */
24
   static final int LEXICAL_ERROR = 0;
25
26
   /**
27
    * An attempt wass made to create a second instance of a static token manager.
28
    */
29
   static final int STATIC_LEXER_ERROR = 1;
30
31
   /**
32
    * Tried to change to an invalid lexical state.
33
    */
34
   static final int INVALID_LEXICAL_STATE = 2;
35
36
   /**
37
    * Detected (and bailed out of) an infinite loop in the token manager.
38
    */
39
   static final int LOOP_DETECTED = 3;
40
41
   /**
42
    * Indicates the reason why the exception is thrown. It will have
43
    * one of the above 4 values.
44
    */
45
   int errorCode;
46
47
   /**
48
    * Replaces unprintable characters by their espaced (or unicode escaped)
49
    * equivalents in the given string
50
    */
51
   protected static final String addEscapes(String str) {
52
      StringBuffer retval = new StringBuffer();
53
      char ch;
54
      for (int i = 0; i < str.length(); i++) {
55
        switch (str.charAt(i))
56
        {
57
           case 0 :
58
              continue;
59
           case '\b':
60
              retval.append("\\b");
61
              continue;
62
           case '\t':
63
              retval.append("\\t");
64
              continue;
65
           case '\n':
66
              retval.append("\\n");
67
              continue;
68
           case '\f':
69
              retval.append("\\f");
70
              continue;
71
           case '\r':
72
              retval.append("\\r");
73
              continue;
74
           case '\"':
75
              retval.append("\\\"");
76
              continue;
77
           case '\'':
78
              retval.append("\\\'");
79
              continue;
80
           case '\\':
81
              retval.append("\\\\");
82
              continue;
83
           default:
84
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
85
                 String s = "0000" + Integer.toString(ch, 16);
86
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
87
              } else {
88
                 retval.append(ch);
89
              }
90
              continue;
91
        }
92
      }
93
      return retval.toString();
94
   }
95
96
   /**
97
    * Returns a detailed message for the Error when it is thrown by the
98
    * token manager to indicate a lexical error.
99
    * Parameters : 
100
    *    EOFSeen     : indicates if EOF caused the lexicl error
101
    *    curLexState : lexical state in which this error occured
102
    *    errorLine   : line number when the error occured
103
    *    errorColumn : column number when the error occured
104
    *    errorAfter  : prefix that was seen before this error occured
105
    *    curchar     : the offending character
106
    * Note: You can customize the lexical error message by modifying this method.
107
    */
108
   protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
109
      return("Lexical error at line " +
110
           errorLine + ", column " +
111
           errorColumn + ".  Encountered: " +
112
           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
113
           "after : \"" + addEscapes(errorAfter) + "\"");
114
   }
115
116
   /**
117
    * You can also modify the body of this method to customize your error messages.
118
    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
119
    * of end-users concern, so you can return something like : 
120
    *
121
    *     "Internal Error : Please file a bug report .... "
122
    *
123
    * from this method for such cases in the release version of your parser.
124
    */
125
   public String getMessage() {
126
      return super.getMessage();
127
   }
128
129
   /*
130
    * Constructors of various flavors follow.
131
    */
132
133
   public TokenMgrError() {
134
   }
135
136
   public TokenMgrError(String message, int reason) {
137
      super(message);
138
      errorCode = reason;
139
   }
140
141
   public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
142
      this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
143
   }
144
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PrimitiveTypeNameViewFactory.java (+29 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory;
8
import org.eclipse.gmf.runtime.notation.View;
9
10
/**
11
 * @generated
12
 */
13
public class PrimitiveTypeNameViewFactory extends BasicNodeViewFactory {
14
15
	/**
16
	 * @generated
17
	 */
18
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
19
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
20
	}
21
22
	/**
23
	 * @generated
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		return styles;
28
	}
29
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/end/AssociationEndParserConstants.java (+79 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. AssociationEndParserConstants.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.end;
14
15
public interface AssociationEndParserConstants {
16
17
  int EOF = 0;
18
  int SLASH = 3;
19
  int COLON = 4;
20
  int EQUALS = 5;
21
  int LBRACKET = 6;
22
  int RBRACKET = 7;
23
  int LCURLY = 8;
24
  int RCURLY = 9;
25
  int COMMA = 10;
26
  int PLUS = 11;
27
  int MINUS = 12;
28
  int NUMBER_SIGN = 13;
29
  int TILDE = 14;
30
  int DOT = 15;
31
  int STAR = 16;
32
  int READ_ONLY = 17;
33
  int UNION = 18;
34
  int SUBSETS = 19;
35
  int REDEFINES = 20;
36
  int ORDERED = 21;
37
  int UNORDERED = 22;
38
  int UNIQUE = 23;
39
  int NON_UNIQUE = 24;
40
  int INTEGER_LITERAL = 25;
41
  int IDENTIFIER = 26;
42
  int LETTER = 27;
43
  int DIGIT = 28;
44
45
  int DEFAULT = 0;
46
47
  String[] tokenImage = {
48
    "<EOF>",
49
    "\" \"",
50
    "\"\\t\"",
51
    "\"/\"",
52
    "\":\"",
53
    "\"=\"",
54
    "\"[\"",
55
    "\"]\"",
56
    "\"{\"",
57
    "\"}\"",
58
    "\",\"",
59
    "\"+\"",
60
    "\"-\"",
61
    "\"#\"",
62
    "\"~\"",
63
    "\".\"",
64
    "\"*\"",
65
    "\"readOnly\"",
66
    "\"union\"",
67
    "\"subsets\"",
68
    "\"redefines\"",
69
    "\"ordered\"",
70
    "\"unordered\"",
71
    "\"unique\"",
72
    "\"nonunique\"",
73
    "<INTEGER_LITERAL>",
74
    "<IDENTIFIER>",
75
    "<LETTER>",
76
    "<DIGIT>",
77
  };
78
79
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/end/TokenMgrError.java (+144 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.end;
14
15
public class TokenMgrError extends Error
16
{
17
   /*
18
    * Ordinals for various reasons why an Error of this type can be thrown.
19
    */
20
21
   /**
22
    * Lexical error occured.
23
    */
24
   static final int LEXICAL_ERROR = 0;
25
26
   /**
27
    * An attempt wass made to create a second instance of a static token manager.
28
    */
29
   static final int STATIC_LEXER_ERROR = 1;
30
31
   /**
32
    * Tried to change to an invalid lexical state.
33
    */
34
   static final int INVALID_LEXICAL_STATE = 2;
35
36
   /**
37
    * Detected (and bailed out of) an infinite loop in the token manager.
38
    */
39
   static final int LOOP_DETECTED = 3;
40
41
   /**
42
    * Indicates the reason why the exception is thrown. It will have
43
    * one of the above 4 values.
44
    */
45
   int errorCode;
46
47
   /**
48
    * Replaces unprintable characters by their espaced (or unicode escaped)
49
    * equivalents in the given string
50
    */
51
   protected static final String addEscapes(String str) {
52
      StringBuffer retval = new StringBuffer();
53
      char ch;
54
      for (int i = 0; i < str.length(); i++) {
55
        switch (str.charAt(i))
56
        {
57
           case 0 :
58
              continue;
59
           case '\b':
60
              retval.append("\\b");
61
              continue;
62
           case '\t':
63
              retval.append("\\t");
64
              continue;
65
           case '\n':
66
              retval.append("\\n");
67
              continue;
68
           case '\f':
69
              retval.append("\\f");
70
              continue;
71
           case '\r':
72
              retval.append("\\r");
73
              continue;
74
           case '\"':
75
              retval.append("\\\"");
76
              continue;
77
           case '\'':
78
              retval.append("\\\'");
79
              continue;
80
           case '\\':
81
              retval.append("\\\\");
82
              continue;
83
           default:
84
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
85
                 String s = "0000" + Integer.toString(ch, 16);
86
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
87
              } else {
88
                 retval.append(ch);
89
              }
90
              continue;
91
        }
92
      }
93
      return retval.toString();
94
   }
95
96
   /**
97
    * Returns a detailed message for the Error when it is thrown by the
98
    * token manager to indicate a lexical error.
99
    * Parameters : 
100
    *    EOFSeen     : indicates if EOF caused the lexicl error
101
    *    curLexState : lexical state in which this error occured
102
    *    errorLine   : line number when the error occured
103
    *    errorColumn : column number when the error occured
104
    *    errorAfter  : prefix that was seen before this error occured
105
    *    curchar     : the offending character
106
    * Note: You can customize the lexical error message by modifying this method.
107
    */
108
   protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
109
      return("Lexical error at line " +
110
           errorLine + ", column " +
111
           errorColumn + ".  Encountered: " +
112
           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
113
           "after : \"" + addEscapes(errorAfter) + "\"");
114
   }
115
116
   /**
117
    * You can also modify the body of this method to customize your error messages.
118
    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
119
    * of end-users concern, so you can return something like : 
120
    *
121
    *     "Internal Error : Please file a bug report .... "
122
    *
123
    * from this method for such cases in the release version of your parser.
124
    */
125
   public String getMessage() {
126
      return super.getMessage();
127
   }
128
129
   /*
130
    * Constructors of various flavors follow.
131
    */
132
133
   public TokenMgrError() {
134
   }
135
136
   public TokenMgrError(String message, int reason) {
137
      super(message);
138
      errorCode = reason;
139
   }
140
141
   public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
142
      this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
143
   }
144
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Class2ViewFactory.java (+58 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassAttributesEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassClassesEditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassNameEditPart;
16
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassOperationsEditPart;
17
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
18
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
19
20
/**
21
 * @generated
22
 */
23
public class Class2ViewFactory extends AbstractShapeViewFactory {
24
25
	/**
26
	 * @generated 
27
	 */
28
	protected List createStyles(View view) {
29
		List styles = new ArrayList();
30
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
31
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
32
		styles.add(NotationFactory.eINSTANCE.createFillStyle());
33
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
34
		return styles;
35
	}
36
37
	/**
38
	 * @generated
39
	 */
40
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
41
		if (semanticHint == null) {
42
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Class2EditPart.VISUAL_ID);
43
			view.setType(semanticHint);
44
		}
45
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(ClassNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
53
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(ClassAttributesEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
54
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(ClassOperationsEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
55
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(ClassClassesEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
56
	}
57
58
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLNewDiagramFileWizard.java (+264 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import java.io.IOException;
4
import java.util.Collections;
5
import java.util.LinkedList;
6
import java.util.List;
7
8
import org.eclipse.core.commands.ExecutionException;
9
import org.eclipse.core.commands.operations.OperationHistoryFactory;
10
import org.eclipse.core.resources.IContainer;
11
import org.eclipse.core.resources.IFile;
12
import org.eclipse.core.runtime.CoreException;
13
import org.eclipse.core.runtime.IAdaptable;
14
import org.eclipse.core.runtime.IProgressMonitor;
15
import org.eclipse.core.runtime.NullProgressMonitor;
16
import org.eclipse.core.runtime.Path;
17
import org.eclipse.emf.common.util.URI;
18
import org.eclipse.emf.ecore.EObject;
19
import org.eclipse.emf.ecore.resource.Resource;
20
import org.eclipse.emf.ecore.resource.ResourceSet;
21
import org.eclipse.emf.ecore.util.FeatureMap;
22
import org.eclipse.emf.edit.provider.IWrapperItemProvider;
23
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
24
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
25
import org.eclipse.emf.transaction.TransactionalEditingDomain;
26
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
27
import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
28
import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
29
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
30
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
31
import org.eclipse.gmf.runtime.notation.Diagram;
32
import org.eclipse.jface.viewers.ISelectionChangedListener;
33
import org.eclipse.jface.viewers.IStructuredSelection;
34
import org.eclipse.jface.viewers.SelectionChangedEvent;
35
import org.eclipse.jface.viewers.StructuredSelection;
36
import org.eclipse.jface.viewers.TreeViewer;
37
import org.eclipse.jface.wizard.Wizard;
38
import org.eclipse.jface.wizard.WizardPage;
39
import org.eclipse.swt.SWT;
40
import org.eclipse.swt.layout.GridData;
41
import org.eclipse.swt.layout.GridLayout;
42
import org.eclipse.swt.widgets.Composite;
43
import org.eclipse.swt.widgets.Label;
44
import org.eclipse.ui.IWorkbenchPage;
45
import org.eclipse.ui.PartInitException;
46
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
47
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
48
49
/**
50
 * @generated
51
 */
52
public class UMLNewDiagramFileWizard extends Wizard {
53
54
	/**
55
	 * @generated
56
	 */
57
	private TransactionalEditingDomain myEditingDomain;
58
59
	/**
60
	 * @generated
61
	 */
62
	private WizardNewFileCreationPage myFileCreationPage;
63
64
	/**
65
	 * @generated
66
	 */
67
	private IFile mySelectedModelFile;
68
69
	/**
70
	 * @generated
71
	 */
72
	private IWorkbenchPage myWorkbenchPage;
73
74
	/**
75
	 * @generated
76
	 */
77
	private IStructuredSelection mySelection;
78
79
	/**
80
	 * @generated
81
	 */
82
	private EObject myDiagramRoot;
83
84
	/**
85
	 * @generated
86
	 */
87
	public UMLNewDiagramFileWizard(IFile selectedModelFile, IWorkbenchPage workbenchPage, IStructuredSelection selection, EObject diagramRoot, TransactionalEditingDomain editingDomain) {
88
		assert selectedModelFile != null : "Null selectedModelFile in UMLNewDiagramFileWizard constructor"; //$NON-NLS-1$
89
		assert workbenchPage != null : "Null workbenchPage in UMLNewDiagramFileWizard constructor"; //$NON-NLS-1$
90
		assert selection != null : "Null selection in UMLNewDiagramFileWizard constructor"; //$NON-NLS-1$
91
		assert diagramRoot != null : "Null diagramRoot in UMLNewDiagramFileWizard constructor"; //$NON-NLS-1$
92
		assert editingDomain != null : "Null editingDomain in UMLNewDiagramFileWizard constructor"; //$NON-NLS-1$
93
94
		mySelectedModelFile = selectedModelFile;
95
		myWorkbenchPage = workbenchPage;
96
		mySelection = selection;
97
		myDiagramRoot = diagramRoot;
98
		myEditingDomain = editingDomain;
99
	}
100
101
	/**
102
	 * @generated
103
	 */
104
	public void addPages() {
105
		myFileCreationPage = new WizardNewFileCreationPage("Initialize new Ecore diagram file", mySelection) {
106
107
			public void createControl(Composite parent) {
108
				super.createControl(parent);
109
110
				IContainer parentContainer = mySelectedModelFile.getParent();
111
				String originalFileName = mySelectedModelFile.getProjectRelativePath().removeFileExtension().lastSegment();
112
				String fileExtension = ".umlclass_diagram"; //$NON-NLS-1$
113
				String fileName = originalFileName + fileExtension;
114
				for (int i = 1; parentContainer.getFile(new Path(fileName)).exists(); i++) {
115
					fileName = originalFileName + i + fileExtension;
116
				}
117
				setFileName(fileName);
118
			}
119
120
		};
121
		myFileCreationPage.setTitle("Diagram file");
122
		myFileCreationPage.setDescription("Create new diagram based on " + PackageEditPart.MODEL_ID + " model content");
123
		addPage(myFileCreationPage);
124
		addPage(new RootElementSelectorPage());
125
	}
126
127
	/**
128
	 * @generated
129
	 */
130
	public boolean performFinish() {
131
		IFile diagramFile = myFileCreationPage.createNewFile();
132
		try {
133
			diagramFile.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$
134
		} catch (CoreException e) {
135
			UMLDiagramEditorPlugin.getInstance().logError("Unable to set charset for diagram file", e); //$NON-NLS-1$
136
		}
137
138
		ResourceSet resourceSet = myEditingDomain.getResourceSet();
139
		final Resource diagramResource = resourceSet.createResource(URI.createPlatformResourceURI(diagramFile.getFullPath().toString()));
140
141
		List affectedFiles = new LinkedList();
142
		affectedFiles.add(mySelectedModelFile);
143
		affectedFiles.add(diagramFile);
144
145
		AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, "Initializing diagram contents", affectedFiles) { //$NON-NLS-1$
146
147
			protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
148
				int diagramVID = UMLVisualIDRegistry.getDiagramVisualID(myDiagramRoot);
149
				if (diagramVID != PackageEditPart.VISUAL_ID) {
150
					return CommandResult.newErrorCommandResult("Incorrect model object stored as a root resource object"); //$NON-NLS-1$
151
				}
152
				Diagram diagram = ViewService.createDiagram(myDiagramRoot, PackageEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
153
				diagramResource.getContents().add(diagram);
154
				return CommandResult.newOKCommandResult();
155
			}
156
		};
157
158
		try {
159
			OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
160
			diagramResource.save(Collections.EMPTY_MAP);
161
			UMLDiagramEditorUtil.openDiagramEditor(myWorkbenchPage, diagramFile);
162
		} catch (ExecutionException e) {
163
			UMLDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
164
		} catch (IOException ex) {
165
			UMLDiagramEditorPlugin.getInstance().logError("Save operation failed for: " + diagramFile.getFullPath().toString(), ex); //$NON-NLS-1$
166
		} catch (PartInitException ex) {
167
			UMLDiagramEditorPlugin.getInstance().logError("Unable to open editor", ex); //$NON-NLS-1$
168
		}
169
		return true;
170
	}
171
172
	/**
173
	 * @generated
174
	 */
175
	private class RootElementSelectorPage extends WizardPage implements ISelectionChangedListener {
176
177
		/**
178
		 * @generated
179
		 */
180
		protected RootElementSelectorPage() {
181
			super("Select diagram root element");
182
			setTitle("Diagram root element");
183
			setDescription("Select semantic model element to be depicted on diagram");
184
		}
185
186
		/**
187
		 * @generated
188
		 */
189
		public void createControl(Composite parent) {
190
			initializeDialogUnits(parent);
191
			Composite topLevel = new Composite(parent, SWT.NONE);
192
			topLevel.setLayout(new GridLayout());
193
			topLevel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
194
			topLevel.setFont(parent.getFont());
195
			setControl(topLevel);
196
			createModelBrowser(topLevel);
197
			setPageComplete(validatePage());
198
		}
199
200
		/**
201
		 * @generated
202
		 */
203
		private void createModelBrowser(Composite parent) {
204
			Composite panel = new Composite(parent, SWT.NONE);
205
			panel.setLayoutData(new GridData(GridData.FILL_BOTH));
206
			GridLayout layout = new GridLayout();
207
			layout.marginWidth = 0;
208
			panel.setLayout(layout);
209
210
			Label label = new Label(panel, SWT.NONE);
211
			label.setText("Select diagram root element:");
212
			label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
213
214
			TreeViewer treeViewer = new TreeViewer(panel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
215
			GridData layoutData = new GridData(GridData.FILL_BOTH);
216
			layoutData.heightHint = 300;
217
			layoutData.widthHint = 300;
218
			treeViewer.getTree().setLayoutData(layoutData);
219
			treeViewer.setContentProvider(new AdapterFactoryContentProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
220
			treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
221
			treeViewer.setInput(myDiagramRoot.eResource());
222
			treeViewer.setSelection(new StructuredSelection(myDiagramRoot));
223
			treeViewer.addSelectionChangedListener(this);
224
		}
225
226
		/**
227
		 * @generated
228
		 */
229
		public void selectionChanged(SelectionChangedEvent event) {
230
			myDiagramRoot = null;
231
			if (event.getSelection() instanceof IStructuredSelection) {
232
				IStructuredSelection selection = (IStructuredSelection) event.getSelection();
233
				if (selection.size() == 1) {
234
					Object selectedElement = selection.getFirstElement();
235
					if (selectedElement instanceof IWrapperItemProvider) {
236
						selectedElement = ((IWrapperItemProvider) selectedElement).getValue();
237
					}
238
					if (selectedElement instanceof FeatureMap.Entry) {
239
						selectedElement = ((FeatureMap.Entry) selectedElement).getValue();
240
					}
241
					if (selectedElement instanceof EObject) {
242
						myDiagramRoot = (EObject) selectedElement;
243
					}
244
				}
245
			}
246
			setPageComplete(validatePage());
247
		}
248
249
		/**
250
		 * @generated
251
		 */
252
		private boolean validatePage() {
253
			if (myDiagramRoot == null) {
254
				setErrorMessage("No diagram root element selected");
255
				return false;
256
			}
257
			boolean result = ViewService.getInstance().provides(
258
					new CreateDiagramViewOperation(new EObjectAdapter(myDiagramRoot), PackageEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT));
259
			setErrorMessage(result ? null : "Invalid diagram root element was selected");
260
			return result;
261
		}
262
263
	}
264
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/ConstraintViewFactory.java (+54 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintCompartmentEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintNameEditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class ConstraintViewFactory extends AbstractShapeViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
29
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
30
		styles.add(NotationFactory.eINSTANCE.createFillStyle());
31
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
45
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
46
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
47
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
48
			view.getEAnnotations().add(shortcutAnnotation);
49
		}
50
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(ConstraintNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
51
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(ConstraintCompartmentEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
52
	}
53
54
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PackagePackagesViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class PackagePackagesViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.PackagePackagesEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PrimitiveTypeOperationsViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class PrimitiveTypeOperationsViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeOperationsEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/PrimitiveTypeEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class PrimitiveTypeEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)build.properties (+7 lines)
Added Link Here
1
bin.includes = .,\
2
               META-INF/,\
3
               plugin.xml,\
4
               plugin.properties
5
jars.compile.order = .
6
source.. = src/
7
output.. = bin/
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/ConstraintEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class ConstraintEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/providers/UMLParserProvider.java (+1185 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.providers;
2
3
import org.eclipse.core.runtime.IAdaptable;
4
import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
5
import org.eclipse.gmf.runtime.common.core.service.IOperation;
6
import org.eclipse.gmf.runtime.common.ui.services.parser.GetParserOperation;
7
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
8
import org.eclipse.gmf.runtime.common.ui.services.parser.IParserProvider;
9
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassEditPart;
12
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassNameEditPart;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName2EditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName3EditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName4EditPart;
16
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName5EditPart;
17
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName6EditPart;
18
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName7EditPart;
19
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationNameEditPart;
20
import org.eclipse.uml2.diagram.clazz.edit.parts.Class3EditPart;
21
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassEditPart;
22
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassNameEditPart;
23
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintNameEditPart;
24
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeEditPart;
25
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeNameEditPart;
26
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyName2EditPart;
27
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyNameEditPart;
28
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationEditPart;
29
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationLiteralEditPart;
30
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationNameEditPart;
31
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationEditPart;
32
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationNameEditPart;
33
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceNameEditPart;
34
import org.eclipse.uml2.diagram.clazz.edit.parts.LiteralStringEditPart;
35
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation2EditPart;
36
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation3EditPart;
37
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation4EditPart;
38
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation5EditPart;
39
import org.eclipse.uml2.diagram.clazz.edit.parts.OperationEditPart;
40
import org.eclipse.uml2.diagram.clazz.edit.parts.Package3EditPart;
41
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageNameEditPart;
42
import org.eclipse.uml2.diagram.clazz.edit.parts.PortNameEditPart;
43
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeEditPart;
44
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeNameEditPart;
45
import org.eclipse.uml2.diagram.clazz.edit.parts.Property2EditPart;
46
import org.eclipse.uml2.diagram.clazz.edit.parts.Property3EditPart;
47
import org.eclipse.uml2.diagram.clazz.edit.parts.Property4EditPart;
48
import org.eclipse.uml2.diagram.clazz.edit.parts.Property5EditPart;
49
import org.eclipse.uml2.diagram.clazz.edit.parts.PropertyEditPart;
50
import org.eclipse.uml2.diagram.clazz.edit.parts.PropertyNameEditPart;
51
import org.eclipse.uml2.diagram.clazz.edit.parts.SlotEditPart;
52
import org.eclipse.uml2.diagram.clazz.expressions.UMLOCLFactory;
53
import org.eclipse.uml2.diagram.clazz.parser.association.end.AssociationEndApplyStrategy;
54
import org.eclipse.uml2.diagram.clazz.parser.association.end.AssociationEndParser;
55
import org.eclipse.uml2.diagram.clazz.parser.association.end.AssociationEndToString;
56
import org.eclipse.uml2.diagram.clazz.parser.association.name.AssociationNameParser;
57
import org.eclipse.uml2.diagram.clazz.parser.association.name.AssociationNameToString;
58
import org.eclipse.uml2.diagram.clazz.parser.instance.InstanceSpecificationParser;
59
import org.eclipse.uml2.diagram.clazz.parser.instance.InstanceSpecificationToString;
60
import org.eclipse.uml2.diagram.clazz.parser.operation.OperationInplaceApplier;
61
import org.eclipse.uml2.diagram.clazz.parser.operation.OperationParser;
62
import org.eclipse.uml2.diagram.clazz.parser.operation.OperationToString;
63
import org.eclipse.uml2.diagram.clazz.parser.property.PropertyParser;
64
import org.eclipse.uml2.diagram.clazz.parser.property.PropertyToString;
65
import org.eclipse.uml2.diagram.clazz.parser.slot.SlotParser;
66
import org.eclipse.uml2.diagram.clazz.parser.slot.SlotToString;
67
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
68
import org.eclipse.uml2.diagram.common.parser.port.PortParser;
69
import org.eclipse.uml2.diagram.common.parser.port.PortToString;
70
import org.eclipse.uml2.diagram.parser.BasicApplyStrategy;
71
import org.eclipse.uml2.diagram.parser.ParserAdapter;
72
import org.eclipse.uml2.diagram.parser.SemanticParserAdapter;
73
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
74
import org.eclipse.uml2.diagram.parser.lookup.LookupSuiteImpl;
75
import org.eclipse.uml2.diagram.parser.lookup.OCLLookup;
76
import org.eclipse.uml2.uml.Type;
77
import org.eclipse.uml2.uml.UMLPackage;
78
79
/**
80
 * @generated
81
 */
82
public class UMLParserProvider extends AbstractProvider implements IParserProvider {
83
84
	public static final OCLLookup<Type> TYPE_LOOKUP = new OCLLookup<Type>(//
85
			UMLOCLFactory.getOCLLookupExpression("self.getNearestPackage().ownedType", UMLPackage.eINSTANCE.getNamedElement()), // 
86
			new IElementType[] { //
87
			/*
88
			 UMLElementTypes.Class_2001, // 
89
			 UMLElementTypes.DataType_2004, // 
90
			 UMLElementTypes.Enumeration_2003, // 
91
			 UMLElementTypes.PrimitiveType_2005, //
92
			 */
93
			});
94
95
	/**
96
	 * @generated
97
	 */
98
	private IParser propertyProperty_3001Parser;
99
100
	/**
101
	 * @generated
102
	 */
103
	private IParser getPropertyProperty_3001Parser() {
104
		if (propertyProperty_3001Parser == null) {
105
			propertyProperty_3001Parser = createPropertyProperty_3001Parser();
106
		}
107
		return propertyProperty_3001Parser;
108
	}
109
110
	/**
111
	 * @generated NOT
112
	 */
113
	protected IParser createPropertyProperty_3001Parser() {
114
		LookupSuiteImpl lookupSuite = new LookupSuiteImpl();
115
		lookupSuite.addLookup(Type.class, TYPE_LOOKUP);
116
117
		return new SemanticParserAdapter(new PropertyParser(lookupSuite), new BasicApplyStrategy(), new PropertyToString.VIEW(), new PropertyToString.EDIT());
118
	}
119
120
	/**
121
	 * @generated
122
	 */
123
	private IParser operationOperation_3002Parser;
124
125
	/**
126
	 * @generated
127
	 */
128
	private IParser getOperationOperation_3002Parser() {
129
		if (operationOperation_3002Parser == null) {
130
			operationOperation_3002Parser = createOperationOperation_3002Parser();
131
		}
132
		return operationOperation_3002Parser;
133
	}
134
135
	/**
136
	 * @generated NOT
137
	 */
138
	protected IParser createOperationOperation_3002Parser() {
139
		return createOperationParser();
140
	}
141
142
	protected IParser createOperationParser() {
143
		LookupSuiteImpl lookupSuite = new LookupSuiteImpl();
144
		lookupSuite.addLookup(Type.class, TYPE_LOOKUP);
145
146
		return new SemanticParserAdapter(new OperationParser(lookupSuite), new OperationInplaceApplier(), new OperationToString.VIEW(), new OperationToString.EDIT());
147
	}
148
149
	/**
150
	 * @generated
151
	 */
152
	private IParser classClass_3003Parser;
153
154
	/**
155
	 * @generated
156
	 */
157
	private IParser getClassClass_3003Parser() {
158
		if (classClass_3003Parser == null) {
159
			classClass_3003Parser = createClassClass_3003Parser();
160
		}
161
		return classClass_3003Parser;
162
	}
163
164
	/**
165
	 * @generated
166
	 */
167
	protected IParser createClassClass_3003Parser() {
168
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
169
		return parser;
170
	}
171
172
	/**
173
	 * @generated
174
	 */
175
	private IParser portPortName_5013Parser;
176
177
	/**
178
	 * @generated
179
	 */
180
	private IParser getPortPortName_5013Parser() {
181
		if (portPortName_5013Parser == null) {
182
			portPortName_5013Parser = createPortPortName_5013Parser();
183
		}
184
		return portPortName_5013Parser;
185
	}
186
187
	/**
188
	 * @generated NOT
189
	 */
190
	protected IParser createPortPortName_5013Parser() {
191
		LookupSuiteImpl lookupSuite = new LookupSuiteImpl();
192
		lookupSuite.addLookup(Type.class, TYPE_LOOKUP);
193
194
		return new SemanticParserAdapter(new PortParser(lookupSuite), new BasicApplyStrategy(), new PortToString());
195
	}
196
197
	/**
198
	 * @generated
199
	 */
200
	private IParser literalStringLiteralString_3005Parser;
201
202
	/**
203
	 * @generated
204
	 */
205
	private IParser getLiteralStringLiteralString_3005Parser() {
206
		if (literalStringLiteralString_3005Parser == null) {
207
			literalStringLiteralString_3005Parser = createLiteralStringLiteralString_3005Parser();
208
		}
209
		return literalStringLiteralString_3005Parser;
210
	}
211
212
	/**
213
	 * @generated
214
	 */
215
	protected IParser createLiteralStringLiteralString_3005Parser() {
216
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getLiteralString_Value());
217
		return parser;
218
	}
219
220
	/**
221
	 * @generated
222
	 */
223
	private IParser propertyProperty_3019Parser;
224
225
	/**
226
	 * @generated
227
	 */
228
	private IParser getPropertyProperty_3019Parser() {
229
		if (propertyProperty_3019Parser == null) {
230
			propertyProperty_3019Parser = createPropertyProperty_3019Parser();
231
		}
232
		return propertyProperty_3019Parser;
233
	}
234
235
	/**
236
	 * @generated
237
	 */
238
	protected IParser createPropertyProperty_3019Parser() {
239
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
240
		return parser;
241
	}
242
243
	/**
244
	 * @generated
245
	 */
246
	private IParser operationOperation_3020Parser;
247
248
	/**
249
	 * @generated
250
	 */
251
	private IParser getOperationOperation_3020Parser() {
252
		if (operationOperation_3020Parser == null) {
253
			operationOperation_3020Parser = createOperationOperation_3020Parser();
254
		}
255
		return operationOperation_3020Parser;
256
	}
257
258
	/**
259
	 * @generated NOT
260
	 */
261
	protected IParser createOperationOperation_3020Parser() {
262
		return createOperationParser();
263
	}
264
265
	/**
266
	 * @generated
267
	 */
268
	private IParser packagePackage_3006Parser;
269
270
	/**
271
	 * @generated
272
	 */
273
	private IParser getPackagePackage_3006Parser() {
274
		if (packagePackage_3006Parser == null) {
275
			packagePackage_3006Parser = createPackagePackage_3006Parser();
276
		}
277
		return packagePackage_3006Parser;
278
	}
279
280
	/**
281
	 * @generated
282
	 */
283
	protected IParser createPackagePackage_3006Parser() {
284
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
285
		return parser;
286
	}
287
288
	/**
289
	 * @generated
290
	 */
291
	private IParser classClass_3007Parser;
292
293
	/**
294
	 * @generated
295
	 */
296
	private IParser getClassClass_3007Parser() {
297
		if (classClass_3007Parser == null) {
298
			classClass_3007Parser = createClassClass_3007Parser();
299
		}
300
		return classClass_3007Parser;
301
	}
302
303
	/**
304
	 * @generated
305
	 */
306
	protected IParser createClassClass_3007Parser() {
307
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
308
		return parser;
309
	}
310
311
	/**
312
	 * @generated
313
	 */
314
	private IParser dataTypeDataType_3008Parser;
315
316
	/**
317
	 * @generated
318
	 */
319
	private IParser getDataTypeDataType_3008Parser() {
320
		if (dataTypeDataType_3008Parser == null) {
321
			dataTypeDataType_3008Parser = createDataTypeDataType_3008Parser();
322
		}
323
		return dataTypeDataType_3008Parser;
324
	}
325
326
	/**
327
	 * @generated
328
	 */
329
	protected IParser createDataTypeDataType_3008Parser() {
330
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
331
		return parser;
332
	}
333
334
	/**
335
	 * @generated
336
	 */
337
	private IParser primitiveTypePrimitiveType_3009Parser;
338
339
	/**
340
	 * @generated
341
	 */
342
	private IParser getPrimitiveTypePrimitiveType_3009Parser() {
343
		if (primitiveTypePrimitiveType_3009Parser == null) {
344
			primitiveTypePrimitiveType_3009Parser = createPrimitiveTypePrimitiveType_3009Parser();
345
		}
346
		return primitiveTypePrimitiveType_3009Parser;
347
	}
348
349
	/**
350
	 * @generated
351
	 */
352
	protected IParser createPrimitiveTypePrimitiveType_3009Parser() {
353
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
354
		return parser;
355
	}
356
357
	/**
358
	 * @generated
359
	 */
360
	private IParser enumerationEnumeration_3011Parser;
361
362
	/**
363
	 * @generated
364
	 */
365
	private IParser getEnumerationEnumeration_3011Parser() {
366
		if (enumerationEnumeration_3011Parser == null) {
367
			enumerationEnumeration_3011Parser = createEnumerationEnumeration_3011Parser();
368
		}
369
		return enumerationEnumeration_3011Parser;
370
	}
371
372
	/**
373
	 * @generated
374
	 */
375
	protected IParser createEnumerationEnumeration_3011Parser() {
376
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
377
		return parser;
378
	}
379
380
	/**
381
	 * @generated
382
	 */
383
	private IParser associationClassAssociationClass_3012Parser;
384
385
	/**
386
	 * @generated
387
	 */
388
	private IParser getAssociationClassAssociationClass_3012Parser() {
389
		if (associationClassAssociationClass_3012Parser == null) {
390
			associationClassAssociationClass_3012Parser = createAssociationClassAssociationClass_3012Parser();
391
		}
392
		return associationClassAssociationClass_3012Parser;
393
	}
394
395
	/**
396
	 * @generated
397
	 */
398
	protected IParser createAssociationClassAssociationClass_3012Parser() {
399
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
400
		return parser;
401
	}
402
403
	/**
404
	 * @generated
405
	 */
406
	private IParser instanceSpecificationInstanceSpecification_3013Parser;
407
408
	/**
409
	 * @generated
410
	 */
411
	private IParser getInstanceSpecificationInstanceSpecification_3013Parser() {
412
		if (instanceSpecificationInstanceSpecification_3013Parser == null) {
413
			instanceSpecificationInstanceSpecification_3013Parser = createInstanceSpecificationInstanceSpecification_3013Parser();
414
		}
415
		return instanceSpecificationInstanceSpecification_3013Parser;
416
	}
417
418
	/**
419
	 * @generated NOT
420
	 */
421
	protected IParser createInstanceSpecificationInstanceSpecification_3013Parser() {
422
		return createInstanceSpecificationParser();
423
	}
424
425
	/**
426
	 * @generated
427
	 */
428
	private IParser propertyProperty_3014Parser;
429
430
	/**
431
	 * @generated
432
	 */
433
	private IParser getPropertyProperty_3014Parser() {
434
		if (propertyProperty_3014Parser == null) {
435
			propertyProperty_3014Parser = createPropertyProperty_3014Parser();
436
		}
437
		return propertyProperty_3014Parser;
438
	}
439
440
	/**
441
	 * @generated
442
	 */
443
	protected IParser createPropertyProperty_3014Parser() {
444
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
445
		return parser;
446
	}
447
448
	/**
449
	 * @generated
450
	 */
451
	private IParser operationOperation_3015Parser;
452
453
	/**
454
	 * @generated
455
	 */
456
	private IParser getOperationOperation_3015Parser() {
457
		if (operationOperation_3015Parser == null) {
458
			operationOperation_3015Parser = createOperationOperation_3015Parser();
459
		}
460
		return operationOperation_3015Parser;
461
	}
462
463
	/**
464
	 * @generated NOT
465
	 */
466
	protected IParser createOperationOperation_3015Parser() {
467
		return createOperationParser();
468
	}
469
470
	/**
471
	 * @generated
472
	 */
473
	private IParser propertyProperty_3021Parser;
474
475
	/**
476
	 * @generated
477
	 */
478
	private IParser getPropertyProperty_3021Parser() {
479
		if (propertyProperty_3021Parser == null) {
480
			propertyProperty_3021Parser = createPropertyProperty_3021Parser();
481
		}
482
		return propertyProperty_3021Parser;
483
	}
484
485
	/**
486
	 * @generated
487
	 */
488
	protected IParser createPropertyProperty_3021Parser() {
489
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
490
		return parser;
491
	}
492
493
	/**
494
	 * @generated
495
	 */
496
	private IParser operationOperation_3022Parser;
497
498
	/**
499
	 * @generated
500
	 */
501
	private IParser getOperationOperation_3022Parser() {
502
		if (operationOperation_3022Parser == null) {
503
			operationOperation_3022Parser = createOperationOperation_3022Parser();
504
		}
505
		return operationOperation_3022Parser;
506
	}
507
508
	/**
509
	 * @generated NOT
510
	 */
511
	protected IParser createOperationOperation_3022Parser() {
512
		return createOperationParser();
513
	}
514
515
	/**
516
	 * @generated
517
	 */
518
	private IParser enumerationLiteralEnumerationLiteral_3016Parser;
519
520
	/**
521
	 * @generated
522
	 */
523
	private IParser getEnumerationLiteralEnumerationLiteral_3016Parser() {
524
		if (enumerationLiteralEnumerationLiteral_3016Parser == null) {
525
			enumerationLiteralEnumerationLiteral_3016Parser = createEnumerationLiteralEnumerationLiteral_3016Parser();
526
		}
527
		return enumerationLiteralEnumerationLiteral_3016Parser;
528
	}
529
530
	/**
531
	 * @generated
532
	 */
533
	protected IParser createEnumerationLiteralEnumerationLiteral_3016Parser() {
534
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
535
		return parser;
536
	}
537
538
	/**
539
	 * @generated
540
	 */
541
	private IParser propertyProperty_3023Parser;
542
543
	/**
544
	 * @generated
545
	 */
546
	private IParser getPropertyProperty_3023Parser() {
547
		if (propertyProperty_3023Parser == null) {
548
			propertyProperty_3023Parser = createPropertyProperty_3023Parser();
549
		}
550
		return propertyProperty_3023Parser;
551
	}
552
553
	/**
554
	 * @generated
555
	 */
556
	protected IParser createPropertyProperty_3023Parser() {
557
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
558
		return parser;
559
	}
560
561
	/**
562
	 * @generated
563
	 */
564
	private IParser operationOperation_3024Parser;
565
566
	/**
567
	 * @generated
568
	 */
569
	private IParser getOperationOperation_3024Parser() {
570
		if (operationOperation_3024Parser == null) {
571
			operationOperation_3024Parser = createOperationOperation_3024Parser();
572
		}
573
		return operationOperation_3024Parser;
574
	}
575
576
	/**
577
	 * @generated NOT
578
	 */
579
	protected IParser createOperationOperation_3024Parser() {
580
		return createOperationParser();
581
	}
582
583
	/**
584
	 * @generated
585
	 */
586
	private IParser slotSlot_3017Parser;
587
588
	/**
589
	 * @generated
590
	 */
591
	private IParser getSlotSlot_3017Parser() {
592
		if (slotSlot_3017Parser == null) {
593
			slotSlot_3017Parser = createSlotSlot_3017Parser();
594
		}
595
		return slotSlot_3017Parser;
596
	}
597
598
	/**
599
	 * @generated NOT
600
	 */
601
	protected IParser createSlotSlot_3017Parser() {
602
		return new SemanticParserAdapter(new SlotParser(), new BasicApplyStrategy(), new SlotToString.VIEW(), new SlotToString.EDIT());
603
	}
604
605
	/**
606
	 * @generated
607
	 */
608
	private IParser classClassName_5003Parser;
609
610
	/**
611
	 * @generated
612
	 */
613
	private IParser getClassClassName_5003Parser() {
614
		if (classClassName_5003Parser == null) {
615
			classClassName_5003Parser = createClassClassName_5003Parser();
616
		}
617
		return classClassName_5003Parser;
618
	}
619
620
	/**
621
	 * @generated
622
	 */
623
	protected IParser createClassClassName_5003Parser() {
624
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
625
		return parser;
626
	}
627
628
	/**
629
	 * @generated
630
	 */
631
	private IParser packagePackageName_5004Parser;
632
633
	/**
634
	 * @generated
635
	 */
636
	private IParser getPackagePackageName_5004Parser() {
637
		if (packagePackageName_5004Parser == null) {
638
			packagePackageName_5004Parser = createPackagePackageName_5004Parser();
639
		}
640
		return packagePackageName_5004Parser;
641
	}
642
643
	/**
644
	 * @generated
645
	 */
646
	protected IParser createPackagePackageName_5004Parser() {
647
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
648
		return parser;
649
	}
650
651
	/**
652
	 * @generated
653
	 */
654
	private IParser enumerationEnumerationName_5005Parser;
655
656
	/**
657
	 * @generated
658
	 */
659
	private IParser getEnumerationEnumerationName_5005Parser() {
660
		if (enumerationEnumerationName_5005Parser == null) {
661
			enumerationEnumerationName_5005Parser = createEnumerationEnumerationName_5005Parser();
662
		}
663
		return enumerationEnumerationName_5005Parser;
664
	}
665
666
	/**
667
	 * @generated
668
	 */
669
	protected IParser createEnumerationEnumerationName_5005Parser() {
670
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
671
		return parser;
672
	}
673
674
	/**
675
	 * @generated
676
	 */
677
	private IParser dataTypeDataTypeName_5006Parser;
678
679
	/**
680
	 * @generated
681
	 */
682
	private IParser getDataTypeDataTypeName_5006Parser() {
683
		if (dataTypeDataTypeName_5006Parser == null) {
684
			dataTypeDataTypeName_5006Parser = createDataTypeDataTypeName_5006Parser();
685
		}
686
		return dataTypeDataTypeName_5006Parser;
687
	}
688
689
	/**
690
	 * @generated
691
	 */
692
	protected IParser createDataTypeDataTypeName_5006Parser() {
693
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
694
		return parser;
695
	}
696
697
	/**
698
	 * @generated
699
	 */
700
	private IParser primitiveTypePrimitiveTypeName_5007Parser;
701
702
	/**
703
	 * @generated
704
	 */
705
	private IParser getPrimitiveTypePrimitiveTypeName_5007Parser() {
706
		if (primitiveTypePrimitiveTypeName_5007Parser == null) {
707
			primitiveTypePrimitiveTypeName_5007Parser = createPrimitiveTypePrimitiveTypeName_5007Parser();
708
		}
709
		return primitiveTypePrimitiveTypeName_5007Parser;
710
	}
711
712
	/**
713
	 * @generated
714
	 */
715
	protected IParser createPrimitiveTypePrimitiveTypeName_5007Parser() {
716
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
717
		return parser;
718
	}
719
720
	/**
721
	 * @generated
722
	 */
723
	private IParser constraintConstraintName_5008Parser;
724
725
	/**
726
	 * @generated
727
	 */
728
	private IParser getConstraintConstraintName_5008Parser() {
729
		if (constraintConstraintName_5008Parser == null) {
730
			constraintConstraintName_5008Parser = createConstraintConstraintName_5008Parser();
731
		}
732
		return constraintConstraintName_5008Parser;
733
	}
734
735
	/**
736
	 * @generated
737
	 */
738
	protected IParser createConstraintConstraintName_5008Parser() {
739
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
740
		return parser;
741
	}
742
743
	/**
744
	 * @generated
745
	 */
746
	private IParser associationClassAssociationClassName_5009Parser;
747
748
	/**
749
	 * @generated
750
	 */
751
	private IParser getAssociationClassAssociationClassName_5009Parser() {
752
		if (associationClassAssociationClassName_5009Parser == null) {
753
			associationClassAssociationClassName_5009Parser = createAssociationClassAssociationClassName_5009Parser();
754
		}
755
		return associationClassAssociationClassName_5009Parser;
756
	}
757
758
	/**
759
	 * @generated
760
	 */
761
	protected IParser createAssociationClassAssociationClassName_5009Parser() {
762
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
763
		return parser;
764
	}
765
766
	/**
767
	 * @generated
768
	 */
769
	private IParser instanceSpecificationInstanceSpecificationName_5010Parser;
770
771
	/**
772
	 * @generated
773
	 */
774
	private IParser getInstanceSpecificationInstanceSpecificationName_5010Parser() {
775
		if (instanceSpecificationInstanceSpecificationName_5010Parser == null) {
776
			instanceSpecificationInstanceSpecificationName_5010Parser = createInstanceSpecificationInstanceSpecificationName_5010Parser();
777
		}
778
		return instanceSpecificationInstanceSpecificationName_5010Parser;
779
	}
780
781
	/**
782
	 * @generated NOT
783
	 */
784
	protected IParser createInstanceSpecificationInstanceSpecificationName_5010Parser() {
785
		return createInstanceSpecificationParser();
786
	}
787
788
	protected IParser createInstanceSpecificationParser() {
789
		LookupSuiteImpl lookupSuite = new LookupSuiteImpl();
790
		lookupSuite.addLookup(Type.class, TYPE_LOOKUP);
791
		return new SemanticParserAdapter(new InstanceSpecificationParser(lookupSuite), new BasicApplyStrategy(), new InstanceSpecificationToString.VIEW(), new InstanceSpecificationToString.EDIT());
792
	}
793
794
	/**
795
	 * @generated
796
	 */
797
	private IParser dependencyDependencyName_5011Parser;
798
799
	/**
800
	 * @generated
801
	 */
802
	private IParser getDependencyDependencyName_5011Parser() {
803
		if (dependencyDependencyName_5011Parser == null) {
804
			dependencyDependencyName_5011Parser = createDependencyDependencyName_5011Parser();
805
		}
806
		return dependencyDependencyName_5011Parser;
807
	}
808
809
	/**
810
	 * @generated
811
	 */
812
	protected IParser createDependencyDependencyName_5011Parser() {
813
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
814
		return parser;
815
	}
816
817
	/**
818
	 * @generated
819
	 */
820
	private IParser interfaceInterfaceName_5012Parser;
821
822
	/**
823
	 * @generated
824
	 */
825
	private IParser getInterfaceInterfaceName_5012Parser() {
826
		if (interfaceInterfaceName_5012Parser == null) {
827
			interfaceInterfaceName_5012Parser = createInterfaceInterfaceName_5012Parser();
828
		}
829
		return interfaceInterfaceName_5012Parser;
830
	}
831
832
	/**
833
	 * @generated
834
	 */
835
	protected IParser createInterfaceInterfaceName_5012Parser() {
836
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
837
		return parser;
838
	}
839
840
	/**
841
	 * @generated
842
	 */
843
	private IParser dependencyDependencyName_6001Parser;
844
845
	/**
846
	 * @generated
847
	 */
848
	private IParser getDependencyDependencyName_6001Parser() {
849
		if (dependencyDependencyName_6001Parser == null) {
850
			dependencyDependencyName_6001Parser = createDependencyDependencyName_6001Parser();
851
		}
852
		return dependencyDependencyName_6001Parser;
853
	}
854
855
	/**
856
	 * @generated
857
	 */
858
	protected IParser createDependencyDependencyName_6001Parser() {
859
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
860
		return parser;
861
	}
862
863
	/**
864
	 * @generated
865
	 */
866
	private IParser propertyPropertyName_6002Parser;
867
868
	/**
869
	 * @generated
870
	 */
871
	private IParser getPropertyPropertyName_6002Parser() {
872
		if (propertyPropertyName_6002Parser == null) {
873
			propertyPropertyName_6002Parser = createPropertyPropertyName_6002Parser();
874
		}
875
		return propertyPropertyName_6002Parser;
876
	}
877
878
	/**
879
	 * @generated
880
	 */
881
	protected IParser createPropertyPropertyName_6002Parser() {
882
		UMLStructuralFeatureParser parser = new UMLStructuralFeatureParser(UMLPackage.eINSTANCE.getNamedElement_Name());
883
		return parser;
884
	}
885
886
	/**
887
	 * @generated
888
	 */
889
	private IParser associationAssociationName_6003Parser;
890
891
	/**
892
	 * @generated
893
	 */
894
	private IParser getAssociationAssociationName_6003Parser() {
895
		if (associationAssociationName_6003Parser == null) {
896
			associationAssociationName_6003Parser = createAssociationAssociationName_6003Parser();
897
		}
898
		return associationAssociationName_6003Parser;
899
	}
900
901
	/**
902
	 * @generated NOT
903
	 */
904
	protected IParser createAssociationAssociationName_6003Parser() {
905
		LookupSuite lookupSuite = LookupSuite.NULL_SUITE;
906
		return new ParserAdapter(new AssociationNameParser(lookupSuite), new BasicApplyStrategy(), new AssociationNameToString.VIEW(), new AssociationNameToString.EDIT());
907
	}
908
909
	/**
910
	 * Different view's but shared common edit.
911
	 */
912
	protected IParser createAssocationRoleParser(boolean sourceNotTarget) {
913
		LookupSuite lookupSuite = getAssociationLookupSuite();
914
		return new SemanticParserAdapter(new AssociationEndParser(lookupSuite), new AssociationEndApplyStrategy(sourceNotTarget), new AssociationEndToString.ROLE_VIEW(sourceNotTarget),
915
				new AssociationEndToString.EDIT(sourceNotTarget));
916
	}
917
918
	protected IParser createAssocationModifiersParser(boolean sourceNotTarget) {
919
		LookupSuite lookupSuite = getAssociationLookupSuite();
920
		return new SemanticParserAdapter(new AssociationEndParser(lookupSuite), new AssociationEndApplyStrategy(sourceNotTarget), new AssociationEndToString.MODIFIERS_VIEW(sourceNotTarget),
921
				new AssociationEndToString.EDIT(sourceNotTarget));
922
	}
923
924
	protected IParser createAssocationMultiplicityParser(boolean sourceNotTarget) {
925
		LookupSuite lookupSuite = getAssociationLookupSuite();
926
		return new SemanticParserAdapter(new AssociationEndParser(lookupSuite), new AssociationEndApplyStrategy(sourceNotTarget), new AssociationEndToString.MULTIPLICITY_VIEW(sourceNotTarget),
927
				new AssociationEndToString.EDIT(sourceNotTarget));
928
	}
929
930
	protected LookupSuite getAssociationLookupSuite() {
931
		return LookupSuite.NULL_SUITE;
932
	}
933
934
	/**
935
	 * @generated
936
	 */
937
	private IParser associationAssociationName_6004Parser;
938
939
	/**
940
	 * @generated
941
	 */
942
	private IParser getAssociationAssociationName_6004Parser() {
943
		if (associationAssociationName_6004Parser == null) {
944
			associationAssociationName_6004Parser = createAssociationAssociationName_6004Parser();
945
		}
946
		return associationAssociationName_6004Parser;
947
	}
948
949
	/**
950
	 * @generated NOT
951
	 */
952
	protected IParser createAssociationAssociationName_6004Parser() {
953
		return createAssocationRoleParser(true);
954
	}
955
956
	/**
957
	 * @generated
958
	 */
959
	private IParser associationAssociationName_6005Parser;
960
961
	/**
962
	 * @generated
963
	 */
964
	private IParser getAssociationAssociationName_6005Parser() {
965
		if (associationAssociationName_6005Parser == null) {
966
			associationAssociationName_6005Parser = createAssociationAssociationName_6005Parser();
967
		}
968
		return associationAssociationName_6005Parser;
969
	}
970
971
	/**
972
	 * @generated NOT
973
	 */
974
	protected IParser createAssociationAssociationName_6005Parser() {
975
		return createAssocationRoleParser(false);
976
	}
977
978
	/**
979
	 * @generated
980
	 */
981
	private IParser associationAssociationName_6006Parser;
982
983
	/**
984
	 * @generated
985
	 */
986
	private IParser getAssociationAssociationName_6006Parser() {
987
		if (associationAssociationName_6006Parser == null) {
988
			associationAssociationName_6006Parser = createAssociationAssociationName_6006Parser();
989
		}
990
		return associationAssociationName_6006Parser;
991
	}
992
993
	/**
994
	 * @generated NOT
995
	 */
996
	protected IParser createAssociationAssociationName_6006Parser() {
997
		return createAssocationModifiersParser(true);
998
	}
999
1000
	/**
1001
	 * @generated
1002
	 */
1003
	private IParser associationAssociationName_6007Parser;
1004
1005
	/**
1006
	 * @generated
1007
	 */
1008
	private IParser getAssociationAssociationName_6007Parser() {
1009
		if (associationAssociationName_6007Parser == null) {
1010
			associationAssociationName_6007Parser = createAssociationAssociationName_6007Parser();
1011
		}
1012
		return associationAssociationName_6007Parser;
1013
	}
1014
1015
	/**
1016
	 * @generated NOT
1017
	 */
1018
	protected IParser createAssociationAssociationName_6007Parser() {
1019
		return createAssocationModifiersParser(false);
1020
	}
1021
1022
	/**
1023
	 * @generated
1024
	 */
1025
	private IParser associationAssociationName_6008Parser;
1026
1027
	/**
1028
	 * @generated
1029
	 */
1030
	private IParser getAssociationAssociationName_6008Parser() {
1031
		if (associationAssociationName_6008Parser == null) {
1032
			associationAssociationName_6008Parser = createAssociationAssociationName_6008Parser();
1033
		}
1034
		return associationAssociationName_6008Parser;
1035
	}
1036
1037
	/**
1038
	 * @generated NOT
1039
	 */
1040
	protected IParser createAssociationAssociationName_6008Parser() {
1041
		return createAssocationMultiplicityParser(true);
1042
	}
1043
1044
	/**
1045
	 * @generated
1046
	 */
1047
	private IParser associationAssociationName_6009Parser;
1048
1049
	/**
1050
	 * @generated
1051
	 */
1052
	private IParser getAssociationAssociationName_6009Parser() {
1053
		if (associationAssociationName_6009Parser == null) {
1054
			associationAssociationName_6009Parser = createAssociationAssociationName_6009Parser();
1055
		}
1056
		return associationAssociationName_6009Parser;
1057
	}
1058
1059
	/**
1060
	 * @generated NOT
1061
	 */
1062
	protected IParser createAssociationAssociationName_6009Parser() {
1063
		return createAssocationMultiplicityParser(false);
1064
	}
1065
1066
	/**
1067
	 * @generated
1068
	 */
1069
	protected IParser getParser(int visualID) {
1070
		switch (visualID) {
1071
		case Package3EditPart.VISUAL_ID:
1072
			return getPackagePackage_3006Parser();
1073
		case ClassEditPart.VISUAL_ID:
1074
			return getClassClass_3007Parser();
1075
		case DataTypeEditPart.VISUAL_ID:
1076
			return getDataTypeDataType_3008Parser();
1077
		case PrimitiveTypeEditPart.VISUAL_ID:
1078
			return getPrimitiveTypePrimitiveType_3009Parser();
1079
		case EnumerationEditPart.VISUAL_ID:
1080
			return getEnumerationEnumeration_3011Parser();
1081
		case AssociationClassEditPart.VISUAL_ID:
1082
			return getAssociationClassAssociationClass_3012Parser();
1083
		case InstanceSpecificationEditPart.VISUAL_ID:
1084
			return getInstanceSpecificationInstanceSpecification_3013Parser();
1085
		case PropertyEditPart.VISUAL_ID:
1086
			return getPropertyProperty_3001Parser();
1087
		case OperationEditPart.VISUAL_ID:
1088
			return getOperationOperation_3002Parser();
1089
		case Class3EditPart.VISUAL_ID:
1090
			return getClassClass_3003Parser();
1091
		case PortNameEditPart.VISUAL_ID:
1092
			return getPortPortName_5013Parser();
1093
		case Property2EditPart.VISUAL_ID:
1094
			return getPropertyProperty_3019Parser();
1095
		case Operation2EditPart.VISUAL_ID:
1096
			return getOperationOperation_3020Parser();
1097
		case Property3EditPart.VISUAL_ID:
1098
			return getPropertyProperty_3014Parser();
1099
		case Operation3EditPart.VISUAL_ID:
1100
			return getOperationOperation_3015Parser();
1101
		case Property4EditPart.VISUAL_ID:
1102
			return getPropertyProperty_3021Parser();
1103
		case Operation4EditPart.VISUAL_ID:
1104
			return getOperationOperation_3022Parser();
1105
		case EnumerationLiteralEditPart.VISUAL_ID:
1106
			return getEnumerationLiteralEnumerationLiteral_3016Parser();
1107
		case Property5EditPart.VISUAL_ID:
1108
			return getPropertyProperty_3023Parser();
1109
		case Operation5EditPart.VISUAL_ID:
1110
			return getOperationOperation_3024Parser();
1111
		case LiteralStringEditPart.VISUAL_ID:
1112
			return getLiteralStringLiteralString_3005Parser();
1113
		case SlotEditPart.VISUAL_ID:
1114
			return getSlotSlot_3017Parser();
1115
		case PackageNameEditPart.VISUAL_ID:
1116
			return getPackagePackageName_5004Parser();
1117
		case ClassNameEditPart.VISUAL_ID:
1118
			return getClassClassName_5003Parser();
1119
		case AssociationClassNameEditPart.VISUAL_ID:
1120
			return getAssociationClassAssociationClassName_5009Parser();
1121
		case DataTypeNameEditPart.VISUAL_ID:
1122
			return getDataTypeDataTypeName_5006Parser();
1123
		case PrimitiveTypeNameEditPart.VISUAL_ID:
1124
			return getPrimitiveTypePrimitiveTypeName_5007Parser();
1125
		case EnumerationNameEditPart.VISUAL_ID:
1126
			return getEnumerationEnumerationName_5005Parser();
1127
		case InterfaceNameEditPart.VISUAL_ID:
1128
			return getInterfaceInterfaceName_5012Parser();
1129
		case ConstraintNameEditPart.VISUAL_ID:
1130
			return getConstraintConstraintName_5008Parser();
1131
		case InstanceSpecificationNameEditPart.VISUAL_ID:
1132
			return getInstanceSpecificationInstanceSpecificationName_5010Parser();
1133
		case DependencyNameEditPart.VISUAL_ID:
1134
			return getDependencyDependencyName_5011Parser();
1135
		case DependencyName2EditPart.VISUAL_ID:
1136
			return getDependencyDependencyName_6001Parser();
1137
		case PropertyNameEditPart.VISUAL_ID:
1138
			return getPropertyPropertyName_6002Parser();
1139
		case AssociationNameEditPart.VISUAL_ID:
1140
			return getAssociationAssociationName_6003Parser();
1141
		case AssociationName2EditPart.VISUAL_ID:
1142
			return getAssociationAssociationName_6004Parser();
1143
		case AssociationName3EditPart.VISUAL_ID:
1144
			return getAssociationAssociationName_6005Parser();
1145
		case AssociationName4EditPart.VISUAL_ID:
1146
			return getAssociationAssociationName_6006Parser();
1147
		case AssociationName5EditPart.VISUAL_ID:
1148
			return getAssociationAssociationName_6007Parser();
1149
		case AssociationName6EditPart.VISUAL_ID:
1150
			return getAssociationAssociationName_6008Parser();
1151
		case AssociationName7EditPart.VISUAL_ID:
1152
			return getAssociationAssociationName_6009Parser();
1153
		}
1154
		return null;
1155
	}
1156
1157
	/**
1158
	 * @generated
1159
	 */
1160
	public IParser getParser(IAdaptable hint) {
1161
		String vid = (String) hint.getAdapter(String.class);
1162
		if (vid != null) {
1163
			return getParser(UMLVisualIDRegistry.getVisualID(vid));
1164
		}
1165
		View view = (View) hint.getAdapter(View.class);
1166
		if (view != null) {
1167
			return getParser(UMLVisualIDRegistry.getVisualID(view));
1168
		}
1169
		return null;
1170
	}
1171
1172
	/**
1173
	 * @generated
1174
	 */
1175
	public boolean provides(IOperation operation) {
1176
		if (operation instanceof GetParserOperation) {
1177
			IAdaptable hint = ((GetParserOperation) operation).getHint();
1178
			if (UMLElementTypes.getElement(hint) == null) {
1179
				return false;
1180
			}
1181
			return getParser(hint) != null;
1182
		}
1183
		return false;
1184
	}
1185
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/EnumerationAttributesViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class EnumerationAttributesViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationAttributesEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/DependencyClientEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class DependencyClientEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/GeneralizationViewFactory.java (+48 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
10
import org.eclipse.gmf.runtime.notation.NotationFactory;
11
import org.eclipse.gmf.runtime.notation.View;
12
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
13
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
14
15
/**
16
 * @generated
17
 */
18
public class GeneralizationViewFactory extends ConnectionViewFactory {
19
20
	/**
21
	 * @generated 
22
	 */
23
	protected List createStyles(View view) {
24
		List styles = new ArrayList();
25
		styles.add(NotationFactory.eINSTANCE.createRoutingStyle());
26
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
27
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
28
		return styles;
29
	}
30
31
	/**
32
	 * @generated
33
	 */
34
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
35
		if (semanticHint == null) {
36
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.GeneralizationEditPart.VISUAL_ID);
37
			view.setType(semanticHint);
38
		}
39
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
40
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
41
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
42
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
43
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
44
			view.getEAnnotations().add(shortcutAnnotation);
45
		}
46
	}
47
48
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/name/Token.java (+92 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.name;
14
15
/**
16
 * Describes the input token stream.
17
 */
18
19
public class Token {
20
21
  /**
22
   * An integer that describes the kind of this token.  This numbering
23
   * system is determined by JavaCCParser, and a table of these numbers is
24
   * stored in the file ...Constants.java.
25
   */
26
  public int kind;
27
28
  /**
29
   * beginLine and beginColumn describe the position of the first character
30
   * of this token; endLine and endColumn describe the position of the
31
   * last character of this token.
32
   */
33
  public int beginLine, beginColumn, endLine, endColumn;
34
35
  /**
36
   * The string image of the token.
37
   */
38
  public String image;
39
40
  /**
41
   * A reference to the next regular (non-special) token from the input
42
   * stream.  If this is the last token from the input stream, or if the
43
   * token manager has not read tokens beyond this one, this field is
44
   * set to null.  This is true only if this token is also a regular
45
   * token.  Otherwise, see below for a description of the contents of
46
   * this field.
47
   */
48
  public Token next;
49
50
  /**
51
   * This field is used to access special tokens that occur prior to this
52
   * token, but after the immediately preceding regular (non-special) token.
53
   * If there are no such special tokens, this field is set to null.
54
   * When there are more than one such special token, this field refers
55
   * to the last of these special tokens, which in turn refers to the next
56
   * previous special token through its specialToken field, and so on
57
   * until the first special token (whose specialToken field is null).
58
   * The next fields of special tokens refer to other special tokens that
59
   * immediately follow it (without an intervening regular token).  If there
60
   * is no such token, this field is null.
61
   */
62
  public Token specialToken;
63
64
  /**
65
   * Returns the image.
66
   */
67
  public String toString()
68
  {
69
     return image;
70
  }
71
72
  /**
73
   * Returns a new Token object, by default. However, if you want, you
74
   * can create and return subclass objects based on the value of ofKind.
75
   * Simply add the cases to the switch for all those special cases.
76
   * For example, if you have a subclass of Token called IDToken that
77
   * you want to create if ofKind is ID, simlpy add something like :
78
   *
79
   *    case MyParserConstants.ID : return new IDToken();
80
   *
81
   * to the following switch statement. Then you can cast matchedToken
82
   * variable to the appropriate type and use it in your lexical actions.
83
   */
84
  public static final Token newToken(int ofKind)
85
  {
86
     switch(ofKind)
87
     {
88
       default : return new Token();
89
     }
90
  }
91
92
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/ConstraintConstrainedElementViewFactory.java (+48 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
10
import org.eclipse.gmf.runtime.notation.NotationFactory;
11
import org.eclipse.gmf.runtime.notation.View;
12
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
13
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
14
15
/**
16
 * @generated
17
 */
18
public class ConstraintConstrainedElementViewFactory extends ConnectionViewFactory {
19
20
	/**
21
	 * @generated 
22
	 */
23
	protected List createStyles(View view) {
24
		List styles = new ArrayList();
25
		styles.add(NotationFactory.eINSTANCE.createRoutingStyle());
26
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
27
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
28
		return styles;
29
	}
30
31
	/**
32
	 * @generated
33
	 */
34
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
35
		if (semanticHint == null) {
36
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintConstrainedElementEditPart.VISUAL_ID);
37
			view.setType(semanticHint);
38
		}
39
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
40
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
41
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
42
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
43
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
44
			view.getEAnnotations().add(shortcutAnnotation);
45
		}
46
	}
47
48
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/AssociationClassEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class AssociationClassEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/Operation2EditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class Operation2EditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/instance/InstanceSpecificationParserConstants.java (+79 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. InstanceSpecificationParserConstants.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.instance;
14
15
public interface InstanceSpecificationParserConstants {
16
17
  int EOF = 0;
18
  int SLASH = 3;
19
  int COLON = 4;
20
  int EQUALS = 5;
21
  int LBRACKET = 6;
22
  int RBRACKET = 7;
23
  int LCURLY = 8;
24
  int RCURLY = 9;
25
  int COMMA = 10;
26
  int PLUS = 11;
27
  int MINUS = 12;
28
  int NUMBER_SIGN = 13;
29
  int TILDE = 14;
30
  int DOT = 15;
31
  int STAR = 16;
32
  int READ_ONLY = 17;
33
  int UNION = 18;
34
  int SUBSETS = 19;
35
  int REDEFINES = 20;
36
  int ORDERED = 21;
37
  int UNORDERED = 22;
38
  int UNIQUE = 23;
39
  int NON_UNIQUE = 24;
40
  int INTEGER_LITERAL = 25;
41
  int IDENTIFIER = 26;
42
  int LETTER = 27;
43
  int DIGIT = 28;
44
45
  int DEFAULT = 0;
46
47
  String[] tokenImage = {
48
    "<EOF>",
49
    "\" \"",
50
    "\"\\t\"",
51
    "\"/\"",
52
    "\":\"",
53
    "\"=\"",
54
    "\"[\"",
55
    "\"]\"",
56
    "\"{\"",
57
    "\"}\"",
58
    "\",\"",
59
    "\"+\"",
60
    "\"-\"",
61
    "\"#\"",
62
    "\"~\"",
63
    "\".\"",
64
    "\"*\"",
65
    "\"readOnly\"",
66
    "\"union\"",
67
    "\"subsets\"",
68
    "\"redefines\"",
69
    "\"ordered\"",
70
    "\"unordered\"",
71
    "\"unique\"",
72
    "\"nonunique\"",
73
    "<INTEGER_LITERAL>",
74
    "<IDENTIFIER>",
75
    "<LETTER>",
76
    "<DIGIT>",
77
  };
78
79
}
(-)src/org/eclipse/uml2/diagram/clazz/providers/UMLPaletteProvider.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.providers;
2
3
import java.util.Map;
4
5
import org.eclipse.core.runtime.IConfigurationElement;
6
import org.eclipse.gef.palette.PaletteRoot;
7
import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
8
import org.eclipse.gmf.runtime.common.core.service.IOperation;
9
import org.eclipse.gmf.runtime.diagram.ui.services.palette.IPaletteProvider;
10
import org.eclipse.ui.IEditorPart;
11
import org.eclipse.uml2.diagram.clazz.part.UMLPaletteFactory;
12
13
/**
14
 * @generated
15
 */
16
public class UMLPaletteProvider extends AbstractProvider implements IPaletteProvider {
17
18
	/**
19
	 * @generated
20
	 */
21
	public void contributeToPalette(IEditorPart editor, Object content, PaletteRoot root, Map predefinedEntries) {
22
		UMLPaletteFactory factory = new UMLPaletteFactory();
23
		factory.fillPalette(root);
24
	}
25
26
	/**
27
	 * @generated
28
	 */
29
	public void setContributions(IConfigurationElement configElement) {
30
		// no configuration
31
	}
32
33
	/**
34
	 * @generated
35
	 */
36
	public boolean provides(IOperation operation) {
37
		return false; // all logic is done in the service
38
	}
39
}
(-)src/org/eclipse/uml2/diagram/clazz/navigator/UMLNavigatorContentProvider.java (+1403 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.navigator;
2
3
import java.util.ArrayList;
4
import java.util.Collection;
5
import java.util.HashMap;
6
import java.util.HashSet;
7
import java.util.Iterator;
8
import java.util.List;
9
import java.util.Set;
10
11
import org.eclipse.core.resources.IFile;
12
import org.eclipse.emf.common.util.URI;
13
import org.eclipse.emf.ecore.resource.Resource;
14
import org.eclipse.emf.ecore.resource.ResourceSet;
15
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
16
import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
17
import org.eclipse.gmf.runtime.notation.Edge;
18
import org.eclipse.gmf.runtime.notation.Node;
19
import org.eclipse.gmf.runtime.notation.View;
20
import org.eclipse.jface.viewers.Viewer;
21
import org.eclipse.ui.IMemento;
22
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
23
import org.eclipse.ui.navigator.ICommonContentProvider;
24
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClass2EditPart;
25
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassEditPart;
26
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationEditPart;
27
import org.eclipse.uml2.diagram.clazz.edit.parts.Class2EditPart;
28
import org.eclipse.uml2.diagram.clazz.edit.parts.Class3EditPart;
29
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassEditPart;
30
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintConstrainedElementEditPart;
31
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintEditPart;
32
import org.eclipse.uml2.diagram.clazz.edit.parts.DataType2EditPart;
33
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeEditPart;
34
import org.eclipse.uml2.diagram.clazz.edit.parts.Dependency2EditPart;
35
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyClientEditPart;
36
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyEditPart;
37
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencySupplierEditPart;
38
import org.eclipse.uml2.diagram.clazz.edit.parts.Enumeration2EditPart;
39
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationEditPart;
40
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationLiteralEditPart;
41
import org.eclipse.uml2.diagram.clazz.edit.parts.GeneralizationEditPart;
42
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecification2EditPart;
43
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationEditPart;
44
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceEditPart;
45
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceRealizationEditPart;
46
import org.eclipse.uml2.diagram.clazz.edit.parts.LiteralStringEditPart;
47
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation2EditPart;
48
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation3EditPart;
49
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation4EditPart;
50
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation5EditPart;
51
import org.eclipse.uml2.diagram.clazz.edit.parts.OperationEditPart;
52
import org.eclipse.uml2.diagram.clazz.edit.parts.Package2EditPart;
53
import org.eclipse.uml2.diagram.clazz.edit.parts.Package3EditPart;
54
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
55
import org.eclipse.uml2.diagram.clazz.edit.parts.PortEditPart;
56
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveType2EditPart;
57
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeEditPart;
58
import org.eclipse.uml2.diagram.clazz.edit.parts.Property2EditPart;
59
import org.eclipse.uml2.diagram.clazz.edit.parts.Property3EditPart;
60
import org.eclipse.uml2.diagram.clazz.edit.parts.Property4EditPart;
61
import org.eclipse.uml2.diagram.clazz.edit.parts.Property5EditPart;
62
import org.eclipse.uml2.diagram.clazz.edit.parts.Property6EditPart;
63
import org.eclipse.uml2.diagram.clazz.edit.parts.PropertyEditPart;
64
import org.eclipse.uml2.diagram.clazz.edit.parts.SlotEditPart;
65
import org.eclipse.uml2.diagram.clazz.edit.parts.UsageEditPart;
66
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
67
68
/**
69
 * @generated
70
 */
71
public class UMLNavigatorContentProvider implements ICommonContentProvider {
72
73
	/**
74
	 * @generated
75
	 */
76
	private static final Object[] EMPTY_ARRAY = new Object[0];
77
78
	/**
79
	 * @generated
80
	 */
81
	public void dispose() {
82
	}
83
84
	/**
85
	 * @generated
86
	 */
87
	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
88
	}
89
90
	/**
91
	 * @generated
92
	 */
93
	public Object[] getElements(Object inputElement) {
94
		return getChildren(inputElement);
95
	}
96
97
	/**
98
	 * @generated
99
	 */
100
	public Object[] getChildren(Object parentElement) {
101
		if (parentElement instanceof UMLAbstractNavigatorItem) {
102
			UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) parentElement;
103
			if (!PackageEditPart.MODEL_ID.equals(abstractNavigatorItem.getModelID())) {
104
				return EMPTY_ARRAY;
105
			}
106
107
			if (abstractNavigatorItem instanceof UMLNavigatorItem) {
108
				UMLNavigatorItem navigatorItem = (UMLNavigatorItem) abstractNavigatorItem;
109
				switch (navigatorItem.getVisualID()) {
110
				case Package2EditPart.VISUAL_ID: {
111
					Collection result = new ArrayList();
112
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Package3EditPart.VISUAL_ID), navigatorItem));
113
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), navigatorItem));
114
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), navigatorItem));
115
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), navigatorItem));
116
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), navigatorItem));
117
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), navigatorItem));
118
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(InstanceSpecificationEditPart.VISUAL_ID), navigatorItem));
119
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
120
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
121
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
122
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
123
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
124
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
125
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
126
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
127
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
128
					if (!outgoinglinks.isEmpty()) {
129
						result.add(outgoinglinks);
130
					}
131
					if (!incominglinks.isEmpty()) {
132
						result.add(incominglinks);
133
					}
134
					return result.toArray();
135
				}
136
				case Class2EditPart.VISUAL_ID: {
137
					Collection result = new ArrayList();
138
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID), navigatorItem));
139
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(OperationEditPart.VISUAL_ID), navigatorItem));
140
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), navigatorItem));
141
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(PortEditPart.VISUAL_ID), navigatorItem));
142
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
143
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
144
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
145
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
146
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
147
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
148
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
149
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
150
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
151
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
152
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
153
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
154
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceRealizationEditPart.VISUAL_ID), true, outgoinglinks));
155
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
156
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
157
					if (!outgoinglinks.isEmpty()) {
158
						result.add(outgoinglinks);
159
					}
160
					if (!incominglinks.isEmpty()) {
161
						result.add(incominglinks);
162
					}
163
					return result.toArray();
164
				}
165
				case AssociationClass2EditPart.VISUAL_ID: {
166
					Collection result = new ArrayList();
167
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Property2EditPart.VISUAL_ID), navigatorItem));
168
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Operation2EditPart.VISUAL_ID), navigatorItem));
169
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), navigatorItem));
170
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
171
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
172
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
173
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
174
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
175
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
176
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
177
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), true, outgoinglinks));
178
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
179
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
180
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
181
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
182
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
183
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceRealizationEditPart.VISUAL_ID), true, outgoinglinks));
184
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
185
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
186
					if (!outgoinglinks.isEmpty()) {
187
						result.add(outgoinglinks);
188
					}
189
					if (!incominglinks.isEmpty()) {
190
						result.add(incominglinks);
191
					}
192
					return result.toArray();
193
				}
194
				case DataType2EditPart.VISUAL_ID: {
195
					Collection result = new ArrayList();
196
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Property3EditPart.VISUAL_ID), navigatorItem));
197
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Operation3EditPart.VISUAL_ID), navigatorItem));
198
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
199
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
200
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
201
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
202
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
203
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
204
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
205
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
206
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
207
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
208
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
209
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
210
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
211
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
212
					if (!outgoinglinks.isEmpty()) {
213
						result.add(outgoinglinks);
214
					}
215
					if (!incominglinks.isEmpty()) {
216
						result.add(incominglinks);
217
					}
218
					return result.toArray();
219
				}
220
				case PrimitiveType2EditPart.VISUAL_ID: {
221
					Collection result = new ArrayList();
222
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Property4EditPart.VISUAL_ID), navigatorItem));
223
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Operation4EditPart.VISUAL_ID), navigatorItem));
224
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
225
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
226
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
227
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
228
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
229
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
230
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
231
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
232
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
233
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
234
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
235
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
236
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
237
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
238
					if (!outgoinglinks.isEmpty()) {
239
						result.add(outgoinglinks);
240
					}
241
					if (!incominglinks.isEmpty()) {
242
						result.add(incominglinks);
243
					}
244
					return result.toArray();
245
				}
246
				case Enumeration2EditPart.VISUAL_ID: {
247
					Collection result = new ArrayList();
248
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.VISUAL_ID), navigatorItem));
249
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Property5EditPart.VISUAL_ID), navigatorItem));
250
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Operation5EditPart.VISUAL_ID), navigatorItem));
251
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
252
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
253
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
254
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
255
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
256
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
257
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
258
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
259
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
260
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
261
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
262
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
263
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
264
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
265
					if (!outgoinglinks.isEmpty()) {
266
						result.add(outgoinglinks);
267
					}
268
					if (!incominglinks.isEmpty()) {
269
						result.add(incominglinks);
270
					}
271
					return result.toArray();
272
				}
273
				case InterfaceEditPart.VISUAL_ID: {
274
					Collection result = new ArrayList();
275
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
276
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
277
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
278
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
279
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
280
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
281
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
282
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
283
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
284
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
285
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
286
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
287
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceRealizationEditPart.VISUAL_ID), false, incominglinks));
288
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
289
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
290
					if (!outgoinglinks.isEmpty()) {
291
						result.add(outgoinglinks);
292
					}
293
					if (!incominglinks.isEmpty()) {
294
						result.add(incominglinks);
295
					}
296
					return result.toArray();
297
				}
298
				case ConstraintEditPart.VISUAL_ID: {
299
					Collection result = new ArrayList();
300
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(LiteralStringEditPart.VISUAL_ID), navigatorItem));
301
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
302
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
303
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
304
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
305
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
306
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), true, outgoinglinks));
307
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
308
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
309
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
310
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
311
					if (!outgoinglinks.isEmpty()) {
312
						result.add(outgoinglinks);
313
					}
314
					if (!incominglinks.isEmpty()) {
315
						result.add(incominglinks);
316
					}
317
					return result.toArray();
318
				}
319
				case InstanceSpecification2EditPart.VISUAL_ID: {
320
					Collection result = new ArrayList();
321
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(SlotEditPart.VISUAL_ID), navigatorItem));
322
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
323
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
324
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
325
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
326
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
327
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
328
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
329
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
330
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
331
					if (!outgoinglinks.isEmpty()) {
332
						result.add(outgoinglinks);
333
					}
334
					if (!incominglinks.isEmpty()) {
335
						result.add(incominglinks);
336
					}
337
					return result.toArray();
338
				}
339
				case DependencyEditPart.VISUAL_ID: {
340
					Collection result = new ArrayList();
341
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
342
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
343
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
344
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
345
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
346
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
347
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), true, outgoinglinks));
348
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
349
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), true, outgoinglinks));
350
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
351
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
352
					if (!outgoinglinks.isEmpty()) {
353
						result.add(outgoinglinks);
354
					}
355
					if (!incominglinks.isEmpty()) {
356
						result.add(incominglinks);
357
					}
358
					return result.toArray();
359
				}
360
				case Package3EditPart.VISUAL_ID: {
361
					Collection result = new ArrayList();
362
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
363
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
364
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
365
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
366
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
367
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
368
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
369
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
370
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
371
					if (!outgoinglinks.isEmpty()) {
372
						result.add(outgoinglinks);
373
					}
374
					if (!incominglinks.isEmpty()) {
375
						result.add(incominglinks);
376
					}
377
					return result.toArray();
378
				}
379
				case ClassEditPart.VISUAL_ID: {
380
					Collection result = new ArrayList();
381
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
382
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
383
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
384
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
385
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
386
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
387
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
388
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
389
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
390
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
391
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
392
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
393
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceRealizationEditPart.VISUAL_ID), true, outgoinglinks));
394
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
395
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
396
					if (!outgoinglinks.isEmpty()) {
397
						result.add(outgoinglinks);
398
					}
399
					if (!incominglinks.isEmpty()) {
400
						result.add(incominglinks);
401
					}
402
					return result.toArray();
403
				}
404
				case DataTypeEditPart.VISUAL_ID: {
405
					Collection result = new ArrayList();
406
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
407
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
408
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
409
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
410
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
411
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
412
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
413
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
414
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
415
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
416
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
417
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
418
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
419
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
420
					if (!outgoinglinks.isEmpty()) {
421
						result.add(outgoinglinks);
422
					}
423
					if (!incominglinks.isEmpty()) {
424
						result.add(incominglinks);
425
					}
426
					return result.toArray();
427
				}
428
				case PrimitiveTypeEditPart.VISUAL_ID: {
429
					Collection result = new ArrayList();
430
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
431
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
432
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
433
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
434
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
435
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
436
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
437
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
438
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
439
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
440
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
441
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
442
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
443
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
444
					if (!outgoinglinks.isEmpty()) {
445
						result.add(outgoinglinks);
446
					}
447
					if (!incominglinks.isEmpty()) {
448
						result.add(incominglinks);
449
					}
450
					return result.toArray();
451
				}
452
				case EnumerationEditPart.VISUAL_ID: {
453
					Collection result = new ArrayList();
454
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
455
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
456
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
457
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
458
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
459
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
460
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
461
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
462
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
463
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
464
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
465
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
466
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
467
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
468
					if (!outgoinglinks.isEmpty()) {
469
						result.add(outgoinglinks);
470
					}
471
					if (!incominglinks.isEmpty()) {
472
						result.add(incominglinks);
473
					}
474
					return result.toArray();
475
				}
476
				case AssociationClassEditPart.VISUAL_ID: {
477
					Collection result = new ArrayList();
478
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
479
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
480
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
481
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
482
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
483
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
484
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
485
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), true, outgoinglinks));
486
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
487
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
488
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
489
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
490
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
491
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceRealizationEditPart.VISUAL_ID), true, outgoinglinks));
492
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
493
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
494
					if (!outgoinglinks.isEmpty()) {
495
						result.add(outgoinglinks);
496
					}
497
					if (!incominglinks.isEmpty()) {
498
						result.add(incominglinks);
499
					}
500
					return result.toArray();
501
				}
502
				case InstanceSpecificationEditPart.VISUAL_ID: {
503
					Collection result = new ArrayList();
504
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
505
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
506
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
507
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
508
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
509
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
510
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
511
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
512
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
513
					if (!outgoinglinks.isEmpty()) {
514
						result.add(outgoinglinks);
515
					}
516
					if (!incominglinks.isEmpty()) {
517
						result.add(incominglinks);
518
					}
519
					return result.toArray();
520
				}
521
				case PropertyEditPart.VISUAL_ID: {
522
					Collection result = new ArrayList();
523
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
524
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
525
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
526
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
527
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
528
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
529
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
530
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
531
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
532
					if (!outgoinglinks.isEmpty()) {
533
						result.add(outgoinglinks);
534
					}
535
					if (!incominglinks.isEmpty()) {
536
						result.add(incominglinks);
537
					}
538
					return result.toArray();
539
				}
540
				case OperationEditPart.VISUAL_ID: {
541
					Collection result = new ArrayList();
542
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
543
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
544
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
545
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
546
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
547
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
548
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
549
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
550
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
551
					if (!outgoinglinks.isEmpty()) {
552
						result.add(outgoinglinks);
553
					}
554
					if (!incominglinks.isEmpty()) {
555
						result.add(incominglinks);
556
					}
557
					return result.toArray();
558
				}
559
				case Class3EditPart.VISUAL_ID: {
560
					Collection result = new ArrayList();
561
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
562
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), false, incominglinks));
563
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
564
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), true, outgoinglinks));
565
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
566
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
567
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), false, incominglinks));
568
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
569
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), false, incominglinks));
570
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), true, outgoinglinks));
571
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
572
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
573
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceRealizationEditPart.VISUAL_ID), true, outgoinglinks));
574
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
575
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
576
					if (!outgoinglinks.isEmpty()) {
577
						result.add(outgoinglinks);
578
					}
579
					if (!incominglinks.isEmpty()) {
580
						result.add(incominglinks);
581
					}
582
					return result.toArray();
583
				}
584
				case PortEditPart.VISUAL_ID: {
585
					Collection result = new ArrayList();
586
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
587
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
588
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
589
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
590
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
591
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
592
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
593
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
594
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
595
					if (!outgoinglinks.isEmpty()) {
596
						result.add(outgoinglinks);
597
					}
598
					if (!incominglinks.isEmpty()) {
599
						result.add(incominglinks);
600
					}
601
					return result.toArray();
602
				}
603
				case Property2EditPart.VISUAL_ID: {
604
					Collection result = new ArrayList();
605
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
606
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
607
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
608
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
609
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
610
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
611
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
612
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
613
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
614
					if (!outgoinglinks.isEmpty()) {
615
						result.add(outgoinglinks);
616
					}
617
					if (!incominglinks.isEmpty()) {
618
						result.add(incominglinks);
619
					}
620
					return result.toArray();
621
				}
622
				case Operation2EditPart.VISUAL_ID: {
623
					Collection result = new ArrayList();
624
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
625
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
626
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
627
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
628
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
629
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
630
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
631
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
632
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
633
					if (!outgoinglinks.isEmpty()) {
634
						result.add(outgoinglinks);
635
					}
636
					if (!incominglinks.isEmpty()) {
637
						result.add(incominglinks);
638
					}
639
					return result.toArray();
640
				}
641
				case Property3EditPart.VISUAL_ID: {
642
					Collection result = new ArrayList();
643
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
644
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
645
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
646
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
647
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
648
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
649
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
650
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
651
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
652
					if (!outgoinglinks.isEmpty()) {
653
						result.add(outgoinglinks);
654
					}
655
					if (!incominglinks.isEmpty()) {
656
						result.add(incominglinks);
657
					}
658
					return result.toArray();
659
				}
660
				case Operation3EditPart.VISUAL_ID: {
661
					Collection result = new ArrayList();
662
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
663
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
664
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
665
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
666
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
667
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
668
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
669
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
670
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
671
					if (!outgoinglinks.isEmpty()) {
672
						result.add(outgoinglinks);
673
					}
674
					if (!incominglinks.isEmpty()) {
675
						result.add(incominglinks);
676
					}
677
					return result.toArray();
678
				}
679
				case Property4EditPart.VISUAL_ID: {
680
					Collection result = new ArrayList();
681
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
682
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
683
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
684
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
685
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
686
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
687
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
688
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
689
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
690
					if (!outgoinglinks.isEmpty()) {
691
						result.add(outgoinglinks);
692
					}
693
					if (!incominglinks.isEmpty()) {
694
						result.add(incominglinks);
695
					}
696
					return result.toArray();
697
				}
698
				case Operation4EditPart.VISUAL_ID: {
699
					Collection result = new ArrayList();
700
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
701
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
702
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
703
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
704
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
705
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
706
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
707
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
708
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
709
					if (!outgoinglinks.isEmpty()) {
710
						result.add(outgoinglinks);
711
					}
712
					if (!incominglinks.isEmpty()) {
713
						result.add(incominglinks);
714
					}
715
					return result.toArray();
716
				}
717
				case EnumerationLiteralEditPart.VISUAL_ID: {
718
					Collection result = new ArrayList();
719
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
720
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
721
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
722
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
723
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
724
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
725
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
726
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
727
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
728
					if (!outgoinglinks.isEmpty()) {
729
						result.add(outgoinglinks);
730
					}
731
					if (!incominglinks.isEmpty()) {
732
						result.add(incominglinks);
733
					}
734
					return result.toArray();
735
				}
736
				case Property5EditPart.VISUAL_ID: {
737
					Collection result = new ArrayList();
738
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
739
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
740
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
741
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
742
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
743
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
744
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
745
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
746
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
747
					if (!outgoinglinks.isEmpty()) {
748
						result.add(outgoinglinks);
749
					}
750
					if (!incominglinks.isEmpty()) {
751
						result.add(incominglinks);
752
					}
753
					return result.toArray();
754
				}
755
				case Operation5EditPart.VISUAL_ID: {
756
					Collection result = new ArrayList();
757
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
758
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
759
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
760
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
761
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
762
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
763
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
764
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
765
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
766
					if (!outgoinglinks.isEmpty()) {
767
						result.add(outgoinglinks);
768
					}
769
					if (!incominglinks.isEmpty()) {
770
						result.add(incominglinks);
771
					}
772
					return result.toArray();
773
				}
774
				case LiteralStringEditPart.VISUAL_ID: {
775
					Collection result = new ArrayList();
776
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
777
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), false, incominglinks));
778
					UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup("outgoing links", "icons/outgoingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
779
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), true, outgoinglinks));
780
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
781
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), false, incominglinks));
782
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), false, incominglinks));
783
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), false, incominglinks));
784
					outgoinglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), true, outgoinglinks));
785
					if (!outgoinglinks.isEmpty()) {
786
						result.add(outgoinglinks);
787
					}
788
					if (!incominglinks.isEmpty()) {
789
						result.add(incominglinks);
790
					}
791
					return result.toArray();
792
				}
793
				case SlotEditPart.VISUAL_ID: {
794
					Collection result = new ArrayList();
795
					UMLNavigatorGroup incominglinks = new UMLNavigatorGroup("incoming links", "icons/incomingLinksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
796
					incominglinks.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), false, incominglinks));
797
					if (!incominglinks.isEmpty()) {
798
						result.add(incominglinks);
799
					}
800
					return result.toArray();
801
				}
802
				case PackageEditPart.VISUAL_ID: {
803
					Collection result = new ArrayList();
804
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Package2EditPart.VISUAL_ID), navigatorItem));
805
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), navigatorItem));
806
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), navigatorItem));
807
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), navigatorItem));
808
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), navigatorItem));
809
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), navigatorItem));
810
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), navigatorItem));
811
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID), navigatorItem));
812
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(InstanceSpecification2EditPart.VISUAL_ID), navigatorItem));
813
					result.addAll(getChildByType(navigatorItem.getView().getChildren(), UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID), navigatorItem));
814
					UMLNavigatorGroup links = new UMLNavigatorGroup("links", "icons/linksNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
815
					links.addChildren(getViewByType(navigatorItem.getView().getDiagram().getEdges(), UMLVisualIDRegistry.getType(GeneralizationEditPart.VISUAL_ID), links));
816
					links.addChildren(getViewByType(navigatorItem.getView().getDiagram().getEdges(), UMLVisualIDRegistry.getType(Dependency2EditPart.VISUAL_ID), links));
817
					links.addChildren(getViewByType(navigatorItem.getView().getDiagram().getEdges(), UMLVisualIDRegistry.getType(Property6EditPart.VISUAL_ID), links));
818
					links.addChildren(getViewByType(navigatorItem.getView().getDiagram().getEdges(), UMLVisualIDRegistry.getType(ConstraintConstrainedElementEditPart.VISUAL_ID), links));
819
					links.addChildren(getViewByType(navigatorItem.getView().getDiagram().getEdges(), UMLVisualIDRegistry.getType(AssociationEditPart.VISUAL_ID), links));
820
					links.addChildren(getViewByType(navigatorItem.getView().getDiagram().getEdges(), UMLVisualIDRegistry.getType(DependencySupplierEditPart.VISUAL_ID), links));
821
					links.addChildren(getViewByType(navigatorItem.getView().getDiagram().getEdges(), UMLVisualIDRegistry.getType(DependencyClientEditPart.VISUAL_ID), links));
822
					links.addChildren(getViewByType(navigatorItem.getView().getDiagram().getEdges(), UMLVisualIDRegistry.getType(InterfaceRealizationEditPart.VISUAL_ID), links));
823
					links.addChildren(getViewByType(navigatorItem.getView().getDiagram().getEdges(), UMLVisualIDRegistry.getType(UsageEditPart.VISUAL_ID), links));
824
					if (!links.isEmpty()) {
825
						result.add(links);
826
					}
827
					return result.toArray();
828
				}
829
				case GeneralizationEditPart.VISUAL_ID: {
830
					Collection result = new ArrayList();
831
					UMLNavigatorGroup target = new UMLNavigatorGroup("target", "icons/linkTargetNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
832
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), true, target));
833
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), true, target));
834
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), true, target));
835
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), true, target));
836
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), true, target));
837
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), true, target));
838
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), true, target));
839
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), true, target));
840
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), true, target));
841
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), true, target));
842
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), true, target));
843
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), true, target));
844
					UMLNavigatorGroup source = new UMLNavigatorGroup("source", "icons/linkSourceNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
845
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), false, source));
846
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), false, source));
847
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), false, source));
848
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), false, source));
849
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), false, source));
850
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), false, source));
851
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), false, source));
852
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), false, source));
853
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), false, source));
854
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), false, source));
855
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), false, source));
856
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), false, source));
857
					if (!target.isEmpty()) {
858
						result.add(target);
859
					}
860
					if (!source.isEmpty()) {
861
						result.add(source);
862
					}
863
					return result.toArray();
864
				}
865
				case Dependency2EditPart.VISUAL_ID: {
866
					Collection result = new ArrayList();
867
					UMLNavigatorGroup target = new UMLNavigatorGroup("target", "icons/linkTargetNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
868
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package2EditPart.VISUAL_ID), true, target));
869
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), true, target));
870
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), true, target));
871
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), true, target));
872
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), true, target));
873
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), true, target));
874
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), true, target));
875
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID), true, target));
876
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecification2EditPart.VISUAL_ID), true, target));
877
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID), true, target));
878
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package3EditPart.VISUAL_ID), true, target));
879
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), true, target));
880
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), true, target));
881
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), true, target));
882
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), true, target));
883
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), true, target));
884
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecificationEditPart.VISUAL_ID), true, target));
885
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID), true, target));
886
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(OperationEditPart.VISUAL_ID), true, target));
887
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), true, target));
888
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PortEditPart.VISUAL_ID), true, target));
889
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property2EditPart.VISUAL_ID), true, target));
890
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation2EditPart.VISUAL_ID), true, target));
891
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property3EditPart.VISUAL_ID), true, target));
892
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation3EditPart.VISUAL_ID), true, target));
893
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property4EditPart.VISUAL_ID), true, target));
894
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation4EditPart.VISUAL_ID), true, target));
895
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.VISUAL_ID), true, target));
896
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property5EditPart.VISUAL_ID), true, target));
897
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation5EditPart.VISUAL_ID), true, target));
898
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(LiteralStringEditPart.VISUAL_ID), true, target));
899
					UMLNavigatorGroup source = new UMLNavigatorGroup("source", "icons/linkSourceNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
900
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package2EditPart.VISUAL_ID), false, source));
901
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), false, source));
902
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), false, source));
903
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), false, source));
904
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), false, source));
905
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), false, source));
906
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), false, source));
907
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID), false, source));
908
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecification2EditPart.VISUAL_ID), false, source));
909
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID), false, source));
910
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package3EditPart.VISUAL_ID), false, source));
911
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), false, source));
912
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), false, source));
913
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), false, source));
914
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), false, source));
915
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), false, source));
916
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecificationEditPart.VISUAL_ID), false, source));
917
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID), false, source));
918
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(OperationEditPart.VISUAL_ID), false, source));
919
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), false, source));
920
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PortEditPart.VISUAL_ID), false, source));
921
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property2EditPart.VISUAL_ID), false, source));
922
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation2EditPart.VISUAL_ID), false, source));
923
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property3EditPart.VISUAL_ID), false, source));
924
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation3EditPart.VISUAL_ID), false, source));
925
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property4EditPart.VISUAL_ID), false, source));
926
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation4EditPart.VISUAL_ID), false, source));
927
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.VISUAL_ID), false, source));
928
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property5EditPart.VISUAL_ID), false, source));
929
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation5EditPart.VISUAL_ID), false, source));
930
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(LiteralStringEditPart.VISUAL_ID), false, source));
931
					if (!target.isEmpty()) {
932
						result.add(target);
933
					}
934
					if (!source.isEmpty()) {
935
						result.add(source);
936
					}
937
					return result.toArray();
938
				}
939
				case Property6EditPart.VISUAL_ID: {
940
					Collection result = new ArrayList();
941
					UMLNavigatorGroup target = new UMLNavigatorGroup("target", "icons/linkTargetNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
942
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), true, target));
943
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), true, target));
944
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), true, target));
945
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), true, target));
946
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), true, target));
947
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), true, target));
948
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), true, target));
949
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), true, target));
950
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), true, target));
951
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), true, target));
952
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), true, target));
953
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), true, target));
954
					UMLNavigatorGroup source = new UMLNavigatorGroup("source", "icons/linkSourceNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
955
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), false, source));
956
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), false, source));
957
					if (!target.isEmpty()) {
958
						result.add(target);
959
					}
960
					if (!source.isEmpty()) {
961
						result.add(source);
962
					}
963
					return result.toArray();
964
				}
965
				case ConstraintConstrainedElementEditPart.VISUAL_ID: {
966
					Collection result = new ArrayList();
967
					UMLNavigatorGroup target = new UMLNavigatorGroup("target", "icons/linkTargetNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
968
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package2EditPart.VISUAL_ID), true, target));
969
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), true, target));
970
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), true, target));
971
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), true, target));
972
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), true, target));
973
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), true, target));
974
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), true, target));
975
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID), true, target));
976
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecification2EditPart.VISUAL_ID), true, target));
977
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID), true, target));
978
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package3EditPart.VISUAL_ID), true, target));
979
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), true, target));
980
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), true, target));
981
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), true, target));
982
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), true, target));
983
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), true, target));
984
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecificationEditPart.VISUAL_ID), true, target));
985
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID), true, target));
986
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(OperationEditPart.VISUAL_ID), true, target));
987
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), true, target));
988
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PortEditPart.VISUAL_ID), true, target));
989
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property2EditPart.VISUAL_ID), true, target));
990
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation2EditPart.VISUAL_ID), true, target));
991
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property3EditPart.VISUAL_ID), true, target));
992
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation3EditPart.VISUAL_ID), true, target));
993
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property4EditPart.VISUAL_ID), true, target));
994
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation4EditPart.VISUAL_ID), true, target));
995
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.VISUAL_ID), true, target));
996
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property5EditPart.VISUAL_ID), true, target));
997
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation5EditPart.VISUAL_ID), true, target));
998
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(LiteralStringEditPart.VISUAL_ID), true, target));
999
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(SlotEditPart.VISUAL_ID), true, target));
1000
					UMLNavigatorGroup source = new UMLNavigatorGroup("source", "icons/linkSourceNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
1001
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID), false, source));
1002
					if (!target.isEmpty()) {
1003
						result.add(target);
1004
					}
1005
					if (!source.isEmpty()) {
1006
						result.add(source);
1007
					}
1008
					return result.toArray();
1009
				}
1010
				case AssociationEditPart.VISUAL_ID: {
1011
					Collection result = new ArrayList();
1012
					UMLNavigatorGroup target = new UMLNavigatorGroup("target", "icons/linkTargetNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
1013
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), true, target));
1014
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), true, target));
1015
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), true, target));
1016
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), true, target));
1017
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), true, target));
1018
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), true, target));
1019
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), true, target));
1020
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), true, target));
1021
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), true, target));
1022
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), true, target));
1023
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), true, target));
1024
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), true, target));
1025
					UMLNavigatorGroup source = new UMLNavigatorGroup("source", "icons/linkSourceNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
1026
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), false, source));
1027
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), false, source));
1028
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), false, source));
1029
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), false, source));
1030
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), false, source));
1031
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), false, source));
1032
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), false, source));
1033
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), false, source));
1034
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), false, source));
1035
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), false, source));
1036
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), false, source));
1037
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), false, source));
1038
					if (!target.isEmpty()) {
1039
						result.add(target);
1040
					}
1041
					if (!source.isEmpty()) {
1042
						result.add(source);
1043
					}
1044
					return result.toArray();
1045
				}
1046
				case DependencySupplierEditPart.VISUAL_ID: {
1047
					Collection result = new ArrayList();
1048
					UMLNavigatorGroup target = new UMLNavigatorGroup("target", "icons/linkTargetNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
1049
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package2EditPart.VISUAL_ID), true, target));
1050
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), true, target));
1051
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), true, target));
1052
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), true, target));
1053
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), true, target));
1054
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), true, target));
1055
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), true, target));
1056
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID), true, target));
1057
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecification2EditPart.VISUAL_ID), true, target));
1058
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID), true, target));
1059
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package3EditPart.VISUAL_ID), true, target));
1060
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), true, target));
1061
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), true, target));
1062
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), true, target));
1063
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), true, target));
1064
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), true, target));
1065
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecificationEditPart.VISUAL_ID), true, target));
1066
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID), true, target));
1067
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(OperationEditPart.VISUAL_ID), true, target));
1068
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), true, target));
1069
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PortEditPart.VISUAL_ID), true, target));
1070
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property2EditPart.VISUAL_ID), true, target));
1071
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation2EditPart.VISUAL_ID), true, target));
1072
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property3EditPart.VISUAL_ID), true, target));
1073
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation3EditPart.VISUAL_ID), true, target));
1074
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property4EditPart.VISUAL_ID), true, target));
1075
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation4EditPart.VISUAL_ID), true, target));
1076
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.VISUAL_ID), true, target));
1077
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property5EditPart.VISUAL_ID), true, target));
1078
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation5EditPart.VISUAL_ID), true, target));
1079
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(LiteralStringEditPart.VISUAL_ID), true, target));
1080
					UMLNavigatorGroup source = new UMLNavigatorGroup("source", "icons/linkSourceNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
1081
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID), false, source));
1082
					if (!target.isEmpty()) {
1083
						result.add(target);
1084
					}
1085
					if (!source.isEmpty()) {
1086
						result.add(source);
1087
					}
1088
					return result.toArray();
1089
				}
1090
				case DependencyClientEditPart.VISUAL_ID: {
1091
					Collection result = new ArrayList();
1092
					UMLNavigatorGroup target = new UMLNavigatorGroup("target", "icons/linkTargetNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
1093
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package2EditPart.VISUAL_ID), true, target));
1094
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), true, target));
1095
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), true, target));
1096
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), true, target));
1097
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), true, target));
1098
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), true, target));
1099
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), true, target));
1100
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID), true, target));
1101
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecification2EditPart.VISUAL_ID), true, target));
1102
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID), true, target));
1103
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package3EditPart.VISUAL_ID), true, target));
1104
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), true, target));
1105
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), true, target));
1106
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), true, target));
1107
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), true, target));
1108
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), true, target));
1109
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecificationEditPart.VISUAL_ID), true, target));
1110
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID), true, target));
1111
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(OperationEditPart.VISUAL_ID), true, target));
1112
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), true, target));
1113
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PortEditPart.VISUAL_ID), true, target));
1114
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property2EditPart.VISUAL_ID), true, target));
1115
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation2EditPart.VISUAL_ID), true, target));
1116
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property3EditPart.VISUAL_ID), true, target));
1117
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation3EditPart.VISUAL_ID), true, target));
1118
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property4EditPart.VISUAL_ID), true, target));
1119
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation4EditPart.VISUAL_ID), true, target));
1120
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.VISUAL_ID), true, target));
1121
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property5EditPart.VISUAL_ID), true, target));
1122
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation5EditPart.VISUAL_ID), true, target));
1123
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(LiteralStringEditPart.VISUAL_ID), true, target));
1124
					UMLNavigatorGroup source = new UMLNavigatorGroup("source", "icons/linkSourceNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
1125
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID), false, source));
1126
					if (!target.isEmpty()) {
1127
						result.add(target);
1128
					}
1129
					if (!source.isEmpty()) {
1130
						result.add(source);
1131
					}
1132
					return result.toArray();
1133
				}
1134
				case InterfaceRealizationEditPart.VISUAL_ID: {
1135
					Collection result = new ArrayList();
1136
					UMLNavigatorGroup target = new UMLNavigatorGroup("target", "icons/linkTargetNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
1137
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), true, target));
1138
					UMLNavigatorGroup source = new UMLNavigatorGroup("source", "icons/linkSourceNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
1139
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), false, source));
1140
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), false, source));
1141
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), false, source));
1142
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), false, source));
1143
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), false, source));
1144
					if (!target.isEmpty()) {
1145
						result.add(target);
1146
					}
1147
					if (!source.isEmpty()) {
1148
						result.add(source);
1149
					}
1150
					return result.toArray();
1151
				}
1152
				case UsageEditPart.VISUAL_ID: {
1153
					Collection result = new ArrayList();
1154
					UMLNavigatorGroup target = new UMLNavigatorGroup("target", "icons/linkTargetNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
1155
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package2EditPart.VISUAL_ID), true, target));
1156
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), true, target));
1157
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), true, target));
1158
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), true, target));
1159
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), true, target));
1160
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), true, target));
1161
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), true, target));
1162
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID), true, target));
1163
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecification2EditPart.VISUAL_ID), true, target));
1164
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID), true, target));
1165
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package3EditPart.VISUAL_ID), true, target));
1166
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), true, target));
1167
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), true, target));
1168
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), true, target));
1169
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), true, target));
1170
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), true, target));
1171
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecificationEditPart.VISUAL_ID), true, target));
1172
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID), true, target));
1173
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(OperationEditPart.VISUAL_ID), true, target));
1174
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), true, target));
1175
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PortEditPart.VISUAL_ID), true, target));
1176
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property2EditPart.VISUAL_ID), true, target));
1177
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation2EditPart.VISUAL_ID), true, target));
1178
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property3EditPart.VISUAL_ID), true, target));
1179
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation3EditPart.VISUAL_ID), true, target));
1180
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property4EditPart.VISUAL_ID), true, target));
1181
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation4EditPart.VISUAL_ID), true, target));
1182
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.VISUAL_ID), true, target));
1183
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property5EditPart.VISUAL_ID), true, target));
1184
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation5EditPart.VISUAL_ID), true, target));
1185
					target.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(LiteralStringEditPart.VISUAL_ID), true, target));
1186
					UMLNavigatorGroup source = new UMLNavigatorGroup("source", "icons/linkSourceNavigatorGroup.gif", PackageEditPart.MODEL_ID, navigatorItem);
1187
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package2EditPart.VISUAL_ID), false, source));
1188
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID), false, source));
1189
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClass2EditPart.VISUAL_ID), false, source));
1190
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataType2EditPart.VISUAL_ID), false, source));
1191
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveType2EditPart.VISUAL_ID), false, source));
1192
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Enumeration2EditPart.VISUAL_ID), false, source));
1193
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InterfaceEditPart.VISUAL_ID), false, source));
1194
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID), false, source));
1195
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecification2EditPart.VISUAL_ID), false, source));
1196
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID), false, source));
1197
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Package3EditPart.VISUAL_ID), false, source));
1198
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID), false, source));
1199
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID), false, source));
1200
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID), false, source));
1201
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID), false, source));
1202
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID), false, source));
1203
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(InstanceSpecificationEditPart.VISUAL_ID), false, source));
1204
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID), false, source));
1205
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(OperationEditPart.VISUAL_ID), false, source));
1206
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID), false, source));
1207
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(PortEditPart.VISUAL_ID), false, source));
1208
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property2EditPart.VISUAL_ID), false, source));
1209
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation2EditPart.VISUAL_ID), false, source));
1210
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property3EditPart.VISUAL_ID), false, source));
1211
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation3EditPart.VISUAL_ID), false, source));
1212
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property4EditPart.VISUAL_ID), false, source));
1213
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation4EditPart.VISUAL_ID), false, source));
1214
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.VISUAL_ID), false, source));
1215
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Property5EditPart.VISUAL_ID), false, source));
1216
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(Operation5EditPart.VISUAL_ID), false, source));
1217
					source.addChildren(getConnectedViews(navigatorItem.getView(), UMLVisualIDRegistry.getType(LiteralStringEditPart.VISUAL_ID), false, source));
1218
					if (!target.isEmpty()) {
1219
						result.add(target);
1220
					}
1221
					if (!source.isEmpty()) {
1222
						result.add(source);
1223
					}
1224
					return result.toArray();
1225
				}
1226
				}
1227
			} else if (abstractNavigatorItem instanceof UMLNavigatorGroup) {
1228
				UMLNavigatorGroup group = (UMLNavigatorGroup) parentElement;
1229
				return group.getChildren();
1230
			}
1231
		} else if (parentElement instanceof IFile) {
1232
			IFile file = (IFile) parentElement;
1233
			AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) GMFEditingDomainFactory.INSTANCE.createEditingDomain();
1234
			editingDomain.setResourceToReadOnlyMap(new HashMap() {
1235
1236
				public Object get(Object key) {
1237
					if (!containsKey(key)) {
1238
						put(key, Boolean.TRUE);
1239
					}
1240
					return super.get(key);
1241
				}
1242
			});
1243
			ResourceSet resourceSet = editingDomain.getResourceSet();
1244
1245
			URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString());
1246
			Resource resource = resourceSet.getResource(fileURI, true);
1247
1248
			Collection result = new ArrayList();
1249
			result.addAll(getViewByType(resource.getContents(), PackageEditPart.MODEL_ID, file));
1250
			return result.toArray();
1251
		}
1252
		return EMPTY_ARRAY;
1253
	}
1254
1255
	/**
1256
	 * @generated
1257
	 */
1258
	public Object getParent(Object element) {
1259
		if (element instanceof UMLAbstractNavigatorItem) {
1260
			UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element;
1261
			if (!PackageEditPart.MODEL_ID.equals(abstractNavigatorItem.getModelID())) {
1262
				return null;
1263
			}
1264
			return abstractNavigatorItem.getParent();
1265
		}
1266
		return null;
1267
	}
1268
1269
	/**
1270
	 * @generated
1271
	 */
1272
	public boolean hasChildren(Object element) {
1273
		return element instanceof IFile || getChildren(element).length > 0;
1274
	}
1275
1276
	/**
1277
	 * @generated
1278
	 */
1279
	public void init(ICommonContentExtensionSite aConfig) {
1280
	}
1281
1282
	/**
1283
	 * @generated
1284
	 */
1285
	public void restoreState(IMemento aMemento) {
1286
	}
1287
1288
	/**
1289
	 * @generated
1290
	 */
1291
	public void saveState(IMemento aMemento) {
1292
	}
1293
1294
	/**
1295
	 * @generated
1296
	 */
1297
	private Collection getViewByType(Collection childViews, String type, Object parent) {
1298
		Collection result = new ArrayList();
1299
		for (Iterator it = childViews.iterator(); it.hasNext();) {
1300
			Object next = it.next();
1301
			if (false == next instanceof View) {
1302
				continue;
1303
			}
1304
			View nextView = (View) next;
1305
			if (type.equals(nextView.getType())) {
1306
				result.add(new UMLNavigatorItem(nextView, parent));
1307
			}
1308
		}
1309
		return result;
1310
	}
1311
1312
	/**
1313
	 * @generated
1314
	 */
1315
	private Collection getChildByType(Collection childViews, String type, Object parent) {
1316
		Collection result = new ArrayList();
1317
		List children = new ArrayList(childViews);
1318
		for (int i = 0; i < children.size(); i++) {
1319
			if (false == children.get(i) instanceof View) {
1320
				continue;
1321
			}
1322
			View nextChild = (View) children.get(i);
1323
			if (type.equals(nextChild.getType())) {
1324
				result.add(new UMLNavigatorItem(nextChild, parent));
1325
			} else if (!stopGettingChildren(nextChild, type)) {
1326
				children.addAll(nextChild.getChildren());
1327
			}
1328
		}
1329
		return result;
1330
	}
1331
1332
	/**
1333
	 * @generated
1334
	 */
1335
	private boolean stopGettingChildren(View child, String type) {
1336
		return false;
1337
	}
1338
1339
	/**
1340
	 * @generated
1341
	 */
1342
	private Collection getConnectedViews(View rootView, String type, boolean isOutTarget, Object parent) {
1343
		Collection result = new ArrayList();
1344
		List connectedViews = new ArrayList();
1345
		connectedViews.add(rootView);
1346
		Set visitedViews = new HashSet();
1347
		for (int i = 0; i < connectedViews.size(); i++) {
1348
			View nextView = (View) connectedViews.get(i);
1349
			if (visitedViews.contains(nextView)) {
1350
				continue;
1351
			}
1352
			visitedViews.add(nextView);
1353
			if (type.equals(nextView.getType()) && nextView != rootView) {
1354
				result.add(new UMLNavigatorItem(nextView, parent));
1355
			} else {
1356
				if (isOutTarget && !stopGettingOutTarget(nextView, rootView, type)) {
1357
					connectedViews.addAll(nextView.getSourceEdges());
1358
					if (nextView instanceof Edge) {
1359
						connectedViews.add(((Edge) nextView).getTarget());
1360
					}
1361
				}
1362
				if (!isOutTarget && !stopGettingInSource(nextView, rootView, type)) {
1363
					connectedViews.addAll(nextView.getTargetEdges());
1364
					if (nextView instanceof Edge) {
1365
						connectedViews.add(((Edge) nextView).getSource());
1366
					}
1367
				}
1368
			}
1369
		}
1370
		return result;
1371
	}
1372
1373
	/**
1374
	 * @generated
1375
	 */
1376
	private boolean stopGettingInSource(View nextView, View rootView, String type) {
1377
		return !isOneHopConnection(nextView, rootView);
1378
	}
1379
1380
	/**
1381
	 * @generated
1382
	 */
1383
	private boolean stopGettingOutTarget(View nextView, View rootView, String type) {
1384
		return !isOneHopConnection(nextView, rootView);
1385
	}
1386
1387
	/**
1388
	 * @generated
1389
	 */
1390
	private boolean isOneHopConnection(View targetView, View sourceView) {
1391
		if (sourceView == targetView) {
1392
			return true;
1393
		}
1394
		if (sourceView instanceof Node) {
1395
			return targetView instanceof Edge;
1396
		}
1397
		if (sourceView instanceof Edge) {
1398
			return targetView instanceof Node;
1399
		}
1400
		return false;
1401
	}
1402
1403
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLCreationWizardPage.java (+111 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import java.io.ByteArrayInputStream;
4
import java.io.InputStream;
5
6
import org.eclipse.core.runtime.IPath;
7
import org.eclipse.jface.viewers.IStructuredSelection;
8
import org.eclipse.swt.widgets.Composite;
9
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
10
11
import org.eclipse.core.resources.ResourcesPlugin;
12
13
/**
14
 * @generated
15
 */
16
public class UMLCreationWizardPage extends WizardNewFileCreationPage {
17
18
	/**
19
	 * @generated
20
	 */
21
	private static final String DOMAIN_EXT = ".uml"; //$NON-NLS-1$
22
23
	/**
24
	 * @generated
25
	 */
26
	private static final String DIAGRAM_EXT = ".umlclass_diagram"; //$NON-NLS-1$
27
28
	/**
29
	 * @generated
30
	 */
31
	public UMLCreationWizardPage(String pageName, IStructuredSelection selection) {
32
		super(pageName, selection);
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected String getDefaultFileName() {
39
		return "default"; //$NON-NLS-1$
40
	}
41
42
	/**
43
	 * @generated
44
	 */
45
	public String getFileName() {
46
		String fileName = super.getFileName();
47
		if (fileName != null && !fileName.endsWith(DIAGRAM_EXT)) {
48
			fileName += DIAGRAM_EXT;
49
		}
50
		return fileName;
51
	}
52
53
	/**
54
	 * @generated
55
	 */
56
	private String getUniqueFileName(IPath containerPath, String fileName) {
57
		String newFileName = fileName;
58
		IPath diagramFilePath = containerPath.append(newFileName + DIAGRAM_EXT);
59
		IPath modelFilePath = containerPath.append(newFileName + DOMAIN_EXT);
60
		int i = 1;
61
		while (exists(diagramFilePath) || exists(modelFilePath)) {
62
			i++;
63
			newFileName = fileName + i;
64
			diagramFilePath = containerPath.append(newFileName + DIAGRAM_EXT);
65
			modelFilePath = containerPath.append(newFileName + DOMAIN_EXT);
66
		}
67
		return newFileName;
68
	}
69
70
	/**
71
	 * @generated
72
	 */
73
	public void createControl(Composite parent) {
74
		super.createControl(parent);
75
		IPath path = getContainerFullPath();
76
		if (path != null) {
77
			String fileName = getUniqueFileName(path, getDefaultFileName());
78
			setFileName(fileName);
79
		} else {
80
			setFileName(getDefaultFileName());
81
		}
82
		setPageComplete(validatePage());
83
	}
84
85
	/**
86
	 * @generated
87
	 */
88
	protected boolean validatePage() {
89
		if (super.validatePage()) {
90
			String fileName = getFileName();
91
			if (fileName == null) {
92
				return false;
93
			}
94
			fileName = fileName.substring(0, fileName.length() - DIAGRAM_EXT.length()) + DOMAIN_EXT;
95
			IPath path = getContainerFullPath().append(fileName);
96
			if (exists(path)) {
97
				setErrorMessage("Model file already exists: " + path.lastSegment());
98
				return false;
99
			}
100
			return true;
101
		}
102
		return false;
103
	}
104
105
	/**
106
	 * @generated
107
	 */
108
	public static boolean exists(IPath path) {
109
		return ResourcesPlugin.getWorkspace().getRoot().exists(path);
110
	}
111
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/name/association-name.jj (+201 lines)
Added Link Here
1
options {
2
  JAVA_UNICODE_ESCAPE = true;
3
  STATIC=false;
4
}
5
6
PARSER_BEGIN(AssociationNameParser)
7
8
/*
9
 * Copyright (c) 2006 Borland Software Corporation
10
 * 
11
 * All rights reserved. This program and the accompanying materials
12
 * are made available under the terms of the Eclipse Public License v1.0
13
 * which accompanies this distribution, and is available at
14
 * http://www.eclipse.org/legal/epl-v10.html
15
 *
16
 * Contributors:
17
 *    Michael Golubev (Borland) - initial API and implementation
18
 */
19
package org.eclipse.uml2.diagram.clazz.parser.association.name;
20
21
import java.io.*;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EObject;
24
import org.eclipse.uml2.diagram.parser.*;
25
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
26
import org.eclipse.uml2.uml.*;
27
28
public class AssociationNameParser extends ExternalParserBase {
29
	private Association mySubject;
30
	
31
    public AssociationNameParser(){
32
    	this(new StringReader(""));
33
    }
34
    
35
    public AssociationNameParser(LookupSuite lookup){
36
    	this();
37
    	setLookupSuite(lookup);
38
    }
39
40
	public EClass getSubjectClass(){
41
		return UMLPackage.eINSTANCE.getAssociation();
42
	}
43
	
44
	public void parse(EObject target, String text) throws ExternalParserException {
45
		checkContext();
46
		ReInit(new StringReader(text));
47
		mySubject = (Association)target;
48
		Declaration();
49
		mySubject = null;
50
	}
51
	
52
	protected static int parseInt(Token t) throws ParseException {
53
		if (t.kind != AssociationNameParserConstants.INTEGER_LITERAL){
54
			throw new IllegalStateException("Token: " + t + ", image: " + t.image);
55
		}
56
		try {
57
			return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
58
		} catch (NumberFormatException e){
59
			throw new ParseException("Not supported integer value:" + t.image);
60
		}
61
	}
62
	
63
}
64
65
PARSER_END(AssociationNameParser)
66
67
/* WHITE SPACE */
68
69
SPECIAL_TOKEN :
70
{
71
  " "
72
| "\t"
73
}
74
75
/* SEPARATORS */
76
TOKEN :
77
{
78
	< SLASH: "/" >
79
|	< COLON: ":" >
80
|	< EQUALS: "=" >
81
|	< LBRACKET: "[" >
82
|	< RBRACKET: "]" >
83
|	< LCURLY: "{" >
84
|	< RCURLY: "}" >
85
|	< COMMA: "," >
86
}
87
88
/* SPECIAL_MEANING */
89
TOKEN :
90
{
91
	< PLUS: "+" >
92
|	< MINUS: "-" >
93
|	< NUMBER_SIGN: "#" >
94
|	< TILDE: "~" >
95
|	< DOT: "." >
96
|	< STAR: "*" >
97
}
98
99
/* MODIFIERS */
100
TOKEN :
101
{
102
	< READ_ONLY: "readOnly" >
103
|	< UNION: "union" >
104
|	< SUBSETS: "subsets" >
105
|	< REDEFINES: "redefines" >
106
|	< ORDERED: "ordered" >
107
|	< UNORDERED: "unordered" > 
108
|	< UNIQUE: "unique" >
109
|	< NON_UNIQUE: "nonunique" >
110
}
111
	
112
/* LITERALS */
113
TOKEN: 
114
{
115
	< INTEGER_LITERAL: ["0"-"9"] (["0"-"9"])* >
116
}
117
  
118
TOKEN :
119
{
120
  < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
121
|
122
  < #LETTER:
123
      [
124
       "\u0024",
125
       "\u0041"-"\u005a",
126
       "\u005f",
127
       "\u0061"-"\u007a",
128
       "\u00c0"-"\u00d6",
129
       "\u00d8"-"\u00f6",
130
       "\u00f8"-"\u00ff",
131
       "\u0100"-"\u1fff",
132
       "\u3040"-"\u318f",
133
       "\u3300"-"\u337f",
134
       "\u3400"-"\u3d2d",
135
       "\u4e00"-"\u9fff",
136
       "\uf900"-"\ufaff"
137
      ]
138
  >
139
|
140
  < #DIGIT:
141
      [
142
       "\u0030"-"\u0039",
143
       "\u0660"-"\u0669",
144
       "\u06f0"-"\u06f9",
145
       "\u0966"-"\u096f",
146
       "\u09e6"-"\u09ef",
147
       "\u0a66"-"\u0a6f",
148
       "\u0ae6"-"\u0aef",
149
       "\u0b66"-"\u0b6f",
150
       "\u0be7"-"\u0bef",
151
       "\u0c66"-"\u0c6f",
152
       "\u0ce6"-"\u0cef",
153
       "\u0d66"-"\u0d6f",
154
       "\u0e50"-"\u0e59",
155
       "\u0ed0"-"\u0ed9",
156
       "\u1040"-"\u1049"
157
      ]
158
  >
159
}
160
161
void Declaration() :
162
{}
163
{
164
	(
165
		[ IsDerived() ]
166
		AssociationName()
167
	) <EOF>
168
}
169
170
void AssociationName() :
171
{
172
	String name;
173
}
174
{
175
	name = NameWithSpaces() 
176
	{
177
		mySubject.setName(name);
178
	}
179
}
180
181
void IsDerived() :
182
{}
183
{
184
	<SLASH> { mySubject.setIsDerived(true); }
185
}
186
187
String NameWithSpaces() :
188
{
189
	StringBuffer result = new StringBuffer();
190
	Token t;
191
}
192
{
193
	(
194
		t = <IDENTIFIER> { result.append(t.image); } 
195
		( t = <IDENTIFIER> { result.append(' '); result.append(t.image); } ) *
196
	)
197
	{
198
		return result.toString();
199
	}
200
}
201
(-)src/org/eclipse/uml2/diagram/clazz/navigator/UMLNavigatorGroup.java (+103 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.navigator;
2
3
import java.util.Collection;
4
import java.util.LinkedList;
5
6
/**
7
 * @generated
8
 */
9
public class UMLNavigatorGroup extends UMLAbstractNavigatorItem {
10
11
	/**
12
	 * @generated
13
	 */
14
	private String myGroupName;
15
16
	/**
17
	 * @generated
18
	 */
19
	private String myIcon;
20
21
	/**
22
	 * @generated
23
	 */
24
	private String myModelID;
25
26
	/**
27
	 * @generated
28
	 */
29
	private Collection myChildren = new LinkedList();
30
31
	/**
32
	 * @generated
33
	 */
34
	UMLNavigatorGroup(String groupName, String icon, String modelID, Object parent) {
35
		super(parent);
36
		myGroupName = groupName;
37
		myIcon = icon;
38
		myModelID = modelID;
39
	}
40
41
	/**
42
	 * @generated
43
	 */
44
	public String getGroupName() {
45
		return myGroupName;
46
	}
47
48
	/**
49
	 * @generated
50
	 */
51
	public String getIcon() {
52
		return myIcon;
53
	}
54
55
	/**
56
	 * @generated
57
	 */
58
	public Object[] getChildren() {
59
		return myChildren.toArray();
60
	}
61
62
	/**
63
	 * @generated
64
	 */
65
	public void addChildren(Collection children) {
66
		myChildren.addAll(children);
67
	}
68
69
	/**
70
	 * @generated
71
	 */
72
	public void addChild(Object child) {
73
		myChildren.add(child);
74
	}
75
76
	/**
77
	 * @generated
78
	 */
79
	public boolean isEmpty() {
80
		return myChildren.size() == 0;
81
	}
82
83
	/**
84
	 * @generated
85
	 */
86
	public String getModelID() {
87
		return myModelID;
88
	}
89
90
	/**
91
	 * @generated
92
	 */
93
	public boolean equals(Object obj) {
94
		if (obj instanceof UMLNavigatorGroup) {
95
			UMLNavigatorGroup anotherGroup = (UMLNavigatorGroup) obj;
96
			if (getGroupName().equals(anotherGroup.getGroupName())) {
97
				return getParent().equals(anotherGroup.getParent());
98
			}
99
		}
100
		return super.equals(obj);
101
	}
102
103
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/InstanceSpecification2ViewFactory.java (+54 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationNameEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationSlotsEditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class InstanceSpecification2ViewFactory extends AbstractShapeViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
29
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
30
		styles.add(NotationFactory.eINSTANCE.createFillStyle());
31
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecification2EditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
45
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
46
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
47
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
48
			view.getEAnnotations().add(shortcutAnnotation);
49
		}
50
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(InstanceSpecificationNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
51
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(InstanceSpecificationSlotsEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
52
	}
53
54
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/DependencyEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class DependencyEditHelper extends UMLBaseEditHelper {
7
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/instance/InstanceSpecificationToString.java (+91 lines)
Added Link Here
1
/*
2
 * Copyright (c) 2006 Borland Software Corporation
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    Michael Golubev (Borland) - initial API and implementation
11
 */
12
13
package org.eclipse.uml2.diagram.clazz.parser.instance;
14
15
import java.util.Arrays;
16
import java.util.Iterator;
17
import java.util.LinkedList;
18
import java.util.List;
19
20
import org.eclipse.emf.ecore.EObject;
21
import org.eclipse.emf.ecore.EStructuralFeature;
22
import org.eclipse.uml2.diagram.parser.AbstractToString;
23
import org.eclipse.uml2.uml.Classifier;
24
import org.eclipse.uml2.uml.InstanceSpecification;
25
import org.eclipse.uml2.uml.UMLPackage;
26
27
public abstract class InstanceSpecificationToString extends AbstractToString {
28
	
29
	public String getToString(EObject object, int flags) {
30
		InstanceSpecification instance = asInstanceSpecification(object);
31
		StringBuffer result = new StringBuffer();
32
		appendName(result, instance);
33
		appendType(result, getClassifiers(instance));
34
35
		//anonymous unnamed, see 7.3.22 "Notation" at page 85, 06-04-02
36
		if (result.length() == 0){
37
			result.append(":");
38
		}
39
		return result.toString();
40
	}
41
42
	protected final String getClassifiers(InstanceSpecification instance) {
43
		StringBuffer result = new StringBuffer();
44
		boolean atLeastOneClassifier = false;
45
		for (Iterator classifiers = instance.getClassifiers().iterator(); classifiers.hasNext();){
46
			Classifier next = (Classifier)classifiers.next();
47
			if (atLeastOneClassifier){
48
				result.append(", ");
49
			}
50
			String nextName = next.getName();
51
			if (!isEmpty(nextName)){
52
				atLeastOneClassifier = true;	
53
				result.append(nextName);
54
			}
55
		}
56
		return result.toString();
57
	}
58
59
	protected InstanceSpecification asInstanceSpecification(EObject object){
60
		if (false == object instanceof InstanceSpecification){
61
			throw new IllegalStateException("I can not provide toString for: " + object);
62
		}
63
		return (InstanceSpecification)object;
64
	}
65
	
66
	public static class EDIT extends InstanceSpecificationToString {
67
		public boolean isAffectingFeature(EStructuralFeature feature) {
68
			throw new UnsupportedOperationException("I am edit toString, I am not expected to be asked");
69
		}
70
	}
71
	
72
	public static class VIEW extends InstanceSpecificationToString implements WithReferences {
73
		private static final List AFFECTING = Arrays.asList(new EStructuralFeature[] {
74
			UMLPackage.eINSTANCE.getNamedElement_Name(),
75
			UMLPackage.eINSTANCE.getInstanceSpecification_Classifier(),
76
		});
77
		
78
		public boolean isAffectingFeature(EStructuralFeature feature) {
79
			return AFFECTING.contains(feature);
80
		}
81
		
82
		public List getAdditionalReferencedElements(EObject object) {
83
			InstanceSpecification instance = asInstanceSpecification(object);
84
			List result = new LinkedList();
85
			result.add(instance);
86
			result.addAll(instance.getClassifiers());
87
			return result;
88
		}
89
	}
90
	
91
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/name/TokenMgrError.java (+144 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.name;
14
15
public class TokenMgrError extends Error
16
{
17
   /*
18
    * Ordinals for various reasons why an Error of this type can be thrown.
19
    */
20
21
   /**
22
    * Lexical error occured.
23
    */
24
   static final int LEXICAL_ERROR = 0;
25
26
   /**
27
    * An attempt wass made to create a second instance of a static token manager.
28
    */
29
   static final int STATIC_LEXER_ERROR = 1;
30
31
   /**
32
    * Tried to change to an invalid lexical state.
33
    */
34
   static final int INVALID_LEXICAL_STATE = 2;
35
36
   /**
37
    * Detected (and bailed out of) an infinite loop in the token manager.
38
    */
39
   static final int LOOP_DETECTED = 3;
40
41
   /**
42
    * Indicates the reason why the exception is thrown. It will have
43
    * one of the above 4 values.
44
    */
45
   int errorCode;
46
47
   /**
48
    * Replaces unprintable characters by their espaced (or unicode escaped)
49
    * equivalents in the given string
50
    */
51
   protected static final String addEscapes(String str) {
52
      StringBuffer retval = new StringBuffer();
53
      char ch;
54
      for (int i = 0; i < str.length(); i++) {
55
        switch (str.charAt(i))
56
        {
57
           case 0 :
58
              continue;
59
           case '\b':
60
              retval.append("\\b");
61
              continue;
62
           case '\t':
63
              retval.append("\\t");
64
              continue;
65
           case '\n':
66
              retval.append("\\n");
67
              continue;
68
           case '\f':
69
              retval.append("\\f");
70
              continue;
71
           case '\r':
72
              retval.append("\\r");
73
              continue;
74
           case '\"':
75
              retval.append("\\\"");
76
              continue;
77
           case '\'':
78
              retval.append("\\\'");
79
              continue;
80
           case '\\':
81
              retval.append("\\\\");
82
              continue;
83
           default:
84
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
85
                 String s = "0000" + Integer.toString(ch, 16);
86
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
87
              } else {
88
                 retval.append(ch);
89
              }
90
              continue;
91
        }
92
      }
93
      return retval.toString();
94
   }
95
96
   /**
97
    * Returns a detailed message for the Error when it is thrown by the
98
    * token manager to indicate a lexical error.
99
    * Parameters : 
100
    *    EOFSeen     : indicates if EOF caused the lexicl error
101
    *    curLexState : lexical state in which this error occured
102
    *    errorLine   : line number when the error occured
103
    *    errorColumn : column number when the error occured
104
    *    errorAfter  : prefix that was seen before this error occured
105
    *    curchar     : the offending character
106
    * Note: You can customize the lexical error message by modifying this method.
107
    */
108
   protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
109
      return("Lexical error at line " +
110
           errorLine + ", column " +
111
           errorColumn + ".  Encountered: " +
112
           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
113
           "after : \"" + addEscapes(errorAfter) + "\"");
114
   }
115
116
   /**
117
    * You can also modify the body of this method to customize your error messages.
118
    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
119
    * of end-users concern, so you can return something like : 
120
    *
121
    *     "Internal Error : Please file a bug report .... "
122
    *
123
    * from this method for such cases in the release version of your parser.
124
    */
125
   public String getMessage() {
126
      return super.getMessage();
127
   }
128
129
   /*
130
    * Constructors of various flavors follow.
131
    */
132
133
   public TokenMgrError() {
134
   }
135
136
   public TokenMgrError(String message, int reason) {
137
      super(message);
138
      errorCode = reason;
139
   }
140
141
   public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
142
      this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
143
   }
144
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Property4ViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class Property4ViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Property4EditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationClassNameViewFactory.java (+29 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory;
8
import org.eclipse.gmf.runtime.notation.View;
9
10
/**
11
 * @generated
12
 */
13
public class AssociationClassNameViewFactory extends BasicNodeViewFactory {
14
15
	/**
16
	 * @generated
17
	 */
18
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
19
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
20
	}
21
22
	/**
23
	 * @generated
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		return styles;
28
	}
29
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/property/Token.java (+81 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
2
package org.eclipse.uml2.diagram.clazz.parser.property;
3
4
/**
5
 * Describes the input token stream.
6
 */
7
8
public class Token {
9
10
  /**
11
   * An integer that describes the kind of this token.  This numbering
12
   * system is determined by JavaCCParser, and a table of these numbers is
13
   * stored in the file ...Constants.java.
14
   */
15
  public int kind;
16
17
  /**
18
   * beginLine and beginColumn describe the position of the first character
19
   * of this token; endLine and endColumn describe the position of the
20
   * last character of this token.
21
   */
22
  public int beginLine, beginColumn, endLine, endColumn;
23
24
  /**
25
   * The string image of the token.
26
   */
27
  public String image;
28
29
  /**
30
   * A reference to the next regular (non-special) token from the input
31
   * stream.  If this is the last token from the input stream, or if the
32
   * token manager has not read tokens beyond this one, this field is
33
   * set to null.  This is true only if this token is also a regular
34
   * token.  Otherwise, see below for a description of the contents of
35
   * this field.
36
   */
37
  public Token next;
38
39
  /**
40
   * This field is used to access special tokens that occur prior to this
41
   * token, but after the immediately preceding regular (non-special) token.
42
   * If there are no such special tokens, this field is set to null.
43
   * When there are more than one such special token, this field refers
44
   * to the last of these special tokens, which in turn refers to the next
45
   * previous special token through its specialToken field, and so on
46
   * until the first special token (whose specialToken field is null).
47
   * The next fields of special tokens refer to other special tokens that
48
   * immediately follow it (without an intervening regular token).  If there
49
   * is no such token, this field is null.
50
   */
51
  public Token specialToken;
52
53
  /**
54
   * Returns the image.
55
   */
56
  public String toString()
57
  {
58
     return image;
59
  }
60
61
  /**
62
   * Returns a new Token object, by default. However, if you want, you
63
   * can create and return subclass objects based on the value of ofKind.
64
   * Simply add the cases to the switch for all those special cases.
65
   * For example, if you have a subclass of Token called IDToken that
66
   * you want to create if ofKind is ID, simlpy add something like :
67
   *
68
   *    case MyParserConstants.ID : return new IDToken();
69
   *
70
   * to the following switch statement. Then you can cast matchedToken
71
   * variable to the appropriate type and use it in your lexical actions.
72
   */
73
  public static final Token newToken(int ofKind)
74
  {
75
     switch(ofKind)
76
     {
77
       default : return new Token();
78
     }
79
  }
80
81
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PackageNameViewFactory.java (+29 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory;
8
import org.eclipse.gmf.runtime.notation.View;
9
10
/**
11
 * @generated
12
 */
13
public class PackageNameViewFactory extends BasicNodeViewFactory {
14
15
	/**
16
	 * @generated
17
	 */
18
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
19
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
20
	}
21
22
	/**
23
	 * @generated
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		return styles;
28
	}
29
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/slot/Token.java (+92 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.slot;
14
15
/**
16
 * Describes the input token stream.
17
 */
18
19
public class Token {
20
21
  /**
22
   * An integer that describes the kind of this token.  This numbering
23
   * system is determined by JavaCCParser, and a table of these numbers is
24
   * stored in the file ...Constants.java.
25
   */
26
  public int kind;
27
28
  /**
29
   * beginLine and beginColumn describe the position of the first character
30
   * of this token; endLine and endColumn describe the position of the
31
   * last character of this token.
32
   */
33
  public int beginLine, beginColumn, endLine, endColumn;
34
35
  /**
36
   * The string image of the token.
37
   */
38
  public String image;
39
40
  /**
41
   * A reference to the next regular (non-special) token from the input
42
   * stream.  If this is the last token from the input stream, or if the
43
   * token manager has not read tokens beyond this one, this field is
44
   * set to null.  This is true only if this token is also a regular
45
   * token.  Otherwise, see below for a description of the contents of
46
   * this field.
47
   */
48
  public Token next;
49
50
  /**
51
   * This field is used to access special tokens that occur prior to this
52
   * token, but after the immediately preceding regular (non-special) token.
53
   * If there are no such special tokens, this field is set to null.
54
   * When there are more than one such special token, this field refers
55
   * to the last of these special tokens, which in turn refers to the next
56
   * previous special token through its specialToken field, and so on
57
   * until the first special token (whose specialToken field is null).
58
   * The next fields of special tokens refer to other special tokens that
59
   * immediately follow it (without an intervening regular token).  If there
60
   * is no such token, this field is null.
61
   */
62
  public Token specialToken;
63
64
  /**
65
   * Returns the image.
66
   */
67
  public String toString()
68
  {
69
     return image;
70
  }
71
72
  /**
73
   * Returns a new Token object, by default. However, if you want, you
74
   * can create and return subclass objects based on the value of ofKind.
75
   * Simply add the cases to the switch for all those special cases.
76
   * For example, if you have a subclass of Token called IDToken that
77
   * you want to create if ofKind is ID, simlpy add something like :
78
   *
79
   *    case MyParserConstants.ID : return new IDToken();
80
   *
81
   * to the following switch statement. Then you can cast matchedToken
82
   * variable to the appropriate type and use it in your lexical actions.
83
   */
84
  public static final Token newToken(int ofKind)
85
  {
86
     switch(ofKind)
87
     {
88
       default : return new Token();
89
     }
90
  }
91
92
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/PrimitiveTypeEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class PrimitiveTypeEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Property3ViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class Property3ViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Property3EditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/ClassClassesViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class ClassClassesViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.ClassClassesEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Property6ViewFactory.java (+51 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.PropertyNameEditPart;
15
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
16
17
/**
18
 * @generated
19
 */
20
public class Property6ViewFactory extends ConnectionViewFactory {
21
22
	/**
23
	 * @generated 
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		styles.add(NotationFactory.eINSTANCE.createRoutingStyle());
28
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
29
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
30
		return styles;
31
	}
32
33
	/**
34
	 * @generated
35
	 */
36
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
37
		if (semanticHint == null) {
38
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Property6EditPart.VISUAL_ID);
39
			view.setType(semanticHint);
40
		}
41
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
42
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
43
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
44
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
45
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
46
			view.getEAnnotations().add(shortcutAnnotation);
47
		}
48
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(PropertyNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
49
	}
50
51
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/slot/ParseException.java (+205 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.slot;
14
15
import org.eclipse.uml2.diagram.parser.ExternalParserException;
16
17
/**
18
 * This exception is thrown when parse errors are encountered.
19
 * You can explicitly create objects of this exception type by
20
 * calling the method generateParseException in the generated
21
 * parser.
22
 *
23
 * You can modify this class to customize your error reporting
24
 * mechanisms so long as you retain the public fields.
25
 */
26
public class ParseException extends ExternalParserException {
27
28
  /**
29
   * This constructor is used by the method "generateParseException"
30
   * in the generated parser.  Calling this constructor generates
31
   * a new object of this type with the fields "currentToken",
32
   * "expectedTokenSequences", and "tokenImage" set.  The boolean
33
   * flag "specialConstructor" is also set to true to indicate that
34
   * this constructor was used to create this object.
35
   * This constructor calls its super class with the empty string
36
   * to force the "toString" method of parent class "Throwable" to
37
   * print the error message in the form:
38
   *     ParseException: <result of getMessage>
39
   */
40
  public ParseException(Token currentTokenVal,
41
                        int[][] expectedTokenSequencesVal,
42
                        String[] tokenImageVal
43
                       )
44
  {
45
    super("");
46
    specialConstructor = true;
47
    currentToken = currentTokenVal;
48
    expectedTokenSequences = expectedTokenSequencesVal;
49
    tokenImage = tokenImageVal;
50
  }
51
52
  /**
53
   * The following constructors are for use by you for whatever
54
   * purpose you can think of.  Constructing the exception in this
55
   * manner makes the exception behave in the normal way - i.e., as
56
   * documented in the class "Throwable".  The fields "errorToken",
57
   * "expectedTokenSequences", and "tokenImage" do not contain
58
   * relevant information.  The JavaCC generated code does not use
59
   * these constructors.
60
   */
61
62
  public ParseException() {
63
    super();
64
    specialConstructor = false;
65
  }
66
67
  public ParseException(String message) {
68
    super(message);
69
    specialConstructor = false;
70
  }
71
72
  /**
73
   * This variable determines which constructor was used to create
74
   * this object and thereby affects the semantics of the
75
   * "getMessage" method (see below).
76
   */
77
  protected boolean specialConstructor;
78
79
  /**
80
   * This is the last token that has been consumed successfully.  If
81
   * this object has been created due to a parse error, the token
82
   * followng this token will (therefore) be the first error token.
83
   */
84
  public Token currentToken;
85
86
  /**
87
   * Each entry in this array is an array of integers.  Each array
88
   * of integers represents a sequence of tokens (by their ordinal
89
   * values) that is expected at this point of the parse.
90
   */
91
  public int[][] expectedTokenSequences;
92
93
  /**
94
   * This is a reference to the "tokenImage" array of the generated
95
   * parser within which the parse error occurred.  This array is
96
   * defined in the generated ...Constants interface.
97
   */
98
  public String[] tokenImage;
99
100
  /**
101
   * This method has the standard behavior when this object has been
102
   * created using the standard constructors.  Otherwise, it uses
103
   * "currentToken" and "expectedTokenSequences" to generate a parse
104
   * error message and returns it.  If this object has been created
105
   * due to a parse error, and you do not catch it (it gets thrown
106
   * from the parser), then this method is called during the printing
107
   * of the final stack trace, and hence the correct error message
108
   * gets displayed.
109
   */
110
  public String getMessage() {
111
    if (!specialConstructor) {
112
      return super.getMessage();
113
    }
114
    String expected = "";
115
    int maxSize = 0;
116
    for (int i = 0; i < expectedTokenSequences.length; i++) {
117
      if (maxSize < expectedTokenSequences[i].length) {
118
        maxSize = expectedTokenSequences[i].length;
119
      }
120
      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
121
        expected += tokenImage[expectedTokenSequences[i][j]] + " ";
122
      }
123
      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
124
        expected += "...";
125
      }
126
      expected += eol + "    ";
127
    }
128
    String retval = "Encountered \"";
129
    Token tok = currentToken.next;
130
    for (int i = 0; i < maxSize; i++) {
131
      if (i != 0) retval += " ";
132
      if (tok.kind == 0) {
133
        retval += tokenImage[0];
134
        break;
135
      }
136
      retval += add_escapes(tok.image);
137
      tok = tok.next; 
138
    }
139
    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
140
    retval += "." + eol;
141
    if (expectedTokenSequences.length == 1) {
142
      retval += "Was expecting:" + eol + "    ";
143
    } else {
144
      retval += "Was expecting one of:" + eol + "    ";
145
    }
146
    retval += expected;
147
    return retval;
148
  }
149
150
  /**
151
   * The end of line string for this machine.
152
   */
153
  protected String eol = System.getProperty("line.separator", "\n");
154
 
155
  /**
156
   * Used to convert raw characters to their escaped version
157
   * when these raw version cannot be used as part of an ASCII
158
   * string literal.
159
   */
160
  protected String add_escapes(String str) {
161
      StringBuffer retval = new StringBuffer();
162
      char ch;
163
      for (int i = 0; i < str.length(); i++) {
164
        switch (str.charAt(i))
165
        {
166
           case 0 :
167
              continue;
168
           case '\b':
169
              retval.append("\\b");
170
              continue;
171
           case '\t':
172
              retval.append("\\t");
173
              continue;
174
           case '\n':
175
              retval.append("\\n");
176
              continue;
177
           case '\f':
178
              retval.append("\\f");
179
              continue;
180
           case '\r':
181
              retval.append("\\r");
182
              continue;
183
           case '\"':
184
              retval.append("\\\"");
185
              continue;
186
           case '\'':
187
              retval.append("\\\'");
188
              continue;
189
           case '\\':
190
              retval.append("\\\\");
191
              continue;
192
           default:
193
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
194
                 String s = "0000" + Integer.toString(ch, 16);
195
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
196
              } else {
197
                 retval.append(ch);
198
              }
199
              continue;
200
        }
201
      }
202
      return retval.toString();
203
   }
204
205
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/Package2EditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class Package2EditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/property/TokenMgrError.java (+133 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
2
package org.eclipse.uml2.diagram.clazz.parser.property;
3
4
public class TokenMgrError extends Error
5
{
6
   /*
7
    * Ordinals for various reasons why an Error of this type can be thrown.
8
    */
9
10
   /**
11
    * Lexical error occured.
12
    */
13
   static final int LEXICAL_ERROR = 0;
14
15
   /**
16
    * An attempt wass made to create a second instance of a static token manager.
17
    */
18
   static final int STATIC_LEXER_ERROR = 1;
19
20
   /**
21
    * Tried to change to an invalid lexical state.
22
    */
23
   static final int INVALID_LEXICAL_STATE = 2;
24
25
   /**
26
    * Detected (and bailed out of) an infinite loop in the token manager.
27
    */
28
   static final int LOOP_DETECTED = 3;
29
30
   /**
31
    * Indicates the reason why the exception is thrown. It will have
32
    * one of the above 4 values.
33
    */
34
   int errorCode;
35
36
   /**
37
    * Replaces unprintable characters by their espaced (or unicode escaped)
38
    * equivalents in the given string
39
    */
40
   protected static final String addEscapes(String str) {
41
      StringBuffer retval = new StringBuffer();
42
      char ch;
43
      for (int i = 0; i < str.length(); i++) {
44
        switch (str.charAt(i))
45
        {
46
           case 0 :
47
              continue;
48
           case '\b':
49
              retval.append("\\b");
50
              continue;
51
           case '\t':
52
              retval.append("\\t");
53
              continue;
54
           case '\n':
55
              retval.append("\\n");
56
              continue;
57
           case '\f':
58
              retval.append("\\f");
59
              continue;
60
           case '\r':
61
              retval.append("\\r");
62
              continue;
63
           case '\"':
64
              retval.append("\\\"");
65
              continue;
66
           case '\'':
67
              retval.append("\\\'");
68
              continue;
69
           case '\\':
70
              retval.append("\\\\");
71
              continue;
72
           default:
73
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
74
                 String s = "0000" + Integer.toString(ch, 16);
75
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
76
              } else {
77
                 retval.append(ch);
78
              }
79
              continue;
80
        }
81
      }
82
      return retval.toString();
83
   }
84
85
   /**
86
    * Returns a detailed message for the Error when it is thrown by the
87
    * token manager to indicate a lexical error.
88
    * Parameters : 
89
    *    EOFSeen     : indicates if EOF caused the lexicl error
90
    *    curLexState : lexical state in which this error occured
91
    *    errorLine   : line number when the error occured
92
    *    errorColumn : column number when the error occured
93
    *    errorAfter  : prefix that was seen before this error occured
94
    *    curchar     : the offending character
95
    * Note: You can customize the lexical error message by modifying this method.
96
    */
97
   protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
98
      return("Lexical error at line " +
99
           errorLine + ", column " +
100
           errorColumn + ".  Encountered: " +
101
           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
102
           "after : \"" + addEscapes(errorAfter) + "\"");
103
   }
104
105
   /**
106
    * You can also modify the body of this method to customize your error messages.
107
    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
108
    * of end-users concern, so you can return something like : 
109
    *
110
    *     "Internal Error : Please file a bug report .... "
111
    *
112
    * from this method for such cases in the release version of your parser.
113
    */
114
   public String getMessage() {
115
      return super.getMessage();
116
   }
117
118
   /*
119
    * Constructors of various flavors follow.
120
    */
121
122
   public TokenMgrError() {
123
   }
124
125
   public TokenMgrError(String message, int reason) {
126
      super(message);
127
      errorCode = reason;
128
   }
129
130
   public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
131
      this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
132
   }
133
}
(-)src/org/eclipse/uml2/diagram/clazz/providers/UMLElementTypes.java (+1062 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.providers;
2
3
import java.util.ArrayList;
4
import java.util.Collection;
5
import java.util.HashSet;
6
import java.util.IdentityHashMap;
7
import java.util.List;
8
import java.util.Map;
9
import java.util.Set;
10
11
import org.eclipse.core.runtime.IAdaptable;
12
import org.eclipse.emf.ecore.EClass;
13
import org.eclipse.emf.ecore.ENamedElement;
14
import org.eclipse.emf.ecore.EObject;
15
import org.eclipse.emf.ecore.EStructuralFeature;
16
import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
17
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
18
import org.eclipse.jface.resource.ImageDescriptor;
19
import org.eclipse.jface.resource.ImageRegistry;
20
import org.eclipse.swt.graphics.Image;
21
import org.eclipse.uml2.diagram.clazz.expressions.UMLAbstractExpression;
22
import org.eclipse.uml2.diagram.clazz.expressions.UMLOCLFactory;
23
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
24
import org.eclipse.uml2.uml.UMLPackage;
25
26
/**
27
 * @generated
28
 */
29
public class UMLElementTypes {
30
31
	/**
32
	 * @generated
33
	 */
34
	private UMLElementTypes() {
35
	}
36
37
	/**
38
	 * @generated
39
	 */
40
	private static Map elements;
41
42
	/**
43
	 * @generated
44
	 */
45
	private static ImageRegistry imageRegistry;
46
47
	/**
48
	 * @generated
49
	 */
50
	private static ImageRegistry getImageRegistry() {
51
		if (imageRegistry == null) {
52
			imageRegistry = new ImageRegistry();
53
		}
54
		return imageRegistry;
55
	}
56
57
	/**
58
	 * @generated
59
	 */
60
	private static String getImageRegistryKey(ENamedElement element) {
61
		return element.getName();
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	private static ImageDescriptor getProvidedImageDescriptor(ENamedElement element) {
68
		if (element instanceof EStructuralFeature) {
69
			element = ((EStructuralFeature) element).getEContainingClass();
70
		}
71
		if (element instanceof EClass) {
72
			EClass eClass = (EClass) element;
73
			if (!eClass.isAbstract()) {
74
				return UMLDiagramEditorPlugin.getInstance().getItemImageDescriptor(eClass.getEPackage().getEFactoryInstance().create(eClass));
75
			}
76
		}
77
		// TODO : support structural features
78
		return null;
79
	}
80
81
	/**
82
	 * @generated
83
	 */
84
	public static ImageDescriptor getImageDescriptor(ENamedElement element) {
85
		String key = getImageRegistryKey(element);
86
		ImageDescriptor imageDescriptor = getImageRegistry().getDescriptor(key);
87
		if (imageDescriptor == null) {
88
			imageDescriptor = getProvidedImageDescriptor(element);
89
			if (imageDescriptor == null) {
90
				imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
91
			}
92
			getImageRegistry().put(key, imageDescriptor);
93
		}
94
		return imageDescriptor;
95
	}
96
97
	/**
98
	 * @generated
99
	 */
100
	public static Image getImage(ENamedElement element) {
101
		String key = getImageRegistryKey(element);
102
		Image image = getImageRegistry().get(key);
103
		if (image == null) {
104
			ImageDescriptor imageDescriptor = getProvidedImageDescriptor(element);
105
			if (imageDescriptor == null) {
106
				imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
107
			}
108
			getImageRegistry().put(key, imageDescriptor);
109
			image = getImageRegistry().get(key);
110
		}
111
		return image;
112
	}
113
114
	/**
115
	 * @generated
116
	 */
117
	public static ImageDescriptor getImageDescriptor(IAdaptable hint) {
118
		ENamedElement element = getElement(hint);
119
		if (element == null) {
120
			return null;
121
		}
122
		return getImageDescriptor(element);
123
	}
124
125
	/**
126
	 * @generated
127
	 */
128
	public static Image getImage(IAdaptable hint) {
129
		ENamedElement element = getElement(hint);
130
		if (element == null) {
131
			return null;
132
		}
133
		return getImage(element);
134
	}
135
136
	/**
137
	 * Returns 'type' of the ecore object associated with the hint.
138
	 * 
139
	 * @generated
140
	 */
141
	public static ENamedElement getElement(IAdaptable hint) {
142
		Object type = hint.getAdapter(IElementType.class);
143
		if (elements == null) {
144
			elements = new IdentityHashMap();
145
			elements.put(Package_1000, UMLPackage.eINSTANCE.getPackage());
146
			elements.put(Package_3006, UMLPackage.eINSTANCE.getPackage());
147
			elements.put(Class_3007, UMLPackage.eINSTANCE.getClass_());
148
			elements.put(DataType_3008, UMLPackage.eINSTANCE.getDataType());
149
			elements.put(PrimitiveType_3009, UMLPackage.eINSTANCE.getPrimitiveType());
150
			elements.put(Enumeration_3011, UMLPackage.eINSTANCE.getEnumeration());
151
			elements.put(AssociationClass_3012, UMLPackage.eINSTANCE.getAssociationClass());
152
			elements.put(InstanceSpecification_3013, UMLPackage.eINSTANCE.getInstanceSpecification());
153
			elements.put(Property_3001, UMLPackage.eINSTANCE.getProperty());
154
			elements.put(Operation_3002, UMLPackage.eINSTANCE.getOperation());
155
			elements.put(Class_3003, UMLPackage.eINSTANCE.getClass_());
156
			elements.put(Port_3025, UMLPackage.eINSTANCE.getPort());
157
			elements.put(Property_3019, UMLPackage.eINSTANCE.getProperty());
158
			elements.put(Operation_3020, UMLPackage.eINSTANCE.getOperation());
159
			elements.put(Property_3014, UMLPackage.eINSTANCE.getProperty());
160
			elements.put(Operation_3015, UMLPackage.eINSTANCE.getOperation());
161
			elements.put(Property_3021, UMLPackage.eINSTANCE.getProperty());
162
			elements.put(Operation_3022, UMLPackage.eINSTANCE.getOperation());
163
			elements.put(EnumerationLiteral_3016, UMLPackage.eINSTANCE.getEnumerationLiteral());
164
			elements.put(Property_3023, UMLPackage.eINSTANCE.getProperty());
165
			elements.put(Operation_3024, UMLPackage.eINSTANCE.getOperation());
166
			elements.put(LiteralString_3005, UMLPackage.eINSTANCE.getLiteralString());
167
			elements.put(Slot_3017, UMLPackage.eINSTANCE.getSlot());
168
			elements.put(Package_2002, UMLPackage.eINSTANCE.getPackage());
169
			elements.put(Class_2001, UMLPackage.eINSTANCE.getClass_());
170
			elements.put(AssociationClass_2007, UMLPackage.eINSTANCE.getAssociationClass());
171
			elements.put(DataType_2004, UMLPackage.eINSTANCE.getDataType());
172
			elements.put(PrimitiveType_2005, UMLPackage.eINSTANCE.getPrimitiveType());
173
			elements.put(Enumeration_2003, UMLPackage.eINSTANCE.getEnumeration());
174
			elements.put(Interface_2010, UMLPackage.eINSTANCE.getInterface());
175
			elements.put(Constraint_2006, UMLPackage.eINSTANCE.getConstraint());
176
			elements.put(InstanceSpecification_2008, UMLPackage.eINSTANCE.getInstanceSpecification());
177
			elements.put(Dependency_2009, UMLPackage.eINSTANCE.getDependency());
178
			elements.put(Generalization_4001, UMLPackage.eINSTANCE.getGeneralization());
179
			elements.put(Dependency_4002, UMLPackage.eINSTANCE.getDependency());
180
			elements.put(Property_4003, UMLPackage.eINSTANCE.getProperty());
181
			elements.put(ConstraintConstrainedElement_4004, UMLPackage.eINSTANCE.getConstraint_ConstrainedElement());
182
			elements.put(Association_4005, UMLPackage.eINSTANCE.getAssociation());
183
			elements.put(DependencySupplier_4006, UMLPackage.eINSTANCE.getDependency_Supplier());
184
			elements.put(DependencyClient_4007, UMLPackage.eINSTANCE.getDependency_Client());
185
			elements.put(InterfaceRealization_4008, UMLPackage.eINSTANCE.getInterfaceRealization());
186
			elements.put(Usage_4009, UMLPackage.eINSTANCE.getUsage());
187
		}
188
		return (ENamedElement) elements.get(type);
189
	}
190
191
	/**
192
	 * @generated
193
	 */
194
	public static final IElementType Package_1000 = getElementType("org.eclipse.uml2.diagram.clazz.Package_1000"); //$NON-NLS-1$
195
196
	/**
197
	 * @generated
198
	 */
199
	public static final IElementType Package_3006 = getElementType("org.eclipse.uml2.diagram.clazz.Package_3006"); //$NON-NLS-1$
200
201
	/**
202
	 * @generated
203
	 */
204
	public static final IElementType Class_3007 = getElementType("org.eclipse.uml2.diagram.clazz.Class_3007"); //$NON-NLS-1$
205
206
	/**
207
	 * @generated
208
	 */
209
	public static final IElementType DataType_3008 = getElementType("org.eclipse.uml2.diagram.clazz.DataType_3008"); //$NON-NLS-1$
210
211
	/**
212
	 * @generated
213
	 */
214
	public static final IElementType PrimitiveType_3009 = getElementType("org.eclipse.uml2.diagram.clazz.PrimitiveType_3009"); //$NON-NLS-1$
215
216
	/**
217
	 * @generated
218
	 */
219
	public static final IElementType Enumeration_3011 = getElementType("org.eclipse.uml2.diagram.clazz.Enumeration_3011"); //$NON-NLS-1$
220
221
	/**
222
	 * @generated
223
	 */
224
	public static final IElementType AssociationClass_3012 = getElementType("org.eclipse.uml2.diagram.clazz.AssociationClass_3012"); //$NON-NLS-1$
225
226
	/**
227
	 * @generated
228
	 */
229
	public static final IElementType InstanceSpecification_3013 = getElementType("org.eclipse.uml2.diagram.clazz.InstanceSpecification_3013"); //$NON-NLS-1$
230
231
	/**
232
	 * @generated
233
	 */
234
	public static final IElementType Property_3001 = getElementType("org.eclipse.uml2.diagram.clazz.Property_3001"); //$NON-NLS-1$
235
236
	/**
237
	 * @generated
238
	 */
239
	public static final IElementType Operation_3002 = getElementType("org.eclipse.uml2.diagram.clazz.Operation_3002"); //$NON-NLS-1$
240
241
	/**
242
	 * @generated
243
	 */
244
	public static final IElementType Class_3003 = getElementType("org.eclipse.uml2.diagram.clazz.Class_3003"); //$NON-NLS-1$
245
246
	/**
247
	 * @generated
248
	 */
249
	public static final IElementType Port_3025 = getElementType("org.eclipse.uml2.diagram.clazz.Port_3025"); //$NON-NLS-1$
250
251
	/**
252
	 * @generated
253
	 */
254
	public static final IElementType Property_3019 = getElementType("org.eclipse.uml2.diagram.clazz.Property_3019"); //$NON-NLS-1$
255
256
	/**
257
	 * @generated
258
	 */
259
	public static final IElementType Operation_3020 = getElementType("org.eclipse.uml2.diagram.clazz.Operation_3020"); //$NON-NLS-1$
260
261
	/**
262
	 * @generated
263
	 */
264
	public static final IElementType Property_3014 = getElementType("org.eclipse.uml2.diagram.clazz.Property_3014"); //$NON-NLS-1$
265
266
	/**
267
	 * @generated
268
	 */
269
	public static final IElementType Operation_3015 = getElementType("org.eclipse.uml2.diagram.clazz.Operation_3015"); //$NON-NLS-1$
270
271
	/**
272
	 * @generated
273
	 */
274
	public static final IElementType Property_3021 = getElementType("org.eclipse.uml2.diagram.clazz.Property_3021"); //$NON-NLS-1$
275
276
	/**
277
	 * @generated
278
	 */
279
	public static final IElementType Operation_3022 = getElementType("org.eclipse.uml2.diagram.clazz.Operation_3022"); //$NON-NLS-1$
280
281
	/**
282
	 * @generated
283
	 */
284
	public static final IElementType EnumerationLiteral_3016 = getElementType("org.eclipse.uml2.diagram.clazz.EnumerationLiteral_3016"); //$NON-NLS-1$
285
286
	/**
287
	 * @generated
288
	 */
289
	public static final IElementType Property_3023 = getElementType("org.eclipse.uml2.diagram.clazz.Property_3023"); //$NON-NLS-1$
290
291
	/**
292
	 * @generated
293
	 */
294
	public static final IElementType Operation_3024 = getElementType("org.eclipse.uml2.diagram.clazz.Operation_3024"); //$NON-NLS-1$
295
296
	/**
297
	 * @generated
298
	 */
299
	public static final IElementType LiteralString_3005 = getElementType("org.eclipse.uml2.diagram.clazz.LiteralString_3005"); //$NON-NLS-1$
300
301
	/**
302
	 * @generated
303
	 */
304
	public static final IElementType Slot_3017 = getElementType("org.eclipse.uml2.diagram.clazz.Slot_3017"); //$NON-NLS-1$
305
306
	/**
307
	 * @generated
308
	 */
309
	public static final IElementType Package_2002 = getElementType("org.eclipse.uml2.diagram.clazz.Package_2002"); //$NON-NLS-1$
310
311
	/**
312
	 * @generated
313
	 */
314
	public static final IElementType Class_2001 = getElementType("org.eclipse.uml2.diagram.clazz.Class_2001"); //$NON-NLS-1$
315
316
	/**
317
	 * @generated
318
	 */
319
	public static final IElementType AssociationClass_2007 = getElementType("org.eclipse.uml2.diagram.clazz.AssociationClass_2007"); //$NON-NLS-1$
320
321
	/**
322
	 * @generated
323
	 */
324
	public static final IElementType DataType_2004 = getElementType("org.eclipse.uml2.diagram.clazz.DataType_2004"); //$NON-NLS-1$
325
326
	/**
327
	 * @generated
328
	 */
329
	public static final IElementType PrimitiveType_2005 = getElementType("org.eclipse.uml2.diagram.clazz.PrimitiveType_2005"); //$NON-NLS-1$
330
331
	/**
332
	 * @generated
333
	 */
334
	public static final IElementType Enumeration_2003 = getElementType("org.eclipse.uml2.diagram.clazz.Enumeration_2003"); //$NON-NLS-1$
335
336
	/**
337
	 * @generated
338
	 */
339
	public static final IElementType Interface_2010 = getElementType("org.eclipse.uml2.diagram.clazz.Interface_2010"); //$NON-NLS-1$
340
341
	/**
342
	 * @generated
343
	 */
344
	public static final IElementType Constraint_2006 = getElementType("org.eclipse.uml2.diagram.clazz.Constraint_2006"); //$NON-NLS-1$
345
346
	/**
347
	 * @generated
348
	 */
349
	public static final IElementType InstanceSpecification_2008 = getElementType("org.eclipse.uml2.diagram.clazz.InstanceSpecification_2008"); //$NON-NLS-1$
350
351
	/**
352
	 * @generated
353
	 */
354
	public static final IElementType Dependency_2009 = getElementType("org.eclipse.uml2.diagram.clazz.Dependency_2009"); //$NON-NLS-1$
355
356
	/**
357
	 * @generated
358
	 */
359
	public static final IElementType Generalization_4001 = getElementType("org.eclipse.uml2.diagram.clazz.Generalization_4001"); //$NON-NLS-1$
360
361
	/**
362
	 * @generated
363
	 */
364
	public static final IElementType Dependency_4002 = getElementType("org.eclipse.uml2.diagram.clazz.Dependency_4002"); //$NON-NLS-1$
365
366
	/**
367
	 * @generated
368
	 */
369
	public static final IElementType Property_4003 = getElementType("org.eclipse.uml2.diagram.clazz.Property_4003"); //$NON-NLS-1$
370
371
	/**
372
	 * @generated
373
	 */
374
	public static final IElementType ConstraintConstrainedElement_4004 = getElementType("org.eclipse.uml2.diagram.clazz.ConstraintConstrainedElement_4004"); //$NON-NLS-1$
375
376
	/**
377
	 * @generated
378
	 */
379
	public static final IElementType Association_4005 = getElementType("org.eclipse.uml2.diagram.clazz.Association_4005"); //$NON-NLS-1$
380
381
	/**
382
	 * @generated
383
	 */
384
	public static final IElementType DependencySupplier_4006 = getElementType("org.eclipse.uml2.diagram.clazz.DependencySupplier_4006"); //$NON-NLS-1$
385
386
	/**
387
	 * @generated
388
	 */
389
	public static final IElementType DependencyClient_4007 = getElementType("org.eclipse.uml2.diagram.clazz.DependencyClient_4007"); //$NON-NLS-1$
390
391
	/**
392
	 * @generated
393
	 */
394
	public static final IElementType InterfaceRealization_4008 = getElementType("org.eclipse.uml2.diagram.clazz.InterfaceRealization_4008"); //$NON-NLS-1$
395
396
	/**
397
	 * @generated
398
	 */
399
	public static final IElementType Usage_4009 = getElementType("org.eclipse.uml2.diagram.clazz.Usage_4009"); //$NON-NLS-1$
400
401
	/**
402
	 * @generated
403
	 */
404
	private static IElementType getElementType(String id) {
405
		return ElementTypeRegistry.getInstance().getType(id);
406
	}
407
408
	/**
409
	 * @generated
410
	 */
411
	private static Set KNOWN_ELEMENT_TYPES;
412
413
	/**
414
	 * @generated
415
	 */
416
	public static boolean isKnownElementType(IElementType elementType) {
417
		if (KNOWN_ELEMENT_TYPES == null) {
418
			KNOWN_ELEMENT_TYPES = new HashSet();
419
			KNOWN_ELEMENT_TYPES.add(Package_1000);
420
			KNOWN_ELEMENT_TYPES.add(Package_3006);
421
			KNOWN_ELEMENT_TYPES.add(Class_3007);
422
			KNOWN_ELEMENT_TYPES.add(DataType_3008);
423
			KNOWN_ELEMENT_TYPES.add(PrimitiveType_3009);
424
			KNOWN_ELEMENT_TYPES.add(Enumeration_3011);
425
			KNOWN_ELEMENT_TYPES.add(AssociationClass_3012);
426
			KNOWN_ELEMENT_TYPES.add(InstanceSpecification_3013);
427
			KNOWN_ELEMENT_TYPES.add(Property_3001);
428
			KNOWN_ELEMENT_TYPES.add(Operation_3002);
429
			KNOWN_ELEMENT_TYPES.add(Class_3003);
430
			KNOWN_ELEMENT_TYPES.add(Port_3025);
431
			KNOWN_ELEMENT_TYPES.add(Property_3019);
432
			KNOWN_ELEMENT_TYPES.add(Operation_3020);
433
			KNOWN_ELEMENT_TYPES.add(Property_3014);
434
			KNOWN_ELEMENT_TYPES.add(Operation_3015);
435
			KNOWN_ELEMENT_TYPES.add(Property_3021);
436
			KNOWN_ELEMENT_TYPES.add(Operation_3022);
437
			KNOWN_ELEMENT_TYPES.add(EnumerationLiteral_3016);
438
			KNOWN_ELEMENT_TYPES.add(Property_3023);
439
			KNOWN_ELEMENT_TYPES.add(Operation_3024);
440
			KNOWN_ELEMENT_TYPES.add(LiteralString_3005);
441
			KNOWN_ELEMENT_TYPES.add(Slot_3017);
442
			KNOWN_ELEMENT_TYPES.add(Package_2002);
443
			KNOWN_ELEMENT_TYPES.add(Class_2001);
444
			KNOWN_ELEMENT_TYPES.add(AssociationClass_2007);
445
			KNOWN_ELEMENT_TYPES.add(DataType_2004);
446
			KNOWN_ELEMENT_TYPES.add(PrimitiveType_2005);
447
			KNOWN_ELEMENT_TYPES.add(Enumeration_2003);
448
			KNOWN_ELEMENT_TYPES.add(Interface_2010);
449
			KNOWN_ELEMENT_TYPES.add(Constraint_2006);
450
			KNOWN_ELEMENT_TYPES.add(InstanceSpecification_2008);
451
			KNOWN_ELEMENT_TYPES.add(Dependency_2009);
452
			KNOWN_ELEMENT_TYPES.add(Generalization_4001);
453
			KNOWN_ELEMENT_TYPES.add(Dependency_4002);
454
			KNOWN_ELEMENT_TYPES.add(Property_4003);
455
			KNOWN_ELEMENT_TYPES.add(ConstraintConstrainedElement_4004);
456
			KNOWN_ELEMENT_TYPES.add(Association_4005);
457
			KNOWN_ELEMENT_TYPES.add(DependencySupplier_4006);
458
			KNOWN_ELEMENT_TYPES.add(DependencyClient_4007);
459
			KNOWN_ELEMENT_TYPES.add(InterfaceRealization_4008);
460
			KNOWN_ELEMENT_TYPES.add(Usage_4009);
461
		}
462
		return KNOWN_ELEMENT_TYPES.contains(elementType);
463
	}
464
465
	/**
466
	 * @generated
467
	 */
468
	public static class Initializers {
469
470
		/**
471
		 * @generated
472
		 */
473
		public static final IObjectInitializer Package_2002 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getPackage()) {
474
475
			protected void init() {
476
				add(createExpressionFeatureInitializer(
477
						UMLPackage.eINSTANCE.getNamedElement_Name(),
478
						UMLOCLFactory
479
								.getExpression(
480
										" let base : String = \'package\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
481
										UMLPackage.eINSTANCE.getPackage())));
482
			}
483
		}; // Package_2002 ObjectInitializer		
484
485
		/**
486
		 * @generated
487
		 */
488
		public static final IObjectInitializer Class_2001 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getClass_()) {
489
490
			protected void init() {
491
				add(createExpressionFeatureInitializer(
492
						UMLPackage.eINSTANCE.getNamedElement_Name(),
493
						UMLOCLFactory
494
								.getExpression(
495
										"let base : String = \'Class\' in\r\nlet suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in \r\nlet space : Namespace = self.namespace in\r\nlet allMissed : Sequence(String) = suffixes->\r\n    select(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s))\r\n    ) in\r\nlet firstMissed : String = allMissed->first() in \r\nlet noMisses : Boolean = firstMissed.oclIsUndefined() in\r\nlet allNames : Set(String) = \r\n    if noMisses \r\n    then \r\n    space.member->collect(e : NamedElement | \r\n         if e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base\r\n         then \'\' \r\n         else e.name \r\n         endif)->asSet()->excluding(\'\') else Set{\'not in use\'} \r\n    endif in \r\nlet longestName : String = \r\n    if noMisses\r\n    then allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first() \r\n    else \'not in use\' \r\n    endif in \r\nif noMisses then \r\n    if longestName.oclIsUndefined() \r\n    then base \r\n    else longestName.concat(\'1\') \r\n    endif \r\nelse \r\n    base.concat(firstMissed) \r\nendif ", //$NON-NLS-1$
496
										UMLPackage.eINSTANCE.getClass_())));
497
			}
498
		}; // Class_2001 ObjectInitializer		
499
500
		/**
501
		 * @generated
502
		 */
503
		public static final IObjectInitializer AssociationClass_2007 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getAssociationClass()) {
504
505
			protected void init() {
506
				add(createExpressionFeatureInitializer(
507
						UMLPackage.eINSTANCE.getNamedElement_Name(),
508
						UMLOCLFactory
509
								.getExpression(
510
										" let base : String = \'AssociationClass\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
511
										UMLPackage.eINSTANCE.getAssociationClass())));
512
			}
513
		}; // AssociationClass_2007 ObjectInitializer		
514
515
		/**
516
		 * @generated
517
		 */
518
		public static final IObjectInitializer DataType_2004 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getDataType()) {
519
520
			protected void init() {
521
				add(createExpressionFeatureInitializer(
522
						UMLPackage.eINSTANCE.getNamedElement_Name(),
523
						UMLOCLFactory
524
								.getExpression(
525
										" let base : String = \'DataType\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
526
										UMLPackage.eINSTANCE.getDataType())));
527
			}
528
		}; // DataType_2004 ObjectInitializer		
529
530
		/**
531
		 * @generated
532
		 */
533
		public static final IObjectInitializer PrimitiveType_2005 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getPrimitiveType()) {
534
535
			protected void init() {
536
				add(createExpressionFeatureInitializer(
537
						UMLPackage.eINSTANCE.getNamedElement_Name(),
538
						UMLOCLFactory
539
								.getExpression(
540
										" let base : String = \'PrimitiveType\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
541
										UMLPackage.eINSTANCE.getPrimitiveType())));
542
			}
543
		}; // PrimitiveType_2005 ObjectInitializer		
544
545
		/**
546
		 * @generated
547
		 */
548
		public static final IObjectInitializer Enumeration_2003 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getEnumeration()) {
549
550
			protected void init() {
551
				add(createExpressionFeatureInitializer(
552
						UMLPackage.eINSTANCE.getNamedElement_Name(),
553
						UMLOCLFactory
554
								.getExpression(
555
										" let base : String = \'Enumeration\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
556
										UMLPackage.eINSTANCE.getEnumeration())));
557
			}
558
		}; // Enumeration_2003 ObjectInitializer		
559
560
		/**
561
		 * @generated
562
		 */
563
		public static final IObjectInitializer Interface_2010 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getInterface()) {
564
565
			protected void init() {
566
				add(createExpressionFeatureInitializer(
567
						UMLPackage.eINSTANCE.getNamedElement_Name(),
568
						UMLOCLFactory
569
								.getExpression(
570
										" let base : String = \'Interface\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
571
										UMLPackage.eINSTANCE.getInterface())));
572
			}
573
		}; // Interface_2010 ObjectInitializer		
574
575
		/**
576
		 * @generated
577
		 */
578
		public static final IObjectInitializer Constraint_2006 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getConstraint()) {
579
580
			protected void init() {
581
				add(createExpressionFeatureInitializer(
582
						UMLPackage.eINSTANCE.getNamedElement_Name(),
583
						UMLOCLFactory
584
								.getExpression(
585
										" let base : String = \'constraint\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
586
										UMLPackage.eINSTANCE.getConstraint())));
587
			}
588
		}; // Constraint_2006 ObjectInitializer		
589
590
		/**
591
		 * @generated
592
		 */
593
		public static final IObjectInitializer InstanceSpecification_2008 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getInstanceSpecification()) {
594
595
			protected void init() {
596
				add(createExpressionFeatureInitializer(
597
						UMLPackage.eINSTANCE.getNamedElement_Name(),
598
						UMLOCLFactory
599
								.getExpression(
600
										" let base : String = \'instanceSpecification\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
601
										UMLPackage.eINSTANCE.getInstanceSpecification())));
602
			}
603
		}; // InstanceSpecification_2008 ObjectInitializer		
604
605
		/**
606
		 * @generated
607
		 */
608
		public static final IObjectInitializer Dependency_2009 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getDependency()) {
609
610
			protected void init() {
611
				add(createExpressionFeatureInitializer(
612
						UMLPackage.eINSTANCE.getNamedElement_Name(),
613
						UMLOCLFactory
614
								.getExpression(
615
										" let base : String = \'dependency\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
616
										UMLPackage.eINSTANCE.getDependency())));
617
			}
618
		}; // Dependency_2009 ObjectInitializer		
619
620
		/**
621
		 * @generated
622
		 */
623
		public static final IObjectInitializer Package_3006 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getPackage()) {
624
625
			protected void init() {
626
				add(createExpressionFeatureInitializer(
627
						UMLPackage.eINSTANCE.getNamedElement_Name(),
628
						UMLOCLFactory
629
								.getExpression(
630
										" let base : String = \'package\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
631
										UMLPackage.eINSTANCE.getPackage())));
632
			}
633
		}; // Package_3006 ObjectInitializer		
634
635
		/**
636
		 * @generated
637
		 */
638
		public static final IObjectInitializer Class_3007 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getClass_()) {
639
640
			protected void init() {
641
				add(createExpressionFeatureInitializer(
642
						UMLPackage.eINSTANCE.getNamedElement_Name(),
643
						UMLOCLFactory
644
								.getExpression(
645
										" let base : String = \'Class\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
646
										UMLPackage.eINSTANCE.getClass_())));
647
			}
648
		}; // Class_3007 ObjectInitializer		
649
650
		/**
651
		 * @generated
652
		 */
653
		public static final IObjectInitializer DataType_3008 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getDataType()) {
654
655
			protected void init() {
656
				add(createExpressionFeatureInitializer(
657
						UMLPackage.eINSTANCE.getNamedElement_Name(),
658
						UMLOCLFactory
659
								.getExpression(
660
										" let base : String = \'DataType\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
661
										UMLPackage.eINSTANCE.getDataType())));
662
			}
663
		}; // DataType_3008 ObjectInitializer		
664
665
		/**
666
		 * @generated
667
		 */
668
		public static final IObjectInitializer PrimitiveType_3009 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getPrimitiveType()) {
669
670
			protected void init() {
671
				add(createExpressionFeatureInitializer(
672
						UMLPackage.eINSTANCE.getNamedElement_Name(),
673
						UMLOCLFactory
674
								.getExpression(
675
										" let base : String = \'PrimitiveType\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
676
										UMLPackage.eINSTANCE.getPrimitiveType())));
677
			}
678
		}; // PrimitiveType_3009 ObjectInitializer		
679
680
		/**
681
		 * @generated
682
		 */
683
		public static final IObjectInitializer Enumeration_3011 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getEnumeration()) {
684
685
			protected void init() {
686
				add(createExpressionFeatureInitializer(
687
						UMLPackage.eINSTANCE.getNamedElement_Name(),
688
						UMLOCLFactory
689
								.getExpression(
690
										" let base : String = \'Enumeration\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
691
										UMLPackage.eINSTANCE.getEnumeration())));
692
			}
693
		}; // Enumeration_3011 ObjectInitializer		
694
695
		/**
696
		 * @generated
697
		 */
698
		public static final IObjectInitializer AssociationClass_3012 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getAssociationClass()) {
699
700
			protected void init() {
701
				add(createExpressionFeatureInitializer(
702
						UMLPackage.eINSTANCE.getNamedElement_Name(),
703
						UMLOCLFactory
704
								.getExpression(
705
										" let base : String = \'AssociationClass\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
706
										UMLPackage.eINSTANCE.getAssociationClass())));
707
			}
708
		}; // AssociationClass_3012 ObjectInitializer		
709
710
		/**
711
		 * @generated
712
		 */
713
		public static final IObjectInitializer InstanceSpecification_3013 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getInstanceSpecification()) {
714
715
			protected void init() {
716
				add(createExpressionFeatureInitializer(
717
						UMLPackage.eINSTANCE.getNamedElement_Name(),
718
						UMLOCLFactory
719
								.getExpression(
720
										" let base : String = \'instanceSpecification\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
721
										UMLPackage.eINSTANCE.getInstanceSpecification())));
722
			}
723
		}; // InstanceSpecification_3013 ObjectInitializer		
724
725
		/**
726
		 * @generated
727
		 */
728
		public static final IObjectInitializer Property_3001 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getProperty()) {
729
730
			protected void init() {
731
				add(createExpressionFeatureInitializer(UMLPackage.eINSTANCE.getProperty_Aggregation(), UMLOCLFactory.getExpression("AggregationKind::composite", //$NON-NLS-1$
732
						UMLPackage.eINSTANCE.getProperty())));
733
				add(createExpressionFeatureInitializer(
734
						UMLPackage.eINSTANCE.getNamedElement_Name(),
735
						UMLOCLFactory
736
								.getExpression(
737
										" let base : String = \'property\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
738
										UMLPackage.eINSTANCE.getProperty())));
739
			}
740
		}; // Property_3001 ObjectInitializer		
741
742
		/**
743
		 * @generated
744
		 */
745
		public static final IObjectInitializer Operation_3002 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getOperation()) {
746
747
			protected void init() {
748
				add(createExpressionFeatureInitializer(
749
						UMLPackage.eINSTANCE.getNamedElement_Name(),
750
						UMLOCLFactory
751
								.getExpression(
752
										" let base : String = \'operation\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
753
										UMLPackage.eINSTANCE.getOperation())));
754
			}
755
		}; // Operation_3002 ObjectInitializer		
756
757
		/**
758
		 * @generated
759
		 */
760
		public static final IObjectInitializer Class_3003 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getClass_()) {
761
762
			protected void init() {
763
				add(createExpressionFeatureInitializer(
764
						UMLPackage.eINSTANCE.getNamedElement_Name(),
765
						UMLOCLFactory
766
								.getExpression(
767
										" let base : String = \'Class\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
768
										UMLPackage.eINSTANCE.getClass_())));
769
			}
770
		}; // Class_3003 ObjectInitializer		
771
772
		/**
773
		 * @generated
774
		 */
775
		public static final IObjectInitializer Port_3025 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getPort()) {
776
777
			protected void init() {
778
				add(createExpressionFeatureInitializer(UMLPackage.eINSTANCE.getProperty_Aggregation(), UMLOCLFactory.getExpression("AggregationKind::composite", //$NON-NLS-1$
779
						UMLPackage.eINSTANCE.getPort())));
780
				add(createExpressionFeatureInitializer(
781
						UMLPackage.eINSTANCE.getNamedElement_Name(),
782
						UMLOCLFactory
783
								.getExpression(
784
										" let base : String = \'port\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
785
										UMLPackage.eINSTANCE.getPort())));
786
			}
787
		}; // Port_3025 ObjectInitializer		
788
789
		/**
790
		 * @generated
791
		 */
792
		public static final IObjectInitializer Property_3019 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getProperty()) {
793
794
			protected void init() {
795
				add(createExpressionFeatureInitializer(UMLPackage.eINSTANCE.getProperty_Aggregation(), UMLOCLFactory.getExpression("AggregationKind::composite", //$NON-NLS-1$
796
						UMLPackage.eINSTANCE.getProperty())));
797
				add(createExpressionFeatureInitializer(
798
						UMLPackage.eINSTANCE.getNamedElement_Name(),
799
						UMLOCLFactory
800
								.getExpression(
801
										" let base : String = \'property\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
802
										UMLPackage.eINSTANCE.getProperty())));
803
			}
804
		}; // Property_3019 ObjectInitializer		
805
806
		/**
807
		 * @generated
808
		 */
809
		public static final IObjectInitializer Operation_3020 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getOperation()) {
810
811
			protected void init() {
812
				add(createExpressionFeatureInitializer(
813
						UMLPackage.eINSTANCE.getNamedElement_Name(),
814
						UMLOCLFactory
815
								.getExpression(
816
										" let base : String = \'operation\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
817
										UMLPackage.eINSTANCE.getOperation())));
818
			}
819
		}; // Operation_3020 ObjectInitializer		
820
821
		/**
822
		 * @generated
823
		 */
824
		public static final IObjectInitializer Property_3014 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getProperty()) {
825
826
			protected void init() {
827
				add(createExpressionFeatureInitializer(UMLPackage.eINSTANCE.getProperty_Aggregation(), UMLOCLFactory.getExpression("AggregationKind::composite", //$NON-NLS-1$
828
						UMLPackage.eINSTANCE.getProperty())));
829
				add(createExpressionFeatureInitializer(
830
						UMLPackage.eINSTANCE.getNamedElement_Name(),
831
						UMLOCLFactory
832
								.getExpression(
833
										" let base : String = \'property\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
834
										UMLPackage.eINSTANCE.getProperty())));
835
			}
836
		}; // Property_3014 ObjectInitializer		
837
838
		/**
839
		 * @generated
840
		 */
841
		public static final IObjectInitializer Operation_3015 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getOperation()) {
842
843
			protected void init() {
844
				add(createExpressionFeatureInitializer(
845
						UMLPackage.eINSTANCE.getNamedElement_Name(),
846
						UMLOCLFactory
847
								.getExpression(
848
										" let base : String = \'operation\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
849
										UMLPackage.eINSTANCE.getOperation())));
850
			}
851
		}; // Operation_3015 ObjectInitializer		
852
853
		/**
854
		 * @generated
855
		 */
856
		public static final IObjectInitializer Property_3021 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getProperty()) {
857
858
			protected void init() {
859
				add(createExpressionFeatureInitializer(UMLPackage.eINSTANCE.getProperty_Aggregation(), UMLOCLFactory.getExpression("AggregationKind::composite", //$NON-NLS-1$
860
						UMLPackage.eINSTANCE.getProperty())));
861
				add(createExpressionFeatureInitializer(
862
						UMLPackage.eINSTANCE.getNamedElement_Name(),
863
						UMLOCLFactory
864
								.getExpression(
865
										" let base : String = \'property\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
866
										UMLPackage.eINSTANCE.getProperty())));
867
			}
868
		}; // Property_3021 ObjectInitializer		
869
870
		/**
871
		 * @generated
872
		 */
873
		public static final IObjectInitializer Operation_3022 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getOperation()) {
874
875
			protected void init() {
876
				add(createExpressionFeatureInitializer(
877
						UMLPackage.eINSTANCE.getNamedElement_Name(),
878
						UMLOCLFactory
879
								.getExpression(
880
										" let base : String = \'operation\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
881
										UMLPackage.eINSTANCE.getOperation())));
882
			}
883
		}; // Operation_3022 ObjectInitializer		
884
885
		/**
886
		 * @generated
887
		 */
888
		public static final IObjectInitializer EnumerationLiteral_3016 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getEnumerationLiteral()) {
889
890
			protected void init() {
891
				add(createExpressionFeatureInitializer(
892
						UMLPackage.eINSTANCE.getNamedElement_Name(),
893
						UMLOCLFactory
894
								.getExpression(
895
										" let base : String = \'enumerationLiteral\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
896
										UMLPackage.eINSTANCE.getEnumerationLiteral())));
897
			}
898
		}; // EnumerationLiteral_3016 ObjectInitializer		
899
900
		/**
901
		 * @generated
902
		 */
903
		public static final IObjectInitializer Property_3023 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getProperty()) {
904
905
			protected void init() {
906
				add(createExpressionFeatureInitializer(UMLPackage.eINSTANCE.getProperty_Aggregation(), UMLOCLFactory.getExpression("AggregationKind::composite", //$NON-NLS-1$
907
						UMLPackage.eINSTANCE.getProperty())));
908
				add(createExpressionFeatureInitializer(
909
						UMLPackage.eINSTANCE.getNamedElement_Name(),
910
						UMLOCLFactory
911
								.getExpression(
912
										" let base : String = \'property\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
913
										UMLPackage.eINSTANCE.getProperty())));
914
			}
915
		}; // Property_3023 ObjectInitializer		
916
917
		/**
918
		 * @generated
919
		 */
920
		public static final IObjectInitializer Operation_3024 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getOperation()) {
921
922
			protected void init() {
923
				add(createExpressionFeatureInitializer(
924
						UMLPackage.eINSTANCE.getNamedElement_Name(),
925
						UMLOCLFactory
926
								.getExpression(
927
										" let base : String = \'operation\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
928
										UMLPackage.eINSTANCE.getOperation())));
929
			}
930
		}; // Operation_3024 ObjectInitializer		
931
932
		/**
933
		 * @generated
934
		 */
935
		public static final IObjectInitializer LiteralString_3005 = new ObjectInitializer(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getLiteralString()) {
936
937
			protected void init() {
938
				add(createExpressionFeatureInitializer(
939
						UMLPackage.eINSTANCE.getNamedElement_Name(),
940
						UMLOCLFactory
941
								.getExpression(
942
										" let base : String = \'literalString\' in  let suffixes : Sequence(String) = Sequence {\'\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'10\'} in  let space : Namespace = self.namespace in  let allMissed : Sequence(String) = suffixes-> \tselect(s : String | not space.member->exists(e : NamedElement | e.name = base.concat(s)) ) in  let firstMissed : String = allMissed->first() in  let noMisses : Boolean = firstMissed.oclIsUndefined() in  let allNames : Set(String) =  \tif noMisses \t\tthen \t\tspace.member->collect(e : NamedElement | \t\t\tif e = self or e.name.oclIsUndefined() or e.name.substring(1, e.name.size().min(base.size())) <> base \t\t\tthen \'\' else e.name \t\t\tendif \t\t)->asSet()->excluding(\'\') \t\telse Set{\'not in use\'} \t\tendif in  let longestName : String = \t\tif noMisses \t\tthen allNames->select(n : String | not allNames->exists(nn : String | nn.size() > n.size()))->asSequence()->first()\t\telse \'not in use\' \t\tendif \tin  if noMisses then \t\tif longestName.oclIsUndefined() \t\tthen base \t\telse longestName.concat(\'1\') \t\tendif  else base.concat(firstMissed)  endif ", //$NON-NLS-1$
943
										UMLPackage.eINSTANCE.getLiteralString())));
944
			}
945
		}; // LiteralString_3005 ObjectInitializer
946
947
		/** 
948
		 * @generated
949
		 */
950
		private Initializers() {
951
		}
952
953
		/** 
954
		 * @generated
955
		 */
956
		public static interface IObjectInitializer {
957
958
			/** 
959
			 * @generated
960
			 */
961
			public void init(EObject instance);
962
		}
963
964
		/** 
965
		 * @generated
966
		 */
967
		public static abstract class ObjectInitializer implements IObjectInitializer {
968
969
			/** 
970
			 * @generated
971
			 */
972
			final EClass element;
973
974
			/** 
975
			 * @generated
976
			 */
977
			private List featureInitializers = new ArrayList();
978
979
			/** 
980
			 * @generated
981
			 */
982
			ObjectInitializer(EClass element) {
983
				this.element = element;
984
				init();
985
			}
986
987
			/**
988
			 * @generated
989
			 */
990
			protected abstract void init();
991
992
			/** 
993
			 * @generated
994
			 */
995
			protected final FeatureInitializer add(FeatureInitializer initializer) {
996
				featureInitializers.add(initializer);
997
				return initializer;
998
			}
999
1000
			/** 
1001
			 * @generated
1002
			 */
1003
			public void init(EObject instance) {
1004
				for (java.util.Iterator it = featureInitializers.iterator(); it.hasNext();) {
1005
					FeatureInitializer nextExpr = (FeatureInitializer) it.next();
1006
					try {
1007
						nextExpr.init(instance);
1008
					} catch (RuntimeException e) {
1009
						UMLDiagramEditorPlugin.getInstance().logError("Feature initialization failed", e); //$NON-NLS-1$						
1010
					}
1011
				}
1012
			}
1013
		} // end of ObjectInitializer
1014
1015
		/** 
1016
		 * @generated
1017
		 */
1018
		interface FeatureInitializer {
1019
1020
			/**
1021
			 * @generated
1022
			 */
1023
			void init(EObject contextInstance);
1024
		}
1025
1026
		/**
1027
		 * @generated
1028
		 */
1029
		static FeatureInitializer createNewElementFeatureInitializer(EStructuralFeature initFeature, ObjectInitializer[] newObjectInitializers) {
1030
			final EStructuralFeature feature = initFeature;
1031
			final ObjectInitializer[] initializers = newObjectInitializers;
1032
			return new FeatureInitializer() {
1033
1034
				public void init(EObject contextInstance) {
1035
					for (int i = 0; i < initializers.length; i++) {
1036
						EObject newInstance = initializers[i].element.getEPackage().getEFactoryInstance().create(initializers[i].element);
1037
						if (feature.isMany()) {
1038
							((Collection) contextInstance.eGet(feature)).add(newInstance);
1039
						} else {
1040
							contextInstance.eSet(feature, newInstance);
1041
						}
1042
						initializers[i].init(newInstance);
1043
					}
1044
				}
1045
			};
1046
		}
1047
1048
		/**
1049
		 * @generated
1050
		 */
1051
		static FeatureInitializer createExpressionFeatureInitializer(EStructuralFeature initFeature, UMLAbstractExpression valueExpression) {
1052
			final EStructuralFeature feature = initFeature;
1053
			final UMLAbstractExpression expression = valueExpression;
1054
			return new FeatureInitializer() {
1055
1056
				public void init(EObject contextInstance) {
1057
					expression.assignTo(feature, contextInstance);
1058
				}
1059
			};
1060
		}
1061
	} // end of Initializers
1062
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationName7ViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class AssociationName7ViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(15));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/InterfaceViewFactory.java (+52 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceNameEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
15
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
16
17
/**
18
 * @generated
19
 */
20
public class InterfaceViewFactory extends AbstractShapeViewFactory {
21
22
	/**
23
	 * @generated 
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
28
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
29
		styles.add(NotationFactory.eINSTANCE.createFillStyle());
30
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
31
		return styles;
32
	}
33
34
	/**
35
	 * @generated
36
	 */
37
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
38
		if (semanticHint == null) {
39
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceEditPart.VISUAL_ID);
40
			view.setType(semanticHint);
41
		}
42
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
43
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
44
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
45
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
46
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
47
			view.getEAnnotations().add(shortcutAnnotation);
48
		}
49
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(InterfaceNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
50
	}
51
52
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/DataTypeAttributesViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class DataTypeAttributesViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeAttributesEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/SlotViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class SlotViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.SlotEditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLVisualIDRegistry.java (+1627 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import org.eclipse.core.runtime.Platform;
4
import org.eclipse.emf.ecore.EAnnotation;
5
import org.eclipse.emf.ecore.EClass;
6
import org.eclipse.emf.ecore.EObject;
7
import org.eclipse.gmf.runtime.notation.Diagram;
8
import org.eclipse.gmf.runtime.notation.View;
9
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClass2EditPart;
10
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassAttributesEditPart;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassClassesEditPart;
12
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassEditPart;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassNameEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassOperationsEditPart;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationEditPart;
16
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName2EditPart;
17
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName3EditPart;
18
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName4EditPart;
19
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName5EditPart;
20
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName6EditPart;
21
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName7EditPart;
22
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationNameEditPart;
23
import org.eclipse.uml2.diagram.clazz.edit.parts.Class2EditPart;
24
import org.eclipse.uml2.diagram.clazz.edit.parts.Class3EditPart;
25
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassAttributesEditPart;
26
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassClassesEditPart;
27
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassEditPart;
28
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassNameEditPart;
29
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassOperationsEditPart;
30
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintCompartmentEditPart;
31
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintEditPart;
32
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintNameEditPart;
33
import org.eclipse.uml2.diagram.clazz.edit.parts.DataType2EditPart;
34
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeAttributesEditPart;
35
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeEditPart;
36
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeNameEditPart;
37
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeOperationsEditPart;
38
import org.eclipse.uml2.diagram.clazz.edit.parts.Dependency2EditPart;
39
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyEditPart;
40
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyName2EditPart;
41
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyNameEditPart;
42
import org.eclipse.uml2.diagram.clazz.edit.parts.Enumeration2EditPart;
43
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationAttributesEditPart;
44
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationEditPart;
45
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationLiteralEditPart;
46
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationLiteralsEditPart;
47
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationNameEditPart;
48
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationOperationsEditPart;
49
import org.eclipse.uml2.diagram.clazz.edit.parts.GeneralizationEditPart;
50
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecification2EditPart;
51
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationEditPart;
52
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationNameEditPart;
53
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationSlotsEditPart;
54
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceEditPart;
55
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceNameEditPart;
56
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceRealizationEditPart;
57
import org.eclipse.uml2.diagram.clazz.edit.parts.LiteralStringEditPart;
58
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation2EditPart;
59
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation3EditPart;
60
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation4EditPart;
61
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation5EditPart;
62
import org.eclipse.uml2.diagram.clazz.edit.parts.OperationEditPart;
63
import org.eclipse.uml2.diagram.clazz.edit.parts.Package2EditPart;
64
import org.eclipse.uml2.diagram.clazz.edit.parts.Package3EditPart;
65
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageClassifiersEditPart;
66
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
67
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageNameEditPart;
68
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageOtherEditPart;
69
import org.eclipse.uml2.diagram.clazz.edit.parts.PackagePackagesEditPart;
70
import org.eclipse.uml2.diagram.clazz.edit.parts.PortEditPart;
71
import org.eclipse.uml2.diagram.clazz.edit.parts.PortNameEditPart;
72
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveType2EditPart;
73
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeAttributesEditPart;
74
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeEditPart;
75
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeNameEditPart;
76
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeOperationsEditPart;
77
import org.eclipse.uml2.diagram.clazz.edit.parts.Property2EditPart;
78
import org.eclipse.uml2.diagram.clazz.edit.parts.Property3EditPart;
79
import org.eclipse.uml2.diagram.clazz.edit.parts.Property4EditPart;
80
import org.eclipse.uml2.diagram.clazz.edit.parts.Property5EditPart;
81
import org.eclipse.uml2.diagram.clazz.edit.parts.Property6EditPart;
82
import org.eclipse.uml2.diagram.clazz.edit.parts.PropertyEditPart;
83
import org.eclipse.uml2.diagram.clazz.edit.parts.PropertyNameEditPart;
84
import org.eclipse.uml2.diagram.clazz.edit.parts.SlotEditPart;
85
import org.eclipse.uml2.diagram.clazz.edit.parts.UsageEditPart;
86
import org.eclipse.uml2.diagram.clazz.expressions.UMLAbstractExpression;
87
import org.eclipse.uml2.diagram.clazz.expressions.UMLOCLFactory;
88
import org.eclipse.uml2.uml.Association;
89
import org.eclipse.uml2.uml.AssociationClass;
90
import org.eclipse.uml2.uml.Constraint;
91
import org.eclipse.uml2.uml.DataType;
92
import org.eclipse.uml2.uml.Dependency;
93
import org.eclipse.uml2.uml.Enumeration;
94
import org.eclipse.uml2.uml.EnumerationLiteral;
95
import org.eclipse.uml2.uml.Generalization;
96
import org.eclipse.uml2.uml.InstanceSpecification;
97
import org.eclipse.uml2.uml.Interface;
98
import org.eclipse.uml2.uml.InterfaceRealization;
99
import org.eclipse.uml2.uml.LiteralString;
100
import org.eclipse.uml2.uml.Operation;
101
import org.eclipse.uml2.uml.Port;
102
import org.eclipse.uml2.uml.PrimitiveType;
103
import org.eclipse.uml2.uml.Property;
104
import org.eclipse.uml2.uml.Slot;
105
import org.eclipse.uml2.uml.UMLPackage;
106
import org.eclipse.uml2.uml.Usage;
107
108
/**
109
 * This registry is used to determine which type of visual object should be
110
 * created for the corresponding Diagram, Node, ChildNode or Link represented 
111
 * by a domain model object.
112
 *
113
 * @generated
114
 */
115
public class UMLVisualIDRegistry {
116
117
	/**
118
	 * @generated
119
	 */
120
	private static final String DEBUG_KEY = UMLDiagramEditorPlugin.getInstance().getBundle().getSymbolicName() + "/debug/visualID"; //$NON-NLS-1$
121
122
	/**
123
	 * @generated
124
	 */
125
	public static int getVisualID(View view) {
126
		if (view instanceof Diagram) {
127
			if (PackageEditPart.MODEL_ID.equals(view.getType())) {
128
				return PackageEditPart.VISUAL_ID;
129
			} else {
130
				return -1;
131
			}
132
		}
133
		return getVisualID(view.getType());
134
	}
135
136
	/**
137
	 * @generated
138
	 */
139
	public static String getModelID(View view) {
140
		View diagram = view.getDiagram();
141
		while (view != diagram) {
142
			EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
143
			if (annotation != null) {
144
				return (String) annotation.getDetails().get("modelID"); //$NON-NLS-1$
145
			}
146
			view = (View) view.eContainer();
147
		}
148
		return diagram != null ? diagram.getType() : null;
149
	}
150
151
	/**
152
	 * @generated
153
	 */
154
	public static int getVisualID(String type) {
155
		try {
156
			return Integer.parseInt(type);
157
		} catch (NumberFormatException e) {
158
			if (Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption(DEBUG_KEY))) {
159
				UMLDiagramEditorPlugin.getInstance().logError("Unable to parse view type as a visualID number: " + type);
160
			}
161
		}
162
		return -1;
163
	}
164
165
	/**
166
	 * @generated
167
	 */
168
	public static String getType(int visualID) {
169
		return String.valueOf(visualID);
170
	}
171
172
	/**
173
	 * @generated
174
	 */
175
	public static int getDiagramVisualID(EObject domainElement) {
176
		if (domainElement == null) {
177
			return -1;
178
		}
179
		EClass domainElementMetaclass = domainElement.eClass();
180
		return getDiagramVisualID(domainElement, domainElementMetaclass);
181
	}
182
183
	/**
184
	 * @generated
185
	 */
186
	private static int getDiagramVisualID(EObject domainElement, EClass domainElementMetaclass) {
187
		if (UMLPackage.eINSTANCE.getPackage().isSuperTypeOf(domainElementMetaclass) && isDiagramPackage_1000((org.eclipse.uml2.uml.Package) domainElement)) {
188
			return PackageEditPart.VISUAL_ID;
189
		}
190
		return getUnrecognizedDiagramID(domainElement);
191
	}
192
193
	/**
194
	 * @generated
195
	 */
196
	public static int getNodeVisualID(View containerView, EObject domainElement) {
197
		if (domainElement == null) {
198
			return -1;
199
		}
200
		EClass domainElementMetaclass = domainElement.eClass();
201
		return getNodeVisualID(containerView, domainElement, domainElementMetaclass, null);
202
	}
203
204
	/**
205
	 * @generated
206
	 */
207
	public static int getNodeVisualID(View containerView, EObject domainElement, EClass domainElementMetaclass, String semanticHint) {
208
		String containerModelID = getModelID(containerView);
209
		if (!PackageEditPart.MODEL_ID.equals(containerModelID)) {
210
			return -1;
211
		}
212
		int containerVisualID;
213
		if (PackageEditPart.MODEL_ID.equals(containerModelID)) {
214
			containerVisualID = getVisualID(containerView);
215
		} else {
216
			if (containerView instanceof Diagram) {
217
				containerVisualID = PackageEditPart.VISUAL_ID;
218
			} else {
219
				return -1;
220
			}
221
		}
222
		int nodeVisualID = semanticHint != null ? getVisualID(semanticHint) : -1;
223
		switch (containerVisualID) {
224
		case Package2EditPart.VISUAL_ID:
225
			if (PackageNameEditPart.VISUAL_ID == nodeVisualID) {
226
				return PackageNameEditPart.VISUAL_ID;
227
			}
228
			if (PackagePackagesEditPart.VISUAL_ID == nodeVisualID) {
229
				return PackagePackagesEditPart.VISUAL_ID;
230
			}
231
			if (PackageClassifiersEditPart.VISUAL_ID == nodeVisualID) {
232
				return PackageClassifiersEditPart.VISUAL_ID;
233
			}
234
			if (PackageOtherEditPart.VISUAL_ID == nodeVisualID) {
235
				return PackageOtherEditPart.VISUAL_ID;
236
			}
237
			return getUnrecognizedPackage_2002ChildNodeID(domainElement, semanticHint);
238
		case Class2EditPart.VISUAL_ID:
239
			if (ClassNameEditPart.VISUAL_ID == nodeVisualID) {
240
				return ClassNameEditPart.VISUAL_ID;
241
			}
242
			if (ClassAttributesEditPart.VISUAL_ID == nodeVisualID) {
243
				return ClassAttributesEditPart.VISUAL_ID;
244
			}
245
			if (ClassOperationsEditPart.VISUAL_ID == nodeVisualID) {
246
				return ClassOperationsEditPart.VISUAL_ID;
247
			}
248
			if (ClassClassesEditPart.VISUAL_ID == nodeVisualID) {
249
				return ClassClassesEditPart.VISUAL_ID;
250
			}
251
			if ((semanticHint == null || PortEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getPort().isSuperTypeOf(domainElementMetaclass)
252
					&& (domainElement == null || isNodePort_3025((Port) domainElement))) {
253
				return PortEditPart.VISUAL_ID;
254
			}
255
			return getUnrecognizedClass_2001ChildNodeID(domainElement, semanticHint);
256
		case AssociationClass2EditPart.VISUAL_ID:
257
			if (AssociationClassNameEditPart.VISUAL_ID == nodeVisualID) {
258
				return AssociationClassNameEditPart.VISUAL_ID;
259
			}
260
			if (AssociationClassAttributesEditPart.VISUAL_ID == nodeVisualID) {
261
				return AssociationClassAttributesEditPart.VISUAL_ID;
262
			}
263
			if (AssociationClassOperationsEditPart.VISUAL_ID == nodeVisualID) {
264
				return AssociationClassOperationsEditPart.VISUAL_ID;
265
			}
266
			if (AssociationClassClassesEditPart.VISUAL_ID == nodeVisualID) {
267
				return AssociationClassClassesEditPart.VISUAL_ID;
268
			}
269
			return getUnrecognizedAssociationClass_2007ChildNodeID(domainElement, semanticHint);
270
		case DataType2EditPart.VISUAL_ID:
271
			if (DataTypeNameEditPart.VISUAL_ID == nodeVisualID) {
272
				return DataTypeNameEditPart.VISUAL_ID;
273
			}
274
			if (DataTypeAttributesEditPart.VISUAL_ID == nodeVisualID) {
275
				return DataTypeAttributesEditPart.VISUAL_ID;
276
			}
277
			if (DataTypeOperationsEditPart.VISUAL_ID == nodeVisualID) {
278
				return DataTypeOperationsEditPart.VISUAL_ID;
279
			}
280
			return getUnrecognizedDataType_2004ChildNodeID(domainElement, semanticHint);
281
		case PrimitiveType2EditPart.VISUAL_ID:
282
			if (PrimitiveTypeNameEditPart.VISUAL_ID == nodeVisualID) {
283
				return PrimitiveTypeNameEditPart.VISUAL_ID;
284
			}
285
			if (PrimitiveTypeAttributesEditPart.VISUAL_ID == nodeVisualID) {
286
				return PrimitiveTypeAttributesEditPart.VISUAL_ID;
287
			}
288
			if (PrimitiveTypeOperationsEditPart.VISUAL_ID == nodeVisualID) {
289
				return PrimitiveTypeOperationsEditPart.VISUAL_ID;
290
			}
291
			return getUnrecognizedPrimitiveType_2005ChildNodeID(domainElement, semanticHint);
292
		case Enumeration2EditPart.VISUAL_ID:
293
			if (EnumerationNameEditPart.VISUAL_ID == nodeVisualID) {
294
				return EnumerationNameEditPart.VISUAL_ID;
295
			}
296
			if (EnumerationLiteralsEditPart.VISUAL_ID == nodeVisualID) {
297
				return EnumerationLiteralsEditPart.VISUAL_ID;
298
			}
299
			if (EnumerationAttributesEditPart.VISUAL_ID == nodeVisualID) {
300
				return EnumerationAttributesEditPart.VISUAL_ID;
301
			}
302
			if (EnumerationOperationsEditPart.VISUAL_ID == nodeVisualID) {
303
				return EnumerationOperationsEditPart.VISUAL_ID;
304
			}
305
			return getUnrecognizedEnumeration_2003ChildNodeID(domainElement, semanticHint);
306
		case InterfaceEditPart.VISUAL_ID:
307
			if (InterfaceNameEditPart.VISUAL_ID == nodeVisualID) {
308
				return InterfaceNameEditPart.VISUAL_ID;
309
			}
310
			return getUnrecognizedInterface_2010ChildNodeID(domainElement, semanticHint);
311
		case ConstraintEditPart.VISUAL_ID:
312
			if (ConstraintNameEditPart.VISUAL_ID == nodeVisualID) {
313
				return ConstraintNameEditPart.VISUAL_ID;
314
			}
315
			if (ConstraintCompartmentEditPart.VISUAL_ID == nodeVisualID) {
316
				return ConstraintCompartmentEditPart.VISUAL_ID;
317
			}
318
			return getUnrecognizedConstraint_2006ChildNodeID(domainElement, semanticHint);
319
		case InstanceSpecification2EditPart.VISUAL_ID:
320
			if (InstanceSpecificationNameEditPart.VISUAL_ID == nodeVisualID) {
321
				return InstanceSpecificationNameEditPart.VISUAL_ID;
322
			}
323
			if (InstanceSpecificationSlotsEditPart.VISUAL_ID == nodeVisualID) {
324
				return InstanceSpecificationSlotsEditPart.VISUAL_ID;
325
			}
326
			return getUnrecognizedInstanceSpecification_2008ChildNodeID(domainElement, semanticHint);
327
		case DependencyEditPart.VISUAL_ID:
328
			if (DependencyNameEditPart.VISUAL_ID == nodeVisualID) {
329
				return DependencyNameEditPart.VISUAL_ID;
330
			}
331
			return getUnrecognizedDependency_2009ChildNodeID(domainElement, semanticHint);
332
		case Package3EditPart.VISUAL_ID:
333
			return getUnrecognizedPackage_3006ChildNodeID(domainElement, semanticHint);
334
		case ClassEditPart.VISUAL_ID:
335
			return getUnrecognizedClass_3007ChildNodeID(domainElement, semanticHint);
336
		case DataTypeEditPart.VISUAL_ID:
337
			return getUnrecognizedDataType_3008ChildNodeID(domainElement, semanticHint);
338
		case PrimitiveTypeEditPart.VISUAL_ID:
339
			return getUnrecognizedPrimitiveType_3009ChildNodeID(domainElement, semanticHint);
340
		case EnumerationEditPart.VISUAL_ID:
341
			return getUnrecognizedEnumeration_3011ChildNodeID(domainElement, semanticHint);
342
		case AssociationClassEditPart.VISUAL_ID:
343
			return getUnrecognizedAssociationClass_3012ChildNodeID(domainElement, semanticHint);
344
		case InstanceSpecificationEditPart.VISUAL_ID:
345
			return getUnrecognizedInstanceSpecification_3013ChildNodeID(domainElement, semanticHint);
346
		case PropertyEditPart.VISUAL_ID:
347
			return getUnrecognizedProperty_3001ChildNodeID(domainElement, semanticHint);
348
		case OperationEditPart.VISUAL_ID:
349
			return getUnrecognizedOperation_3002ChildNodeID(domainElement, semanticHint);
350
		case Class3EditPart.VISUAL_ID:
351
			return getUnrecognizedClass_3003ChildNodeID(domainElement, semanticHint);
352
		case PortEditPart.VISUAL_ID:
353
			if (PortNameEditPart.VISUAL_ID == nodeVisualID) {
354
				return PortNameEditPart.VISUAL_ID;
355
			}
356
			return getUnrecognizedPort_3025ChildNodeID(domainElement, semanticHint);
357
		case Property2EditPart.VISUAL_ID:
358
			return getUnrecognizedProperty_3019ChildNodeID(domainElement, semanticHint);
359
		case Operation2EditPart.VISUAL_ID:
360
			return getUnrecognizedOperation_3020ChildNodeID(domainElement, semanticHint);
361
		case Property3EditPart.VISUAL_ID:
362
			return getUnrecognizedProperty_3014ChildNodeID(domainElement, semanticHint);
363
		case Operation3EditPart.VISUAL_ID:
364
			return getUnrecognizedOperation_3015ChildNodeID(domainElement, semanticHint);
365
		case Property4EditPart.VISUAL_ID:
366
			return getUnrecognizedProperty_3021ChildNodeID(domainElement, semanticHint);
367
		case Operation4EditPart.VISUAL_ID:
368
			return getUnrecognizedOperation_3022ChildNodeID(domainElement, semanticHint);
369
		case EnumerationLiteralEditPart.VISUAL_ID:
370
			return getUnrecognizedEnumerationLiteral_3016ChildNodeID(domainElement, semanticHint);
371
		case Property5EditPart.VISUAL_ID:
372
			return getUnrecognizedProperty_3023ChildNodeID(domainElement, semanticHint);
373
		case Operation5EditPart.VISUAL_ID:
374
			return getUnrecognizedOperation_3024ChildNodeID(domainElement, semanticHint);
375
		case LiteralStringEditPart.VISUAL_ID:
376
			return getUnrecognizedLiteralString_3005ChildNodeID(domainElement, semanticHint);
377
		case SlotEditPart.VISUAL_ID:
378
			return getUnrecognizedSlot_3017ChildNodeID(domainElement, semanticHint);
379
		case PackagePackagesEditPart.VISUAL_ID:
380
			if ((semanticHint == null || Package3EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getPackage().isSuperTypeOf(domainElementMetaclass)
381
					&& (domainElement == null || isNodePackage_3006((org.eclipse.uml2.uml.Package) domainElement))) {
382
				return Package3EditPart.VISUAL_ID;
383
			}
384
			return getUnrecognizedPackagePackages_7010ChildNodeID(domainElement, semanticHint);
385
		case PackageClassifiersEditPart.VISUAL_ID:
386
			if ((semanticHint == null || ClassEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElementMetaclass)
387
					&& (domainElement == null || isNodeClass_3007((org.eclipse.uml2.uml.Class) domainElement))) {
388
				return ClassEditPart.VISUAL_ID;
389
			}
390
			if ((semanticHint == null || DataTypeEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElementMetaclass)
391
					&& (domainElement == null || isNodeDataType_3008((DataType) domainElement))) {
392
				return DataTypeEditPart.VISUAL_ID;
393
			}
394
			if ((semanticHint == null || PrimitiveTypeEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElementMetaclass)
395
					&& (domainElement == null || isNodePrimitiveType_3009((PrimitiveType) domainElement))) {
396
				return PrimitiveTypeEditPart.VISUAL_ID;
397
			}
398
			if ((semanticHint == null || EnumerationEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElementMetaclass)
399
					&& (domainElement == null || isNodeEnumeration_3011((Enumeration) domainElement))) {
400
				return EnumerationEditPart.VISUAL_ID;
401
			}
402
			if ((semanticHint == null || AssociationClassEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getAssociationClass().isSuperTypeOf(domainElementMetaclass)
403
					&& (domainElement == null || isNodeAssociationClass_3012((AssociationClass) domainElement))) {
404
				return AssociationClassEditPart.VISUAL_ID;
405
			}
406
			return getUnrecognizedPackageClassifiers_7011ChildNodeID(domainElement, semanticHint);
407
		case PackageOtherEditPart.VISUAL_ID:
408
			if ((semanticHint == null || InstanceSpecificationEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getInstanceSpecification().isSuperTypeOf(domainElementMetaclass)
409
					&& (domainElement == null || isNodeInstanceSpecification_3013((InstanceSpecification) domainElement))) {
410
				return InstanceSpecificationEditPart.VISUAL_ID;
411
			}
412
			return getUnrecognizedPackageOther_7012ChildNodeID(domainElement, semanticHint);
413
		case ClassAttributesEditPart.VISUAL_ID:
414
			if ((semanticHint == null || PropertyEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElementMetaclass)
415
					&& (domainElement == null || isNodeProperty_3001((Property) domainElement))) {
416
				return PropertyEditPart.VISUAL_ID;
417
			}
418
			return getUnrecognizedClassAttributes_7001ChildNodeID(domainElement, semanticHint);
419
		case ClassOperationsEditPart.VISUAL_ID:
420
			if ((semanticHint == null || OperationEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getOperation().isSuperTypeOf(domainElementMetaclass)
421
					&& (domainElement == null || isNodeOperation_3002((Operation) domainElement))) {
422
				return OperationEditPart.VISUAL_ID;
423
			}
424
			return getUnrecognizedClassOperations_7002ChildNodeID(domainElement, semanticHint);
425
		case ClassClassesEditPart.VISUAL_ID:
426
			if ((semanticHint == null || Class3EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElementMetaclass)
427
					&& (domainElement == null || isNodeClass_3003((org.eclipse.uml2.uml.Class) domainElement))) {
428
				return Class3EditPart.VISUAL_ID;
429
			}
430
			return getUnrecognizedClassClasses_7003ChildNodeID(domainElement, semanticHint);
431
		case AssociationClassAttributesEditPart.VISUAL_ID:
432
			if ((semanticHint == null || Property2EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElementMetaclass)
433
					&& (domainElement == null || isNodeProperty_3019((Property) domainElement))) {
434
				return Property2EditPart.VISUAL_ID;
435
			}
436
			return getUnrecognizedAssociationClassAttributes_7024ChildNodeID(domainElement, semanticHint);
437
		case AssociationClassOperationsEditPart.VISUAL_ID:
438
			if ((semanticHint == null || Operation2EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getOperation().isSuperTypeOf(domainElementMetaclass)
439
					&& (domainElement == null || isNodeOperation_3020((Operation) domainElement))) {
440
				return Operation2EditPart.VISUAL_ID;
441
			}
442
			return getUnrecognizedAssociationClassOperations_7025ChildNodeID(domainElement, semanticHint);
443
		case AssociationClassClassesEditPart.VISUAL_ID:
444
			if ((semanticHint == null || Class3EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElementMetaclass)
445
					&& (domainElement == null || isNodeClass_3003((org.eclipse.uml2.uml.Class) domainElement))) {
446
				return Class3EditPart.VISUAL_ID;
447
			}
448
			return getUnrecognizedAssociationClassClasses_7026ChildNodeID(domainElement, semanticHint);
449
		case DataTypeAttributesEditPart.VISUAL_ID:
450
			if ((semanticHint == null || Property3EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElementMetaclass)
451
					&& (domainElement == null || isNodeProperty_3014((Property) domainElement))) {
452
				return Property3EditPart.VISUAL_ID;
453
			}
454
			return getUnrecognizedDataTypeAttributes_7017ChildNodeID(domainElement, semanticHint);
455
		case DataTypeOperationsEditPart.VISUAL_ID:
456
			if ((semanticHint == null || Operation3EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getOperation().isSuperTypeOf(domainElementMetaclass)
457
					&& (domainElement == null || isNodeOperation_3015((Operation) domainElement))) {
458
				return Operation3EditPart.VISUAL_ID;
459
			}
460
			return getUnrecognizedDataTypeOperations_7018ChildNodeID(domainElement, semanticHint);
461
		case PrimitiveTypeAttributesEditPart.VISUAL_ID:
462
			if ((semanticHint == null || Property4EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElementMetaclass)
463
					&& (domainElement == null || isNodeProperty_3021((Property) domainElement))) {
464
				return Property4EditPart.VISUAL_ID;
465
			}
466
			return getUnrecognizedPrimitiveTypeAttributes_7020ChildNodeID(domainElement, semanticHint);
467
		case PrimitiveTypeOperationsEditPart.VISUAL_ID:
468
			if ((semanticHint == null || Operation4EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getOperation().isSuperTypeOf(domainElementMetaclass)
469
					&& (domainElement == null || isNodeOperation_3022((Operation) domainElement))) {
470
				return Operation4EditPart.VISUAL_ID;
471
			}
472
			return getUnrecognizedPrimitiveTypeOperations_7021ChildNodeID(domainElement, semanticHint);
473
		case EnumerationLiteralsEditPart.VISUAL_ID:
474
			if ((semanticHint == null || EnumerationLiteralEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getEnumerationLiteral().isSuperTypeOf(domainElementMetaclass)
475
					&& (domainElement == null || isNodeEnumerationLiteral_3016((EnumerationLiteral) domainElement))) {
476
				return EnumerationLiteralEditPart.VISUAL_ID;
477
			}
478
			return getUnrecognizedEnumerationLiterals_7013ChildNodeID(domainElement, semanticHint);
479
		case EnumerationAttributesEditPart.VISUAL_ID:
480
			if ((semanticHint == null || Property5EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElementMetaclass)
481
					&& (domainElement == null || isNodeProperty_3023((Property) domainElement))) {
482
				return Property5EditPart.VISUAL_ID;
483
			}
484
			return getUnrecognizedEnumerationAttributes_7014ChildNodeID(domainElement, semanticHint);
485
		case EnumerationOperationsEditPart.VISUAL_ID:
486
			if ((semanticHint == null || Operation5EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getOperation().isSuperTypeOf(domainElementMetaclass)
487
					&& (domainElement == null || isNodeOperation_3024((Operation) domainElement))) {
488
				return Operation5EditPart.VISUAL_ID;
489
			}
490
			return getUnrecognizedEnumerationOperations_7015ChildNodeID(domainElement, semanticHint);
491
		case ConstraintCompartmentEditPart.VISUAL_ID:
492
			if ((semanticHint == null || LiteralStringEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getLiteralString().isSuperTypeOf(domainElementMetaclass)
493
					&& (domainElement == null || isNodeLiteralString_3005((LiteralString) domainElement))) {
494
				return LiteralStringEditPart.VISUAL_ID;
495
			}
496
			return getUnrecognizedConstraintCompartment_7023ChildNodeID(domainElement, semanticHint);
497
		case InstanceSpecificationSlotsEditPart.VISUAL_ID:
498
			if ((semanticHint == null || SlotEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getSlot().isSuperTypeOf(domainElementMetaclass)
499
					&& (domainElement == null || isNodeSlot_3017((Slot) domainElement))) {
500
				return SlotEditPart.VISUAL_ID;
501
			}
502
			return getUnrecognizedInstanceSpecificationSlots_7028ChildNodeID(domainElement, semanticHint);
503
		case PackageEditPart.VISUAL_ID:
504
			if ((semanticHint == null || Package2EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getPackage().isSuperTypeOf(domainElementMetaclass)
505
					&& (domainElement == null || isNodePackage_2002((org.eclipse.uml2.uml.Package) domainElement))) {
506
				return Package2EditPart.VISUAL_ID;
507
			}
508
			if ((semanticHint == null || Class2EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getClass_().isSuperTypeOf(domainElementMetaclass)
509
					&& (domainElement == null || isNodeClass_2001((org.eclipse.uml2.uml.Class) domainElement))) {
510
				return Class2EditPart.VISUAL_ID;
511
			}
512
			if ((semanticHint == null || AssociationClass2EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getAssociationClass().isSuperTypeOf(domainElementMetaclass)
513
					&& (domainElement == null || isNodeAssociationClass_2007((AssociationClass) domainElement))) {
514
				return AssociationClass2EditPart.VISUAL_ID;
515
			}
516
			if ((semanticHint == null || DataType2EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getDataType().isSuperTypeOf(domainElementMetaclass)
517
					&& (domainElement == null || isNodeDataType_2004((DataType) domainElement))) {
518
				return DataType2EditPart.VISUAL_ID;
519
			}
520
			if ((semanticHint == null || PrimitiveType2EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getPrimitiveType().isSuperTypeOf(domainElementMetaclass)
521
					&& (domainElement == null || isNodePrimitiveType_2005((PrimitiveType) domainElement))) {
522
				return PrimitiveType2EditPart.VISUAL_ID;
523
			}
524
			if ((semanticHint == null || Enumeration2EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getEnumeration().isSuperTypeOf(domainElementMetaclass)
525
					&& (domainElement == null || isNodeEnumeration_2003((Enumeration) domainElement))) {
526
				return Enumeration2EditPart.VISUAL_ID;
527
			}
528
			if ((semanticHint == null || InterfaceEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getInterface().isSuperTypeOf(domainElementMetaclass)
529
					&& (domainElement == null || isNodeInterface_2010((Interface) domainElement))) {
530
				return InterfaceEditPart.VISUAL_ID;
531
			}
532
			if ((semanticHint == null || ConstraintEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElementMetaclass)
533
					&& (domainElement == null || isNodeConstraint_2006((Constraint) domainElement))) {
534
				return ConstraintEditPart.VISUAL_ID;
535
			}
536
			if ((semanticHint == null || InstanceSpecification2EditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getInstanceSpecification().isSuperTypeOf(domainElementMetaclass)
537
					&& (domainElement == null || isNodeInstanceSpecification_2008((InstanceSpecification) domainElement))) {
538
				return InstanceSpecification2EditPart.VISUAL_ID;
539
			}
540
			if ((semanticHint == null || DependencyEditPart.VISUAL_ID == nodeVisualID) && UMLPackage.eINSTANCE.getDependency().isSuperTypeOf(domainElementMetaclass)
541
					&& (domainElement == null || isNodeDependency_2009((Dependency) domainElement))) {
542
				return DependencyEditPart.VISUAL_ID;
543
			}
544
			return getUnrecognizedPackage_1000ChildNodeID(domainElement, semanticHint);
545
		case Dependency2EditPart.VISUAL_ID:
546
			if (DependencyName2EditPart.VISUAL_ID == nodeVisualID) {
547
				return DependencyName2EditPart.VISUAL_ID;
548
			}
549
			return getUnrecognizedDependency_4002LinkLabelID(semanticHint);
550
		case Property6EditPart.VISUAL_ID:
551
			if (PropertyNameEditPart.VISUAL_ID == nodeVisualID) {
552
				return PropertyNameEditPart.VISUAL_ID;
553
			}
554
			return getUnrecognizedProperty_4003LinkLabelID(semanticHint);
555
		case AssociationEditPart.VISUAL_ID:
556
			if (AssociationNameEditPart.VISUAL_ID == nodeVisualID) {
557
				return AssociationNameEditPart.VISUAL_ID;
558
			}
559
			if (AssociationName2EditPart.VISUAL_ID == nodeVisualID) {
560
				return AssociationName2EditPart.VISUAL_ID;
561
			}
562
			if (AssociationName3EditPart.VISUAL_ID == nodeVisualID) {
563
				return AssociationName3EditPart.VISUAL_ID;
564
			}
565
			if (AssociationName4EditPart.VISUAL_ID == nodeVisualID) {
566
				return AssociationName4EditPart.VISUAL_ID;
567
			}
568
			if (AssociationName5EditPart.VISUAL_ID == nodeVisualID) {
569
				return AssociationName5EditPart.VISUAL_ID;
570
			}
571
			if (AssociationName6EditPart.VISUAL_ID == nodeVisualID) {
572
				return AssociationName6EditPart.VISUAL_ID;
573
			}
574
			if (AssociationName7EditPart.VISUAL_ID == nodeVisualID) {
575
				return AssociationName7EditPart.VISUAL_ID;
576
			}
577
			return getUnrecognizedAssociation_4005LinkLabelID(semanticHint);
578
		}
579
		return -1;
580
	}
581
582
	/**
583
	 * @generated
584
	 */
585
	public static int getLinkWithClassVisualID(EObject domainElement) {
586
		if (domainElement == null) {
587
			return -1;
588
		}
589
		EClass domainElementMetaclass = domainElement.eClass();
590
		return getLinkWithClassVisualID(domainElement, domainElementMetaclass);
591
	}
592
593
	/**
594
	 * @generated
595
	 */
596
	public static int getLinkWithClassVisualID(EObject domainElement, EClass domainElementMetaclass) {
597
		if (UMLPackage.eINSTANCE.getGeneralization().isSuperTypeOf(domainElementMetaclass) && (domainElement == null || isLinkWithClassGeneralization_4001((Generalization) domainElement))) {
598
			return GeneralizationEditPart.VISUAL_ID;
599
		} else if (UMLPackage.eINSTANCE.getDependency().isSuperTypeOf(domainElementMetaclass) && (domainElement == null || isLinkWithClassDependency_4002((Dependency) domainElement))) {
600
			return Dependency2EditPart.VISUAL_ID;
601
		} else if (UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElementMetaclass) && (domainElement == null || isLinkWithClassProperty_4003((Property) domainElement))) {
602
			return Property6EditPart.VISUAL_ID;
603
		} else if (UMLPackage.eINSTANCE.getAssociation().isSuperTypeOf(domainElementMetaclass) && (domainElement == null || isLinkWithClassAssociation_4005((Association) domainElement))) {
604
			return AssociationEditPart.VISUAL_ID;
605
		} else if (UMLPackage.eINSTANCE.getInterfaceRealization().isSuperTypeOf(domainElementMetaclass)
606
				&& (domainElement == null || isLinkWithClassInterfaceRealization_4008((InterfaceRealization) domainElement))) {
607
			return InterfaceRealizationEditPart.VISUAL_ID;
608
		} else if (UMLPackage.eINSTANCE.getUsage().isSuperTypeOf(domainElementMetaclass) && (domainElement == null || isLinkWithClassUsage_4009((Usage) domainElement))) {
609
			return UsageEditPart.VISUAL_ID;
610
		} else {
611
			return getUnrecognizedLinkWithClassID(domainElement);
612
		}
613
	}
614
615
	/**
616
	 * User can change implementation of this method to check some additional 
617
	 * conditions here.
618
	 *
619
	 * @generated
620
	 */
621
	private static boolean isDiagramPackage_1000(org.eclipse.uml2.uml.Package element) {
622
		return true;
623
	}
624
625
	/**
626
	 * User can change implementation of this method to handle some specific
627
	 * situations not covered by default logic.
628
	 *
629
	 * @generated
630
	 */
631
	private static int getUnrecognizedDiagramID(EObject domainElement) {
632
		return -1;
633
	}
634
635
	/**
636
	 * User can change implementation of this method to check some additional 
637
	 * conditions here.
638
	 *
639
	 * @generated
640
	 */
641
	private static boolean isNodePackage_2002(org.eclipse.uml2.uml.Package element) {
642
		return true;
643
	}
644
645
	/**
646
	 * User can change implementation of this method to check some additional 
647
	 * conditions here.
648
	 *
649
	 * @generated
650
	 */
651
	private static boolean isNodeClass_2001(org.eclipse.uml2.uml.Class element) {
652
		return Class_2001.matches(element);
653
	}
654
655
	/**
656
	 * User can change implementation of this method to check some additional 
657
	 * conditions here.
658
	 *
659
	 * @generated
660
	 */
661
	private static boolean isNodeAssociationClass_2007(AssociationClass element) {
662
		return true;
663
	}
664
665
	/**
666
	 * User can change implementation of this method to check some additional 
667
	 * conditions here.
668
	 *
669
	 * @generated
670
	 */
671
	private static boolean isNodeDataType_2004(DataType element) {
672
		return DataType_2004.matches(element);
673
	}
674
675
	/**
676
	 * User can change implementation of this method to check some additional 
677
	 * conditions here.
678
	 *
679
	 * @generated
680
	 */
681
	private static boolean isNodePrimitiveType_2005(PrimitiveType element) {
682
		return true;
683
	}
684
685
	/**
686
	 * User can change implementation of this method to check some additional 
687
	 * conditions here.
688
	 *
689
	 * @generated
690
	 */
691
	private static boolean isNodeEnumeration_2003(Enumeration element) {
692
		return true;
693
	}
694
695
	/**
696
	 * User can change implementation of this method to check some additional 
697
	 * conditions here.
698
	 *
699
	 * @generated
700
	 */
701
	private static boolean isNodeInterface_2010(Interface element) {
702
		return true;
703
	}
704
705
	/**
706
	 * User can change implementation of this method to check some additional 
707
	 * conditions here.
708
	 *
709
	 * @generated
710
	 */
711
	private static boolean isNodeConstraint_2006(Constraint element) {
712
		return true;
713
	}
714
715
	/**
716
	 * User can change implementation of this method to check some additional 
717
	 * conditions here.
718
	 *
719
	 * @generated
720
	 */
721
	private static boolean isNodeInstanceSpecification_2008(InstanceSpecification element) {
722
		return true;
723
	}
724
725
	/**
726
	 * User can change implementation of this method to check some additional 
727
	 * conditions here.
728
	 *
729
	 * @generated
730
	 */
731
	private static boolean isNodeDependency_2009(Dependency element) {
732
		return Dependency_2009.matches(element);
733
	}
734
735
	/**
736
	 * User can change implementation of this method to check some additional 
737
	 * conditions here.
738
	 *
739
	 * @generated
740
	 */
741
	private static boolean isNodePackage_3006(org.eclipse.uml2.uml.Package element) {
742
		return true;
743
	}
744
745
	/**
746
	 * User can change implementation of this method to check some additional 
747
	 * conditions here.
748
	 *
749
	 * @generated
750
	 */
751
	private static boolean isNodeClass_3007(org.eclipse.uml2.uml.Class element) {
752
		return true;
753
	}
754
755
	/**
756
	 * User can change implementation of this method to check some additional 
757
	 * conditions here.
758
	 *
759
	 * @generated
760
	 */
761
	private static boolean isNodeDataType_3008(DataType element) {
762
		return true;
763
	}
764
765
	/**
766
	 * User can change implementation of this method to check some additional 
767
	 * conditions here.
768
	 *
769
	 * @generated
770
	 */
771
	private static boolean isNodePrimitiveType_3009(PrimitiveType element) {
772
		return true;
773
	}
774
775
	/**
776
	 * User can change implementation of this method to check some additional 
777
	 * conditions here.
778
	 *
779
	 * @generated
780
	 */
781
	private static boolean isNodeEnumeration_3011(Enumeration element) {
782
		return true;
783
	}
784
785
	/**
786
	 * User can change implementation of this method to check some additional 
787
	 * conditions here.
788
	 *
789
	 * @generated
790
	 */
791
	private static boolean isNodeAssociationClass_3012(AssociationClass element) {
792
		return true;
793
	}
794
795
	/**
796
	 * User can change implementation of this method to check some additional 
797
	 * conditions here.
798
	 *
799
	 * @generated
800
	 */
801
	private static boolean isNodeInstanceSpecification_3013(InstanceSpecification element) {
802
		return true;
803
	}
804
805
	/**
806
	 * User can change implementation of this method to check some additional 
807
	 * conditions here.
808
	 *
809
	 * @generated
810
	 */
811
	private static boolean isNodeProperty_3001(Property element) {
812
		return Property_3001.matches(element);
813
	}
814
815
	/**
816
	 * User can change implementation of this method to check some additional 
817
	 * conditions here.
818
	 *
819
	 * @generated
820
	 */
821
	private static boolean isNodeOperation_3002(Operation element) {
822
		return true;
823
	}
824
825
	/**
826
	 * User can change implementation of this method to check some additional 
827
	 * conditions here.
828
	 *
829
	 * @generated
830
	 */
831
	private static boolean isNodeClass_3003(org.eclipse.uml2.uml.Class element) {
832
		return true;
833
	}
834
835
	/**
836
	 * User can change implementation of this method to check some additional 
837
	 * conditions here.
838
	 *
839
	 * @generated
840
	 */
841
	private static boolean isNodePort_3025(Port element) {
842
		return true;
843
	}
844
845
	/**
846
	 * User can change implementation of this method to check some additional 
847
	 * conditions here.
848
	 *
849
	 * @generated
850
	 */
851
	private static boolean isNodeProperty_3019(Property element) {
852
		return true;
853
	}
854
855
	/**
856
	 * User can change implementation of this method to check some additional 
857
	 * conditions here.
858
	 *
859
	 * @generated
860
	 */
861
	private static boolean isNodeOperation_3020(Operation element) {
862
		return true;
863
	}
864
865
	/**
866
	 * User can change implementation of this method to check some additional 
867
	 * conditions here.
868
	 *
869
	 * @generated
870
	 */
871
	private static boolean isNodeProperty_3014(Property element) {
872
		return true;
873
	}
874
875
	/**
876
	 * User can change implementation of this method to check some additional 
877
	 * conditions here.
878
	 *
879
	 * @generated
880
	 */
881
	private static boolean isNodeOperation_3015(Operation element) {
882
		return true;
883
	}
884
885
	/**
886
	 * User can change implementation of this method to check some additional 
887
	 * conditions here.
888
	 *
889
	 * @generated
890
	 */
891
	private static boolean isNodeProperty_3021(Property element) {
892
		return true;
893
	}
894
895
	/**
896
	 * User can change implementation of this method to check some additional 
897
	 * conditions here.
898
	 *
899
	 * @generated
900
	 */
901
	private static boolean isNodeOperation_3022(Operation element) {
902
		return true;
903
	}
904
905
	/**
906
	 * User can change implementation of this method to check some additional 
907
	 * conditions here.
908
	 *
909
	 * @generated
910
	 */
911
	private static boolean isNodeEnumerationLiteral_3016(EnumerationLiteral element) {
912
		return true;
913
	}
914
915
	/**
916
	 * User can change implementation of this method to check some additional 
917
	 * conditions here.
918
	 *
919
	 * @generated
920
	 */
921
	private static boolean isNodeProperty_3023(Property element) {
922
		return true;
923
	}
924
925
	/**
926
	 * User can change implementation of this method to check some additional 
927
	 * conditions here.
928
	 *
929
	 * @generated
930
	 */
931
	private static boolean isNodeOperation_3024(Operation element) {
932
		return true;
933
	}
934
935
	/**
936
	 * User can change implementation of this method to check some additional 
937
	 * conditions here.
938
	 *
939
	 * @generated
940
	 */
941
	private static boolean isNodeLiteralString_3005(LiteralString element) {
942
		return true;
943
	}
944
945
	/**
946
	 * User can change implementation of this method to check some additional 
947
	 * conditions here.
948
	 *
949
	 * @generated
950
	 */
951
	private static boolean isNodeSlot_3017(Slot element) {
952
		return true;
953
	}
954
955
	/**
956
	 * User can change implementation of this method to handle some specific
957
	 * situations not covered by default logic.
958
	 *
959
	 * @generated
960
	 */
961
	private static int getUnrecognizedPackage_2002ChildNodeID(EObject domainElement, String semanticHint) {
962
		return -1;
963
	}
964
965
	/**
966
	 * User can change implementation of this method to handle some specific
967
	 * situations not covered by default logic.
968
	 *
969
	 * @generated
970
	 */
971
	private static int getUnrecognizedClass_2001ChildNodeID(EObject domainElement, String semanticHint) {
972
		return -1;
973
	}
974
975
	/**
976
	 * User can change implementation of this method to handle some specific
977
	 * situations not covered by default logic.
978
	 *
979
	 * @generated
980
	 */
981
	private static int getUnrecognizedAssociationClass_2007ChildNodeID(EObject domainElement, String semanticHint) {
982
		return -1;
983
	}
984
985
	/**
986
	 * User can change implementation of this method to handle some specific
987
	 * situations not covered by default logic.
988
	 *
989
	 * @generated
990
	 */
991
	private static int getUnrecognizedDataType_2004ChildNodeID(EObject domainElement, String semanticHint) {
992
		return -1;
993
	}
994
995
	/**
996
	 * User can change implementation of this method to handle some specific
997
	 * situations not covered by default logic.
998
	 *
999
	 * @generated
1000
	 */
1001
	private static int getUnrecognizedPrimitiveType_2005ChildNodeID(EObject domainElement, String semanticHint) {
1002
		return -1;
1003
	}
1004
1005
	/**
1006
	 * User can change implementation of this method to handle some specific
1007
	 * situations not covered by default logic.
1008
	 *
1009
	 * @generated
1010
	 */
1011
	private static int getUnrecognizedEnumeration_2003ChildNodeID(EObject domainElement, String semanticHint) {
1012
		return -1;
1013
	}
1014
1015
	/**
1016
	 * User can change implementation of this method to handle some specific
1017
	 * situations not covered by default logic.
1018
	 *
1019
	 * @generated
1020
	 */
1021
	private static int getUnrecognizedInterface_2010ChildNodeID(EObject domainElement, String semanticHint) {
1022
		return -1;
1023
	}
1024
1025
	/**
1026
	 * User can change implementation of this method to handle some specific
1027
	 * situations not covered by default logic.
1028
	 *
1029
	 * @generated
1030
	 */
1031
	private static int getUnrecognizedConstraint_2006ChildNodeID(EObject domainElement, String semanticHint) {
1032
		return -1;
1033
	}
1034
1035
	/**
1036
	 * User can change implementation of this method to handle some specific
1037
	 * situations not covered by default logic.
1038
	 *
1039
	 * @generated
1040
	 */
1041
	private static int getUnrecognizedInstanceSpecification_2008ChildNodeID(EObject domainElement, String semanticHint) {
1042
		return -1;
1043
	}
1044
1045
	/**
1046
	 * User can change implementation of this method to handle some specific
1047
	 * situations not covered by default logic.
1048
	 *
1049
	 * @generated
1050
	 */
1051
	private static int getUnrecognizedDependency_2009ChildNodeID(EObject domainElement, String semanticHint) {
1052
		return -1;
1053
	}
1054
1055
	/**
1056
	 * User can change implementation of this method to handle some specific
1057
	 * situations not covered by default logic.
1058
	 *
1059
	 * @generated
1060
	 */
1061
	private static int getUnrecognizedPackage_3006ChildNodeID(EObject domainElement, String semanticHint) {
1062
		return -1;
1063
	}
1064
1065
	/**
1066
	 * User can change implementation of this method to handle some specific
1067
	 * situations not covered by default logic.
1068
	 *
1069
	 * @generated
1070
	 */
1071
	private static int getUnrecognizedClass_3007ChildNodeID(EObject domainElement, String semanticHint) {
1072
		return -1;
1073
	}
1074
1075
	/**
1076
	 * User can change implementation of this method to handle some specific
1077
	 * situations not covered by default logic.
1078
	 *
1079
	 * @generated
1080
	 */
1081
	private static int getUnrecognizedDataType_3008ChildNodeID(EObject domainElement, String semanticHint) {
1082
		return -1;
1083
	}
1084
1085
	/**
1086
	 * User can change implementation of this method to handle some specific
1087
	 * situations not covered by default logic.
1088
	 *
1089
	 * @generated
1090
	 */
1091
	private static int getUnrecognizedPrimitiveType_3009ChildNodeID(EObject domainElement, String semanticHint) {
1092
		return -1;
1093
	}
1094
1095
	/**
1096
	 * User can change implementation of this method to handle some specific
1097
	 * situations not covered by default logic.
1098
	 *
1099
	 * @generated
1100
	 */
1101
	private static int getUnrecognizedEnumeration_3011ChildNodeID(EObject domainElement, String semanticHint) {
1102
		return -1;
1103
	}
1104
1105
	/**
1106
	 * User can change implementation of this method to handle some specific
1107
	 * situations not covered by default logic.
1108
	 *
1109
	 * @generated
1110
	 */
1111
	private static int getUnrecognizedAssociationClass_3012ChildNodeID(EObject domainElement, String semanticHint) {
1112
		return -1;
1113
	}
1114
1115
	/**
1116
	 * User can change implementation of this method to handle some specific
1117
	 * situations not covered by default logic.
1118
	 *
1119
	 * @generated
1120
	 */
1121
	private static int getUnrecognizedInstanceSpecification_3013ChildNodeID(EObject domainElement, String semanticHint) {
1122
		return -1;
1123
	}
1124
1125
	/**
1126
	 * User can change implementation of this method to handle some specific
1127
	 * situations not covered by default logic.
1128
	 *
1129
	 * @generated
1130
	 */
1131
	private static int getUnrecognizedProperty_3001ChildNodeID(EObject domainElement, String semanticHint) {
1132
		return -1;
1133
	}
1134
1135
	/**
1136
	 * User can change implementation of this method to handle some specific
1137
	 * situations not covered by default logic.
1138
	 *
1139
	 * @generated
1140
	 */
1141
	private static int getUnrecognizedOperation_3002ChildNodeID(EObject domainElement, String semanticHint) {
1142
		return -1;
1143
	}
1144
1145
	/**
1146
	 * User can change implementation of this method to handle some specific
1147
	 * situations not covered by default logic.
1148
	 *
1149
	 * @generated
1150
	 */
1151
	private static int getUnrecognizedClass_3003ChildNodeID(EObject domainElement, String semanticHint) {
1152
		return -1;
1153
	}
1154
1155
	/**
1156
	 * User can change implementation of this method to handle some specific
1157
	 * situations not covered by default logic.
1158
	 *
1159
	 * @generated
1160
	 */
1161
	private static int getUnrecognizedPort_3025ChildNodeID(EObject domainElement, String semanticHint) {
1162
		return -1;
1163
	}
1164
1165
	/**
1166
	 * User can change implementation of this method to handle some specific
1167
	 * situations not covered by default logic.
1168
	 *
1169
	 * @generated
1170
	 */
1171
	private static int getUnrecognizedProperty_3019ChildNodeID(EObject domainElement, String semanticHint) {
1172
		return -1;
1173
	}
1174
1175
	/**
1176
	 * User can change implementation of this method to handle some specific
1177
	 * situations not covered by default logic.
1178
	 *
1179
	 * @generated
1180
	 */
1181
	private static int getUnrecognizedOperation_3020ChildNodeID(EObject domainElement, String semanticHint) {
1182
		return -1;
1183
	}
1184
1185
	/**
1186
	 * User can change implementation of this method to handle some specific
1187
	 * situations not covered by default logic.
1188
	 *
1189
	 * @generated
1190
	 */
1191
	private static int getUnrecognizedProperty_3014ChildNodeID(EObject domainElement, String semanticHint) {
1192
		return -1;
1193
	}
1194
1195
	/**
1196
	 * User can change implementation of this method to handle some specific
1197
	 * situations not covered by default logic.
1198
	 *
1199
	 * @generated
1200
	 */
1201
	private static int getUnrecognizedOperation_3015ChildNodeID(EObject domainElement, String semanticHint) {
1202
		return -1;
1203
	}
1204
1205
	/**
1206
	 * User can change implementation of this method to handle some specific
1207
	 * situations not covered by default logic.
1208
	 *
1209
	 * @generated
1210
	 */
1211
	private static int getUnrecognizedProperty_3021ChildNodeID(EObject domainElement, String semanticHint) {
1212
		return -1;
1213
	}
1214
1215
	/**
1216
	 * User can change implementation of this method to handle some specific
1217
	 * situations not covered by default logic.
1218
	 *
1219
	 * @generated
1220
	 */
1221
	private static int getUnrecognizedOperation_3022ChildNodeID(EObject domainElement, String semanticHint) {
1222
		return -1;
1223
	}
1224
1225
	/**
1226
	 * User can change implementation of this method to handle some specific
1227
	 * situations not covered by default logic.
1228
	 *
1229
	 * @generated
1230
	 */
1231
	private static int getUnrecognizedEnumerationLiteral_3016ChildNodeID(EObject domainElement, String semanticHint) {
1232
		return -1;
1233
	}
1234
1235
	/**
1236
	 * User can change implementation of this method to handle some specific
1237
	 * situations not covered by default logic.
1238
	 *
1239
	 * @generated
1240
	 */
1241
	private static int getUnrecognizedProperty_3023ChildNodeID(EObject domainElement, String semanticHint) {
1242
		return -1;
1243
	}
1244
1245
	/**
1246
	 * User can change implementation of this method to handle some specific
1247
	 * situations not covered by default logic.
1248
	 *
1249
	 * @generated
1250
	 */
1251
	private static int getUnrecognizedOperation_3024ChildNodeID(EObject domainElement, String semanticHint) {
1252
		return -1;
1253
	}
1254
1255
	/**
1256
	 * User can change implementation of this method to handle some specific
1257
	 * situations not covered by default logic.
1258
	 *
1259
	 * @generated
1260
	 */
1261
	private static int getUnrecognizedLiteralString_3005ChildNodeID(EObject domainElement, String semanticHint) {
1262
		return -1;
1263
	}
1264
1265
	/**
1266
	 * User can change implementation of this method to handle some specific
1267
	 * situations not covered by default logic.
1268
	 *
1269
	 * @generated
1270
	 */
1271
	private static int getUnrecognizedSlot_3017ChildNodeID(EObject domainElement, String semanticHint) {
1272
		return -1;
1273
	}
1274
1275
	/**
1276
	 * User can change implementation of this method to handle some specific
1277
	 * situations not covered by default logic.
1278
	 *
1279
	 * @generated
1280
	 */
1281
	private static int getUnrecognizedPackagePackages_7010ChildNodeID(EObject domainElement, String semanticHint) {
1282
		return -1;
1283
	}
1284
1285
	/**
1286
	 * User can change implementation of this method to handle some specific
1287
	 * situations not covered by default logic.
1288
	 *
1289
	 * @generated
1290
	 */
1291
	private static int getUnrecognizedPackageClassifiers_7011ChildNodeID(EObject domainElement, String semanticHint) {
1292
		return -1;
1293
	}
1294
1295
	/**
1296
	 * User can change implementation of this method to handle some specific
1297
	 * situations not covered by default logic.
1298
	 *
1299
	 * @generated
1300
	 */
1301
	private static int getUnrecognizedPackageOther_7012ChildNodeID(EObject domainElement, String semanticHint) {
1302
		return -1;
1303
	}
1304
1305
	/**
1306
	 * User can change implementation of this method to handle some specific
1307
	 * situations not covered by default logic.
1308
	 *
1309
	 * @generated
1310
	 */
1311
	private static int getUnrecognizedClassAttributes_7001ChildNodeID(EObject domainElement, String semanticHint) {
1312
		return -1;
1313
	}
1314
1315
	/**
1316
	 * User can change implementation of this method to handle some specific
1317
	 * situations not covered by default logic.
1318
	 *
1319
	 * @generated
1320
	 */
1321
	private static int getUnrecognizedClassOperations_7002ChildNodeID(EObject domainElement, String semanticHint) {
1322
		return -1;
1323
	}
1324
1325
	/**
1326
	 * User can change implementation of this method to handle some specific
1327
	 * situations not covered by default logic.
1328
	 *
1329
	 * @generated
1330
	 */
1331
	private static int getUnrecognizedClassClasses_7003ChildNodeID(EObject domainElement, String semanticHint) {
1332
		return -1;
1333
	}
1334
1335
	/**
1336
	 * User can change implementation of this method to handle some specific
1337
	 * situations not covered by default logic.
1338
	 *
1339
	 * @generated
1340
	 */
1341
	private static int getUnrecognizedAssociationClassAttributes_7024ChildNodeID(EObject domainElement, String semanticHint) {
1342
		return -1;
1343
	}
1344
1345
	/**
1346
	 * User can change implementation of this method to handle some specific
1347
	 * situations not covered by default logic.
1348
	 *
1349
	 * @generated
1350
	 */
1351
	private static int getUnrecognizedAssociationClassOperations_7025ChildNodeID(EObject domainElement, String semanticHint) {
1352
		return -1;
1353
	}
1354
1355
	/**
1356
	 * User can change implementation of this method to handle some specific
1357
	 * situations not covered by default logic.
1358
	 *
1359
	 * @generated
1360
	 */
1361
	private static int getUnrecognizedAssociationClassClasses_7026ChildNodeID(EObject domainElement, String semanticHint) {
1362
		return -1;
1363
	}
1364
1365
	/**
1366
	 * User can change implementation of this method to handle some specific
1367
	 * situations not covered by default logic.
1368
	 *
1369
	 * @generated
1370
	 */
1371
	private static int getUnrecognizedDataTypeAttributes_7017ChildNodeID(EObject domainElement, String semanticHint) {
1372
		return -1;
1373
	}
1374
1375
	/**
1376
	 * User can change implementation of this method to handle some specific
1377
	 * situations not covered by default logic.
1378
	 *
1379
	 * @generated
1380
	 */
1381
	private static int getUnrecognizedDataTypeOperations_7018ChildNodeID(EObject domainElement, String semanticHint) {
1382
		return -1;
1383
	}
1384
1385
	/**
1386
	 * User can change implementation of this method to handle some specific
1387
	 * situations not covered by default logic.
1388
	 *
1389
	 * @generated
1390
	 */
1391
	private static int getUnrecognizedPrimitiveTypeAttributes_7020ChildNodeID(EObject domainElement, String semanticHint) {
1392
		return -1;
1393
	}
1394
1395
	/**
1396
	 * User can change implementation of this method to handle some specific
1397
	 * situations not covered by default logic.
1398
	 *
1399
	 * @generated
1400
	 */
1401
	private static int getUnrecognizedPrimitiveTypeOperations_7021ChildNodeID(EObject domainElement, String semanticHint) {
1402
		return -1;
1403
	}
1404
1405
	/**
1406
	 * User can change implementation of this method to handle some specific
1407
	 * situations not covered by default logic.
1408
	 *
1409
	 * @generated
1410
	 */
1411
	private static int getUnrecognizedEnumerationLiterals_7013ChildNodeID(EObject domainElement, String semanticHint) {
1412
		return -1;
1413
	}
1414
1415
	/**
1416
	 * User can change implementation of this method to handle some specific
1417
	 * situations not covered by default logic.
1418
	 *
1419
	 * @generated
1420
	 */
1421
	private static int getUnrecognizedEnumerationAttributes_7014ChildNodeID(EObject domainElement, String semanticHint) {
1422
		return -1;
1423
	}
1424
1425
	/**
1426
	 * User can change implementation of this method to handle some specific
1427
	 * situations not covered by default logic.
1428
	 *
1429
	 * @generated
1430
	 */
1431
	private static int getUnrecognizedEnumerationOperations_7015ChildNodeID(EObject domainElement, String semanticHint) {
1432
		return -1;
1433
	}
1434
1435
	/**
1436
	 * User can change implementation of this method to handle some specific
1437
	 * situations not covered by default logic.
1438
	 *
1439
	 * @generated
1440
	 */
1441
	private static int getUnrecognizedConstraintCompartment_7023ChildNodeID(EObject domainElement, String semanticHint) {
1442
		return -1;
1443
	}
1444
1445
	/**
1446
	 * User can change implementation of this method to handle some specific
1447
	 * situations not covered by default logic.
1448
	 *
1449
	 * @generated
1450
	 */
1451
	private static int getUnrecognizedInstanceSpecificationSlots_7028ChildNodeID(EObject domainElement, String semanticHint) {
1452
		return -1;
1453
	}
1454
1455
	/**
1456
	 * User can change implementation of this method to handle some specific
1457
	 * situations not covered by default logic.
1458
	 *
1459
	 * @generated
1460
	 */
1461
	private static int getUnrecognizedPackage_1000ChildNodeID(EObject domainElement, String semanticHint) {
1462
		return -1;
1463
	}
1464
1465
	/**
1466
	 * User can change implementation of this method to handle some specific
1467
	 * situations not covered by default logic.
1468
	 *
1469
	 * @generated
1470
	 */
1471
	private static int getUnrecognizedDependency_4002LinkLabelID(String semanticHint) {
1472
		return -1;
1473
	}
1474
1475
	/**
1476
	 * User can change implementation of this method to handle some specific
1477
	 * situations not covered by default logic.
1478
	 *
1479
	 * @generated
1480
	 */
1481
	private static int getUnrecognizedProperty_4003LinkLabelID(String semanticHint) {
1482
		return -1;
1483
	}
1484
1485
	/**
1486
	 * User can change implementation of this method to handle some specific
1487
	 * situations not covered by default logic.
1488
	 *
1489
	 * @generated
1490
	 */
1491
	private static int getUnrecognizedAssociation_4005LinkLabelID(String semanticHint) {
1492
		return -1;
1493
	}
1494
1495
	/**
1496
	 * User can change implementation of this method to handle some specific
1497
	 * situations not covered by default logic.
1498
	 *
1499
	 * @generated
1500
	 */
1501
	private static int getUnrecognizedLinkWithClassID(EObject domainElement) {
1502
		return -1;
1503
	}
1504
1505
	/**
1506
	 * User can change implementation of this method to check some additional 
1507
	 * conditions here.
1508
	 *
1509
	 * @generated
1510
	 */
1511
	private static boolean isLinkWithClassGeneralization_4001(Generalization element) {
1512
		return true;
1513
	}
1514
1515
	/**
1516
	 * User can change implementation of this method to check some additional 
1517
	 * conditions here.
1518
	 *
1519
	 * @generated
1520
	 */
1521
	private static boolean isLinkWithClassDependency_4002(Dependency element) {
1522
		return Dependency_4002.matches(element);
1523
	}
1524
1525
	/**
1526
	 * User can change implementation of this method to check some additional 
1527
	 * conditions here.
1528
	 *
1529
	 * @generated
1530
	 */
1531
	private static boolean isLinkWithClassProperty_4003(Property element) {
1532
		return true;
1533
	}
1534
1535
	/**
1536
	 * User can change implementation of this method to check some additional 
1537
	 * conditions here.
1538
	 *
1539
	 * @generated
1540
	 */
1541
	private static boolean isLinkWithClassAssociation_4005(Association element) {
1542
		return true;
1543
	}
1544
1545
	/**
1546
	 * User can change implementation of this method to check some additional 
1547
	 * conditions here.
1548
	 *
1549
	 * @generated
1550
	 */
1551
	private static boolean isLinkWithClassInterfaceRealization_4008(InterfaceRealization element) {
1552
		return true;
1553
	}
1554
1555
	/**
1556
	 * User can change implementation of this method to check some additional 
1557
	 * conditions here.
1558
	 *
1559
	 * @generated
1560
	 */
1561
	private static boolean isLinkWithClassUsage_4009(Usage element) {
1562
		return Usage_4009.matches(element);
1563
	}
1564
1565
	/**
1566
	 * @generated
1567
	 */
1568
	private static final Matcher Property_3001 = new Matcher(UMLOCLFactory.getExpression("not oclIsKindOf(uml::Port)", //$NON-NLS-1$
1569
			UMLPackage.eINSTANCE.getProperty()));
1570
1571
	/**
1572
	 * @generated
1573
	 */
1574
	private static final Matcher Class_2001 = new Matcher(UMLOCLFactory.getExpression("not oclIsKindOf(uml::AssociationClass) and not oclIsKindOf(uml::StateMachine)", //$NON-NLS-1$
1575
			UMLPackage.eINSTANCE.getClass_()));
1576
1577
	/**
1578
	 * @generated
1579
	 */
1580
	private static final Matcher DataType_2004 = new Matcher(UMLOCLFactory.getExpression("not oclIsKindOf(uml::PrimitiveType) and not oclIsKindOf(uml::Enumeration)", //$NON-NLS-1$
1581
			UMLPackage.eINSTANCE.getDataType()));
1582
1583
	/**
1584
	 * @generated
1585
	 */
1586
	private static final Matcher Dependency_2009 = new Matcher(UMLOCLFactory.getExpression("self.supplier->size() > 1 or self.client->size() > 1", //$NON-NLS-1$
1587
			UMLPackage.eINSTANCE.getDependency()));
1588
1589
	/**
1590
	 * @generated
1591
	 */
1592
	private static final Matcher Dependency_4002 = new Matcher(UMLOCLFactory.getExpression("self.oclIsTypeOf(uml::Dependency) and self.supplier->size() = 1 and self.client->size() = 1", //$NON-NLS-1$
1593
			UMLPackage.eINSTANCE.getDependency()));
1594
1595
	/**
1596
	 * @generated
1597
	 */
1598
	private static final Matcher Usage_4009 = new Matcher(UMLOCLFactory.getExpression(
1599
			"self.supplier->size() = 1 and self.client->size() = 1 and self.client->forAll(e:NamedElement | e.oclIsKindOf(uml::Classifier))", //$NON-NLS-1$
1600
			UMLPackage.eINSTANCE.getUsage()));
1601
1602
	/**
1603
	 * @generated	
1604
	 */
1605
	static class Matcher {
1606
1607
		/**
1608
		 * @generated	
1609
		 */
1610
		private UMLAbstractExpression condition;
1611
1612
		/**
1613
		 * @generated	
1614
		 */
1615
		Matcher(UMLAbstractExpression conditionExpression) {
1616
			this.condition = conditionExpression;
1617
		}
1618
1619
		/**
1620
		 * @generated	
1621
		 */
1622
		boolean matches(EObject object) {
1623
			Object result = condition.evaluate(object);
1624
			return result instanceof Boolean && ((Boolean) result).booleanValue();
1625
		}
1626
	}// Matcher
1627
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/instance/InstanceSpecificationParserTokenManager.java (+728 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. InstanceSpecificationParserTokenManager.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.instance;
14
import java.io.*;
15
import java.util.*;
16
import org.eclipse.emf.ecore.EClass;
17
import org.eclipse.emf.ecore.EObject;
18
import org.eclipse.uml2.diagram.parser.*;
19
import org.eclipse.uml2.diagram.parser.lookup.LookupResolver;
20
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
21
import org.eclipse.uml2.uml.*;
22
23
public class InstanceSpecificationParserTokenManager implements InstanceSpecificationParserConstants
24
{
25
  public  java.io.PrintStream debugStream = System.out;
26
  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
27
private final int jjStopStringLiteralDfa_0(int pos, long active0)
28
{
29
   switch (pos)
30
   {
31
      case 0:
32
         if ((active0 & 0x1fe0000L) != 0L)
33
         {
34
            jjmatchedKind = 26;
35
            return 2;
36
         }
37
         return -1;
38
      case 1:
39
         if ((active0 & 0x1fe0000L) != 0L)
40
         {
41
            jjmatchedKind = 26;
42
            jjmatchedPos = 1;
43
            return 2;
44
         }
45
         return -1;
46
      case 2:
47
         if ((active0 & 0x1fe0000L) != 0L)
48
         {
49
            jjmatchedKind = 26;
50
            jjmatchedPos = 2;
51
            return 2;
52
         }
53
         return -1;
54
      case 3:
55
         if ((active0 & 0x1fe0000L) != 0L)
56
         {
57
            jjmatchedKind = 26;
58
            jjmatchedPos = 3;
59
            return 2;
60
         }
61
         return -1;
62
      case 4:
63
         if ((active0 & 0x40000L) != 0L)
64
            return 2;
65
         if ((active0 & 0x1fa0000L) != 0L)
66
         {
67
            jjmatchedKind = 26;
68
            jjmatchedPos = 4;
69
            return 2;
70
         }
71
         return -1;
72
      case 5:
73
         if ((active0 & 0x800000L) != 0L)
74
            return 2;
75
         if ((active0 & 0x17a0000L) != 0L)
76
         {
77
            jjmatchedKind = 26;
78
            jjmatchedPos = 5;
79
            return 2;
80
         }
81
         return -1;
82
      case 6:
83
         if ((active0 & 0x280000L) != 0L)
84
            return 2;
85
         if ((active0 & 0x1520000L) != 0L)
86
         {
87
            jjmatchedKind = 26;
88
            jjmatchedPos = 6;
89
            return 2;
90
         }
91
         return -1;
92
      case 7:
93
         if ((active0 & 0x20000L) != 0L)
94
            return 2;
95
         if ((active0 & 0x1500000L) != 0L)
96
         {
97
            jjmatchedKind = 26;
98
            jjmatchedPos = 7;
99
            return 2;
100
         }
101
         return -1;
102
      default :
103
         return -1;
104
   }
105
}
106
private final int jjStartNfa_0(int pos, long active0)
107
{
108
   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
109
}
110
private final int jjStopAtPos(int pos, int kind)
111
{
112
   jjmatchedKind = kind;
113
   jjmatchedPos = pos;
114
   return pos + 1;
115
}
116
private final int jjStartNfaWithStates_0(int pos, int kind, int state)
117
{
118
   jjmatchedKind = kind;
119
   jjmatchedPos = pos;
120
   try { curChar = input_stream.readChar(); }
121
   catch(java.io.IOException e) { return pos + 1; }
122
   return jjMoveNfa_0(state, pos + 1);
123
}
124
private final int jjMoveStringLiteralDfa0_0()
125
{
126
   switch(curChar)
127
   {
128
      case 9:
129
         return jjStopAtPos(0, 2);
130
      case 32:
131
         return jjStopAtPos(0, 1);
132
      case 35:
133
         return jjStopAtPos(0, 13);
134
      case 42:
135
         return jjStopAtPos(0, 16);
136
      case 43:
137
         return jjStopAtPos(0, 11);
138
      case 44:
139
         return jjStopAtPos(0, 10);
140
      case 45:
141
         return jjStopAtPos(0, 12);
142
      case 46:
143
         return jjStopAtPos(0, 15);
144
      case 47:
145
         return jjStopAtPos(0, 3);
146
      case 58:
147
         return jjStopAtPos(0, 4);
148
      case 61:
149
         return jjStopAtPos(0, 5);
150
      case 91:
151
         return jjStopAtPos(0, 6);
152
      case 93:
153
         return jjStopAtPos(0, 7);
154
      case 110:
155
         return jjMoveStringLiteralDfa1_0(0x1000000L);
156
      case 111:
157
         return jjMoveStringLiteralDfa1_0(0x200000L);
158
      case 114:
159
         return jjMoveStringLiteralDfa1_0(0x120000L);
160
      case 115:
161
         return jjMoveStringLiteralDfa1_0(0x80000L);
162
      case 117:
163
         return jjMoveStringLiteralDfa1_0(0xc40000L);
164
      case 123:
165
         return jjStopAtPos(0, 8);
166
      case 125:
167
         return jjStopAtPos(0, 9);
168
      case 126:
169
         return jjStopAtPos(0, 14);
170
      default :
171
         return jjMoveNfa_0(1, 0);
172
   }
173
}
174
private final int jjMoveStringLiteralDfa1_0(long active0)
175
{
176
   try { curChar = input_stream.readChar(); }
177
   catch(java.io.IOException e) {
178
      jjStopStringLiteralDfa_0(0, active0);
179
      return 1;
180
   }
181
   switch(curChar)
182
   {
183
      case 101:
184
         return jjMoveStringLiteralDfa2_0(active0, 0x120000L);
185
      case 110:
186
         return jjMoveStringLiteralDfa2_0(active0, 0xc40000L);
187
      case 111:
188
         return jjMoveStringLiteralDfa2_0(active0, 0x1000000L);
189
      case 114:
190
         return jjMoveStringLiteralDfa2_0(active0, 0x200000L);
191
      case 117:
192
         return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
193
      default :
194
         break;
195
   }
196
   return jjStartNfa_0(0, active0);
197
}
198
private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
199
{
200
   if (((active0 &= old0)) == 0L)
201
      return jjStartNfa_0(0, old0); 
202
   try { curChar = input_stream.readChar(); }
203
   catch(java.io.IOException e) {
204
      jjStopStringLiteralDfa_0(1, active0);
205
      return 2;
206
   }
207
   switch(curChar)
208
   {
209
      case 97:
210
         return jjMoveStringLiteralDfa3_0(active0, 0x20000L);
211
      case 98:
212
         return jjMoveStringLiteralDfa3_0(active0, 0x80000L);
213
      case 100:
214
         return jjMoveStringLiteralDfa3_0(active0, 0x300000L);
215
      case 105:
216
         return jjMoveStringLiteralDfa3_0(active0, 0x840000L);
217
      case 110:
218
         return jjMoveStringLiteralDfa3_0(active0, 0x1000000L);
219
      case 111:
220
         return jjMoveStringLiteralDfa3_0(active0, 0x400000L);
221
      default :
222
         break;
223
   }
224
   return jjStartNfa_0(1, active0);
225
}
226
private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
227
{
228
   if (((active0 &= old0)) == 0L)
229
      return jjStartNfa_0(1, old0); 
230
   try { curChar = input_stream.readChar(); }
231
   catch(java.io.IOException e) {
232
      jjStopStringLiteralDfa_0(2, active0);
233
      return 3;
234
   }
235
   switch(curChar)
236
   {
237
      case 100:
238
         return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
239
      case 101:
240
         return jjMoveStringLiteralDfa4_0(active0, 0x300000L);
241
      case 111:
242
         return jjMoveStringLiteralDfa4_0(active0, 0x40000L);
243
      case 113:
244
         return jjMoveStringLiteralDfa4_0(active0, 0x800000L);
245
      case 114:
246
         return jjMoveStringLiteralDfa4_0(active0, 0x400000L);
247
      case 115:
248
         return jjMoveStringLiteralDfa4_0(active0, 0x80000L);
249
      case 117:
250
         return jjMoveStringLiteralDfa4_0(active0, 0x1000000L);
251
      default :
252
         break;
253
   }
254
   return jjStartNfa_0(2, active0);
255
}
256
private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
257
{
258
   if (((active0 &= old0)) == 0L)
259
      return jjStartNfa_0(2, old0); 
260
   try { curChar = input_stream.readChar(); }
261
   catch(java.io.IOException e) {
262
      jjStopStringLiteralDfa_0(3, active0);
263
      return 4;
264
   }
265
   switch(curChar)
266
   {
267
      case 79:
268
         return jjMoveStringLiteralDfa5_0(active0, 0x20000L);
269
      case 100:
270
         return jjMoveStringLiteralDfa5_0(active0, 0x400000L);
271
      case 101:
272
         return jjMoveStringLiteralDfa5_0(active0, 0x80000L);
273
      case 102:
274
         return jjMoveStringLiteralDfa5_0(active0, 0x100000L);
275
      case 110:
276
         if ((active0 & 0x40000L) != 0L)
277
            return jjStartNfaWithStates_0(4, 18, 2);
278
         return jjMoveStringLiteralDfa5_0(active0, 0x1000000L);
279
      case 114:
280
         return jjMoveStringLiteralDfa5_0(active0, 0x200000L);
281
      case 117:
282
         return jjMoveStringLiteralDfa5_0(active0, 0x800000L);
283
      default :
284
         break;
285
   }
286
   return jjStartNfa_0(3, active0);
287
}
288
private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
289
{
290
   if (((active0 &= old0)) == 0L)
291
      return jjStartNfa_0(3, old0); 
292
   try { curChar = input_stream.readChar(); }
293
   catch(java.io.IOException e) {
294
      jjStopStringLiteralDfa_0(4, active0);
295
      return 5;
296
   }
297
   switch(curChar)
298
   {
299
      case 101:
300
         if ((active0 & 0x800000L) != 0L)
301
            return jjStartNfaWithStates_0(5, 23, 2);
302
         return jjMoveStringLiteralDfa6_0(active0, 0x600000L);
303
      case 105:
304
         return jjMoveStringLiteralDfa6_0(active0, 0x1100000L);
305
      case 110:
306
         return jjMoveStringLiteralDfa6_0(active0, 0x20000L);
307
      case 116:
308
         return jjMoveStringLiteralDfa6_0(active0, 0x80000L);
309
      default :
310
         break;
311
   }
312
   return jjStartNfa_0(4, active0);
313
}
314
private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
315
{
316
   if (((active0 &= old0)) == 0L)
317
      return jjStartNfa_0(4, old0); 
318
   try { curChar = input_stream.readChar(); }
319
   catch(java.io.IOException e) {
320
      jjStopStringLiteralDfa_0(5, active0);
321
      return 6;
322
   }
323
   switch(curChar)
324
   {
325
      case 100:
326
         if ((active0 & 0x200000L) != 0L)
327
            return jjStartNfaWithStates_0(6, 21, 2);
328
         break;
329
      case 108:
330
         return jjMoveStringLiteralDfa7_0(active0, 0x20000L);
331
      case 110:
332
         return jjMoveStringLiteralDfa7_0(active0, 0x100000L);
333
      case 113:
334
         return jjMoveStringLiteralDfa7_0(active0, 0x1000000L);
335
      case 114:
336
         return jjMoveStringLiteralDfa7_0(active0, 0x400000L);
337
      case 115:
338
         if ((active0 & 0x80000L) != 0L)
339
            return jjStartNfaWithStates_0(6, 19, 2);
340
         break;
341
      default :
342
         break;
343
   }
344
   return jjStartNfa_0(5, active0);
345
}
346
private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
347
{
348
   if (((active0 &= old0)) == 0L)
349
      return jjStartNfa_0(5, old0); 
350
   try { curChar = input_stream.readChar(); }
351
   catch(java.io.IOException e) {
352
      jjStopStringLiteralDfa_0(6, active0);
353
      return 7;
354
   }
355
   switch(curChar)
356
   {
357
      case 101:
358
         return jjMoveStringLiteralDfa8_0(active0, 0x500000L);
359
      case 117:
360
         return jjMoveStringLiteralDfa8_0(active0, 0x1000000L);
361
      case 121:
362
         if ((active0 & 0x20000L) != 0L)
363
            return jjStartNfaWithStates_0(7, 17, 2);
364
         break;
365
      default :
366
         break;
367
   }
368
   return jjStartNfa_0(6, active0);
369
}
370
private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
371
{
372
   if (((active0 &= old0)) == 0L)
373
      return jjStartNfa_0(6, old0); 
374
   try { curChar = input_stream.readChar(); }
375
   catch(java.io.IOException e) {
376
      jjStopStringLiteralDfa_0(7, active0);
377
      return 8;
378
   }
379
   switch(curChar)
380
   {
381
      case 100:
382
         if ((active0 & 0x400000L) != 0L)
383
            return jjStartNfaWithStates_0(8, 22, 2);
384
         break;
385
      case 101:
386
         if ((active0 & 0x1000000L) != 0L)
387
            return jjStartNfaWithStates_0(8, 24, 2);
388
         break;
389
      case 115:
390
         if ((active0 & 0x100000L) != 0L)
391
            return jjStartNfaWithStates_0(8, 20, 2);
392
         break;
393
      default :
394
         break;
395
   }
396
   return jjStartNfa_0(7, active0);
397
}
398
private final void jjCheckNAdd(int state)
399
{
400
   if (jjrounds[state] != jjround)
401
   {
402
      jjstateSet[jjnewStateCnt++] = state;
403
      jjrounds[state] = jjround;
404
   }
405
}
406
private final void jjAddStates(int start, int end)
407
{
408
   do {
409
      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
410
   } while (start++ != end);
411
}
412
private final void jjCheckNAddTwoStates(int state1, int state2)
413
{
414
   jjCheckNAdd(state1);
415
   jjCheckNAdd(state2);
416
}
417
private final void jjCheckNAddStates(int start, int end)
418
{
419
   do {
420
      jjCheckNAdd(jjnextStates[start]);
421
   } while (start++ != end);
422
}
423
private final void jjCheckNAddStates(int start)
424
{
425
   jjCheckNAdd(jjnextStates[start]);
426
   jjCheckNAdd(jjnextStates[start + 1]);
427
}
428
static final long[] jjbitVec0 = {
429
   0x1ff00000fffffffeL, 0xffffffffffffc000L, 0xffffffffL, 0x600000000000000L
430
};
431
static final long[] jjbitVec2 = {
432
   0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
433
};
434
static final long[] jjbitVec3 = {
435
   0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
436
};
437
static final long[] jjbitVec4 = {
438
   0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
439
};
440
static final long[] jjbitVec5 = {
441
   0xffffffffffffffffL, 0xffffffffffffffffL, 0x0L, 0x0L
442
};
443
static final long[] jjbitVec6 = {
444
   0x3fffffffffffL, 0x0L, 0x0L, 0x0L
445
};
446
private final int jjMoveNfa_0(int startState, int curPos)
447
{
448
   int[] nextStates;
449
   int startsAt = 0;
450
   jjnewStateCnt = 3;
451
   int i = 1;
452
   jjstateSet[0] = startState;
453
   int j, kind = 0x7fffffff;
454
   for (;;)
455
   {
456
      if (++jjround == 0x7fffffff)
457
         ReInitRounds();
458
      if (curChar < 64)
459
      {
460
         long l = 1L << curChar;
461
         MatchLoop: do
462
         {
463
            switch(jjstateSet[--i])
464
            {
465
               case 1:
466
                  if ((0x3ff000000000000L & l) != 0L)
467
                  {
468
                     if (kind > 25)
469
                        kind = 25;
470
                     jjCheckNAdd(0);
471
                  }
472
                  else if (curChar == 36)
473
                  {
474
                     if (kind > 26)
475
                        kind = 26;
476
                     jjCheckNAdd(2);
477
                  }
478
                  break;
479
               case 0:
480
                  if ((0x3ff000000000000L & l) == 0L)
481
                     break;
482
                  if (kind > 25)
483
                     kind = 25;
484
                  jjCheckNAdd(0);
485
                  break;
486
               case 2:
487
                  if ((0x3ff001000000000L & l) == 0L)
488
                     break;
489
                  if (kind > 26)
490
                     kind = 26;
491
                  jjCheckNAdd(2);
492
                  break;
493
               default : break;
494
            }
495
         } while(i != startsAt);
496
      }
497
      else if (curChar < 128)
498
      {
499
         long l = 1L << (curChar & 077);
500
         MatchLoop: do
501
         {
502
            switch(jjstateSet[--i])
503
            {
504
               case 1:
505
               case 2:
506
                  if ((0x7fffffe87fffffeL & l) == 0L)
507
                     break;
508
                  if (kind > 26)
509
                     kind = 26;
510
                  jjCheckNAdd(2);
511
                  break;
512
               default : break;
513
            }
514
         } while(i != startsAt);
515
      }
516
      else
517
      {
518
         int hiByte = (int)(curChar >> 8);
519
         int i1 = hiByte >> 6;
520
         long l1 = 1L << (hiByte & 077);
521
         int i2 = (curChar & 0xff) >> 6;
522
         long l2 = 1L << (curChar & 077);
523
         MatchLoop: do
524
         {
525
            switch(jjstateSet[--i])
526
            {
527
               case 1:
528
               case 2:
529
                  if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
530
                     break;
531
                  if (kind > 26)
532
                     kind = 26;
533
                  jjCheckNAdd(2);
534
                  break;
535
               default : break;
536
            }
537
         } while(i != startsAt);
538
      }
539
      if (kind != 0x7fffffff)
540
      {
541
         jjmatchedKind = kind;
542
         jjmatchedPos = curPos;
543
         kind = 0x7fffffff;
544
      }
545
      ++curPos;
546
      if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
547
         return curPos;
548
      try { curChar = input_stream.readChar(); }
549
      catch(java.io.IOException e) { return curPos; }
550
   }
551
}
552
static final int[] jjnextStates = {
553
};
554
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
555
{
556
   switch(hiByte)
557
   {
558
      case 0:
559
         return ((jjbitVec2[i2] & l2) != 0L);
560
      case 48:
561
         return ((jjbitVec3[i2] & l2) != 0L);
562
      case 49:
563
         return ((jjbitVec4[i2] & l2) != 0L);
564
      case 51:
565
         return ((jjbitVec5[i2] & l2) != 0L);
566
      case 61:
567
         return ((jjbitVec6[i2] & l2) != 0L);
568
      default : 
569
         if ((jjbitVec0[i1] & l1) != 0L)
570
            return true;
571
         return false;
572
   }
573
}
574
public static final String[] jjstrLiteralImages = {
575
"", null, null, "\57", "\72", "\75", "\133", "\135", "\173", "\175", "\54", 
576
"\53", "\55", "\43", "\176", "\56", "\52", "\162\145\141\144\117\156\154\171", 
577
"\165\156\151\157\156", "\163\165\142\163\145\164\163", "\162\145\144\145\146\151\156\145\163", 
578
"\157\162\144\145\162\145\144", "\165\156\157\162\144\145\162\145\144", "\165\156\151\161\165\145", 
579
"\156\157\156\165\156\151\161\165\145", null, null, null, null, };
580
public static final String[] lexStateNames = {
581
   "DEFAULT", 
582
};
583
static final long[] jjtoToken = {
584
   0x7fffff9L, 
585
};
586
static final long[] jjtoSkip = {
587
   0x6L, 
588
};
589
static final long[] jjtoSpecial = {
590
   0x6L, 
591
};
592
protected JavaCharStream input_stream;
593
private final int[] jjrounds = new int[3];
594
private final int[] jjstateSet = new int[6];
595
protected char curChar;
596
public InstanceSpecificationParserTokenManager(JavaCharStream stream)
597
{
598
   if (JavaCharStream.staticFlag)
599
      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
600
   input_stream = stream;
601
}
602
public InstanceSpecificationParserTokenManager(JavaCharStream stream, int lexState)
603
{
604
   this(stream);
605
   SwitchTo(lexState);
606
}
607
public void ReInit(JavaCharStream stream)
608
{
609
   jjmatchedPos = jjnewStateCnt = 0;
610
   curLexState = defaultLexState;
611
   input_stream = stream;
612
   ReInitRounds();
613
}
614
private final void ReInitRounds()
615
{
616
   int i;
617
   jjround = 0x80000001;
618
   for (i = 3; i-- > 0;)
619
      jjrounds[i] = 0x80000000;
620
}
621
public void ReInit(JavaCharStream stream, int lexState)
622
{
623
   ReInit(stream);
624
   SwitchTo(lexState);
625
}
626
public void SwitchTo(int lexState)
627
{
628
   if (lexState >= 1 || lexState < 0)
629
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
630
   else
631
      curLexState = lexState;
632
}
633
634
protected Token jjFillToken()
635
{
636
   Token t = Token.newToken(jjmatchedKind);
637
   t.kind = jjmatchedKind;
638
   String im = jjstrLiteralImages[jjmatchedKind];
639
   t.image = (im == null) ? input_stream.GetImage() : im;
640
   t.beginLine = input_stream.getBeginLine();
641
   t.beginColumn = input_stream.getBeginColumn();
642
   t.endLine = input_stream.getEndLine();
643
   t.endColumn = input_stream.getEndColumn();
644
   return t;
645
}
646
647
int curLexState = 0;
648
int defaultLexState = 0;
649
int jjnewStateCnt;
650
int jjround;
651
int jjmatchedPos;
652
int jjmatchedKind;
653
654
public Token getNextToken() 
655
{
656
  int kind;
657
  Token specialToken = null;
658
  Token matchedToken;
659
  int curPos = 0;
660
661
  EOFLoop :
662
  for (;;)
663
  {   
664
   try   
665
   {     
666
      curChar = input_stream.BeginToken();
667
   }     
668
   catch(java.io.IOException e)
669
   {        
670
      jjmatchedKind = 0;
671
      matchedToken = jjFillToken();
672
      matchedToken.specialToken = specialToken;
673
      return matchedToken;
674
   }
675
676
   jjmatchedKind = 0x7fffffff;
677
   jjmatchedPos = 0;
678
   curPos = jjMoveStringLiteralDfa0_0();
679
   if (jjmatchedKind != 0x7fffffff)
680
   {
681
      if (jjmatchedPos + 1 < curPos)
682
         input_stream.backup(curPos - jjmatchedPos - 1);
683
      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
684
      {
685
         matchedToken = jjFillToken();
686
         matchedToken.specialToken = specialToken;
687
         return matchedToken;
688
      }
689
      else
690
      {
691
         if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
692
         {
693
            matchedToken = jjFillToken();
694
            if (specialToken == null)
695
               specialToken = matchedToken;
696
            else
697
            {
698
               matchedToken.specialToken = specialToken;
699
               specialToken = (specialToken.next = matchedToken);
700
            }
701
         }
702
         continue EOFLoop;
703
      }
704
   }
705
   int error_line = input_stream.getEndLine();
706
   int error_column = input_stream.getEndColumn();
707
   String error_after = null;
708
   boolean EOFSeen = false;
709
   try { input_stream.readChar(); input_stream.backup(1); }
710
   catch (java.io.IOException e1) {
711
      EOFSeen = true;
712
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
713
      if (curChar == '\n' || curChar == '\r') {
714
         error_line++;
715
         error_column = 0;
716
      }
717
      else
718
         error_column++;
719
   }
720
   if (!EOFSeen) {
721
      input_stream.backup(1);
722
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
723
   }
724
   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
725
  }
726
}
727
728
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Class3ViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class Class3ViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Class3EditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/end/Token.java (+92 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.end;
14
15
/**
16
 * Describes the input token stream.
17
 */
18
19
public class Token {
20
21
  /**
22
   * An integer that describes the kind of this token.  This numbering
23
   * system is determined by JavaCCParser, and a table of these numbers is
24
   * stored in the file ...Constants.java.
25
   */
26
  public int kind;
27
28
  /**
29
   * beginLine and beginColumn describe the position of the first character
30
   * of this token; endLine and endColumn describe the position of the
31
   * last character of this token.
32
   */
33
  public int beginLine, beginColumn, endLine, endColumn;
34
35
  /**
36
   * The string image of the token.
37
   */
38
  public String image;
39
40
  /**
41
   * A reference to the next regular (non-special) token from the input
42
   * stream.  If this is the last token from the input stream, or if the
43
   * token manager has not read tokens beyond this one, this field is
44
   * set to null.  This is true only if this token is also a regular
45
   * token.  Otherwise, see below for a description of the contents of
46
   * this field.
47
   */
48
  public Token next;
49
50
  /**
51
   * This field is used to access special tokens that occur prior to this
52
   * token, but after the immediately preceding regular (non-special) token.
53
   * If there are no such special tokens, this field is set to null.
54
   * When there are more than one such special token, this field refers
55
   * to the last of these special tokens, which in turn refers to the next
56
   * previous special token through its specialToken field, and so on
57
   * until the first special token (whose specialToken field is null).
58
   * The next fields of special tokens refer to other special tokens that
59
   * immediately follow it (without an intervening regular token).  If there
60
   * is no such token, this field is null.
61
   */
62
  public Token specialToken;
63
64
  /**
65
   * Returns the image.
66
   */
67
  public String toString()
68
  {
69
     return image;
70
  }
71
72
  /**
73
   * Returns a new Token object, by default. However, if you want, you
74
   * can create and return subclass objects based on the value of ofKind.
75
   * Simply add the cases to the switch for all those special cases.
76
   * For example, if you have a subclass of Token called IDToken that
77
   * you want to create if ofKind is ID, simlpy add something like :
78
   *
79
   *    case MyParserConstants.ID : return new IDToken();
80
   *
81
   * to the following switch statement. Then you can cast matchedToken
82
   * variable to the appropriate type and use it in your lexical actions.
83
   */
84
  public static final Token newToken(int ofKind)
85
  {
86
     switch(ofKind)
87
     {
88
       default : return new Token();
89
     }
90
  }
91
92
}
(-)src/org/eclipse/uml2/diagram/clazz/navigator/UMLNavigatorSorter.java (+29 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.navigator;
2
3
import org.eclipse.jface.viewers.ViewerSorter;
4
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
5
6
/**
7
 * @generated
8
 */
9
public class UMLNavigatorSorter extends ViewerSorter {
10
11
	/**
12
	 * @generated
13
	 */
14
	private static final int GROUP_CATEGORY = 7029;
15
16
	/**
17
	 * @generated
18
	 */
19
	public int category(Object element) {
20
		if (element instanceof UMLNavigatorItem) {
21
			UMLNavigatorItem item = (UMLNavigatorItem) element;
22
			if (PackageEditPart.MODEL_ID.equals(item.getModelID())) {
23
				return item.getVisualID();
24
			}
25
		}
26
		return GROUP_CATEGORY;
27
	}
28
29
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/ClassViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class ClassViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.ClassEditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/DependencySupplierEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class DependencySupplierEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/GeneralizationEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class GeneralizationEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/AssociationEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class AssociationEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/sheet/UMLPropertySection.java (+107 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.sheet;
2
3
import java.util.ArrayList;
4
import java.util.Iterator;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.common.notify.AdapterFactory;
8
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
9
import org.eclipse.emf.edit.provider.IItemPropertySource;
10
import org.eclipse.emf.edit.ui.provider.PropertySource;
11
import org.eclipse.emf.transaction.TransactionalEditingDomain;
12
import org.eclipse.emf.transaction.util.TransactionUtil;
13
import org.eclipse.gef.EditPart;
14
import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection;
15
import org.eclipse.gmf.runtime.notation.View;
16
import org.eclipse.jface.viewers.ISelection;
17
import org.eclipse.jface.viewers.StructuredSelection;
18
import org.eclipse.ui.IWorkbenchPart;
19
import org.eclipse.ui.views.properties.IPropertySource;
20
import org.eclipse.ui.views.properties.IPropertySourceProvider;
21
22
/**
23
 * @generated
24
 */
25
public class UMLPropertySection extends AdvancedPropertySection implements IPropertySourceProvider {
26
27
	/**
28
	 * @generated
29
	 */
30
	public IPropertySource getPropertySource(Object object) {
31
		if (object instanceof IPropertySource) {
32
			return (IPropertySource) object;
33
		}
34
		AdapterFactory af = getAdapterFactory(object);
35
		if (af != null) {
36
			IItemPropertySource ips = (IItemPropertySource) af.adapt(object, IItemPropertySource.class);
37
			if (ips != null) {
38
				return new PropertySource(object, ips);
39
			}
40
		}
41
		if (object instanceof IAdaptable) {
42
			return (IPropertySource) ((IAdaptable) object).getAdapter(IPropertySource.class);
43
		}
44
		return null;
45
	}
46
47
	/**
48
	 * Modify/unwrap selection.  
49
	 * @generated
50
	 */
51
	protected Object transformSelection(Object selected) {
52
		if (selected instanceof EditPart) {
53
			Object model = ((EditPart) selected).getModel();
54
			return model instanceof View ? ((View) model).getElement() : null;
55
		}
56
		if (selected instanceof View) {
57
			return ((View) selected).getElement();
58
		}
59
		if (selected instanceof IAdaptable) {
60
			View view = (View) ((IAdaptable) selected).getAdapter(View.class);
61
			if (view != null) {
62
				return view.getElement();
63
			}
64
		}
65
		return selected;
66
	}
67
68
	/**
69
	 * @generated
70
	 */
71
	protected IPropertySourceProvider getPropertySourceProvider() {
72
		return this;
73
	}
74
75
	/**
76
	 * @generated
77
	 */
78
	public void setInput(IWorkbenchPart part, ISelection selection) {
79
		if (selection.isEmpty() || false == selection instanceof StructuredSelection) {
80
			super.setInput(part, selection);
81
			return;
82
		}
83
		final StructuredSelection structuredSelection = ((StructuredSelection) selection);
84
		ArrayList transformedSelection = new ArrayList(structuredSelection.size());
85
		for (Iterator it = structuredSelection.iterator(); it.hasNext();) {
86
			Object r = transformSelection(it.next());
87
			if (r != null) {
88
				transformedSelection.add(r);
89
			}
90
		}
91
		super.setInput(part, new StructuredSelection(transformedSelection));
92
	}
93
94
	/**
95
	 * @generated
96
	 */
97
	protected AdapterFactory getAdapterFactory(Object object) {
98
		if (getEditingDomain() instanceof AdapterFactoryEditingDomain) {
99
			return ((AdapterFactoryEditingDomain) getEditingDomain()).getAdapterFactory();
100
		}
101
		TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(object);
102
		if (editingDomain != null) {
103
			return ((AdapterFactoryEditingDomain) editingDomain).getAdapterFactory();
104
		}
105
		return null;
106
	}
107
}
(-)src/org/eclipse/uml2/diagram/clazz/providers/UMLModelingAssistantProvider.java (+259 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.providers;
2
3
import java.util.ArrayList;
4
import java.util.Collection;
5
import java.util.Collections;
6
import java.util.HashSet;
7
import java.util.Iterator;
8
import java.util.List;
9
10
import org.eclipse.core.runtime.IAdaptable;
11
import org.eclipse.emf.ecore.EObject;
12
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
13
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
14
import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
15
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
16
import org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.ModelingAssistantProvider;
17
import org.eclipse.gmf.runtime.notation.Diagram;
18
import org.eclipse.jface.viewers.ILabelProvider;
19
import org.eclipse.jface.window.Window;
20
import org.eclipse.swt.widgets.Display;
21
import org.eclipse.swt.widgets.Shell;
22
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
23
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClass2EditPart;
24
import org.eclipse.uml2.diagram.clazz.edit.parts.Class2EditPart;
25
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintEditPart;
26
import org.eclipse.uml2.diagram.clazz.edit.parts.DataType2EditPart;
27
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyEditPart;
28
import org.eclipse.uml2.diagram.clazz.edit.parts.Enumeration2EditPart;
29
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecification2EditPart;
30
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceEditPart;
31
import org.eclipse.uml2.diagram.clazz.edit.parts.Package2EditPart;
32
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
33
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveType2EditPart;
34
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
35
36
/**
37
 * @generated
38
 */
39
public class UMLModelingAssistantProvider extends ModelingAssistantProvider {
40
41
	/**
42
	 * @generated
43
	 */
44
	public List getTypesForPopupBar(IAdaptable host) {
45
		IGraphicalEditPart editPart = (IGraphicalEditPart) host.getAdapter(IGraphicalEditPart.class);
46
		if (editPart instanceof Package2EditPart) {
47
			List types = new ArrayList();
48
			types.add(UMLElementTypes.Package_3006);
49
			types.add(UMLElementTypes.Class_3007);
50
			types.add(UMLElementTypes.DataType_3008);
51
			types.add(UMLElementTypes.PrimitiveType_3009);
52
			types.add(UMLElementTypes.Enumeration_3011);
53
			types.add(UMLElementTypes.AssociationClass_3012);
54
			types.add(UMLElementTypes.InstanceSpecification_3013);
55
			return types;
56
		}
57
		if (editPart instanceof Class2EditPart) {
58
			List types = new ArrayList();
59
			types.add(UMLElementTypes.Port_3025);
60
			types.add(UMLElementTypes.Property_3001);
61
			types.add(UMLElementTypes.Operation_3002);
62
			types.add(UMLElementTypes.Class_3003);
63
			return types;
64
		}
65
		if (editPart instanceof AssociationClass2EditPart) {
66
			List types = new ArrayList();
67
			types.add(UMLElementTypes.Property_3019);
68
			types.add(UMLElementTypes.Operation_3020);
69
			types.add(UMLElementTypes.Class_3003);
70
			return types;
71
		}
72
		if (editPart instanceof DataType2EditPart) {
73
			List types = new ArrayList();
74
			types.add(UMLElementTypes.Property_3014);
75
			types.add(UMLElementTypes.Operation_3015);
76
			return types;
77
		}
78
		if (editPart instanceof PrimitiveType2EditPart) {
79
			List types = new ArrayList();
80
			types.add(UMLElementTypes.Property_3021);
81
			types.add(UMLElementTypes.Operation_3022);
82
			return types;
83
		}
84
		if (editPart instanceof Enumeration2EditPart) {
85
			List types = new ArrayList();
86
			types.add(UMLElementTypes.EnumerationLiteral_3016);
87
			types.add(UMLElementTypes.Property_3023);
88
			types.add(UMLElementTypes.Operation_3024);
89
			return types;
90
		}
91
		if (editPart instanceof ConstraintEditPart) {
92
			List types = new ArrayList();
93
			types.add(UMLElementTypes.LiteralString_3005);
94
			return types;
95
		}
96
		if (editPart instanceof InstanceSpecification2EditPart) {
97
			List types = new ArrayList();
98
			types.add(UMLElementTypes.Slot_3017);
99
			return types;
100
		}
101
		if (editPart instanceof PackageEditPart) {
102
			List types = new ArrayList();
103
			types.add(UMLElementTypes.Package_2002);
104
			types.add(UMLElementTypes.Class_2001);
105
			types.add(UMLElementTypes.AssociationClass_2007);
106
			types.add(UMLElementTypes.DataType_2004);
107
			types.add(UMLElementTypes.PrimitiveType_2005);
108
			types.add(UMLElementTypes.Enumeration_2003);
109
			types.add(UMLElementTypes.Interface_2010);
110
			types.add(UMLElementTypes.Constraint_2006);
111
			types.add(UMLElementTypes.InstanceSpecification_2008);
112
			types.add(UMLElementTypes.Dependency_2009);
113
			return types;
114
		}
115
		return Collections.EMPTY_LIST;
116
	}
117
118
	/**
119
	 * @generated
120
	 */
121
	public List getRelTypesOnSource(IAdaptable source) {
122
		IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
123
		if (sourceEditPart instanceof ConstraintEditPart) {
124
			List types = new ArrayList();
125
			types.add(UMLElementTypes.ConstraintConstrainedElement_4004);
126
			return types;
127
		}
128
		if (sourceEditPart instanceof DependencyEditPart) {
129
			List types = new ArrayList();
130
			types.add(UMLElementTypes.DependencySupplier_4006);
131
			types.add(UMLElementTypes.DependencyClient_4007);
132
			return types;
133
		}
134
		return Collections.EMPTY_LIST;
135
	}
136
137
	/**
138
	 * @generated
139
	 */
140
	public List getRelTypesOnTarget(IAdaptable target) {
141
		IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
142
		if (targetEditPart instanceof InterfaceEditPart) {
143
			List types = new ArrayList();
144
			types.add(UMLElementTypes.InterfaceRealization_4008);
145
			return types;
146
		}
147
		return Collections.EMPTY_LIST;
148
	}
149
150
	/**
151
	 * @generated
152
	 */
153
	public List getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
154
		IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
155
		IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
156
		if (sourceEditPart instanceof ConstraintEditPart) {
157
			List types = new ArrayList();
158
			return types;
159
		}
160
		if (sourceEditPart instanceof DependencyEditPart) {
161
			List types = new ArrayList();
162
			return types;
163
		}
164
		return Collections.EMPTY_LIST;
165
	}
166
167
	/**
168
	 * @generated
169
	 */
170
	public List getTypesForSource(IAdaptable target, IElementType relationshipType) {
171
		IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
172
		if (targetEditPart instanceof InterfaceEditPart) {
173
			List types = new ArrayList();
174
			return types;
175
		}
176
		return Collections.EMPTY_LIST;
177
	}
178
179
	/**
180
	 * @generated
181
	 */
182
	public List getTypesForTarget(IAdaptable source, IElementType relationshipType) {
183
		IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
184
		if (sourceEditPart instanceof ConstraintEditPart) {
185
			List types = new ArrayList();
186
			return types;
187
		}
188
		if (sourceEditPart instanceof DependencyEditPart) {
189
			List types = new ArrayList();
190
			return types;
191
		}
192
		return Collections.EMPTY_LIST;
193
	}
194
195
	/**
196
	 * @generated
197
	 */
198
	public EObject selectExistingElementForSource(IAdaptable target, IElementType relationshipType) {
199
		return selectExistingElement(target, getTypesForSource(target, relationshipType));
200
	}
201
202
	/**
203
	 * @generated
204
	 */
205
	public EObject selectExistingElementForTarget(IAdaptable source, IElementType relationshipType) {
206
		return selectExistingElement(source, getTypesForTarget(source, relationshipType));
207
	}
208
209
	/**
210
	 * @generated
211
	 */
212
	protected EObject selectExistingElement(IAdaptable host, Collection types) {
213
		if (types.isEmpty()) {
214
			return null;
215
		}
216
		IGraphicalEditPart editPart = (IGraphicalEditPart) host.getAdapter(IGraphicalEditPart.class);
217
		if (editPart == null) {
218
			return null;
219
		}
220
		Diagram diagram = (Diagram) editPart.getRoot().getContents().getModel();
221
		Collection elements = new HashSet();
222
		for (Iterator it = diagram.getElement().eAllContents(); it.hasNext();) {
223
			EObject element = (EObject) it.next();
224
			if (isApplicableElement(element, types)) {
225
				elements.add(element);
226
			}
227
		}
228
		if (elements.isEmpty()) {
229
			return null;
230
		}
231
		return selectElement((EObject[]) elements.toArray(new EObject[elements.size()]));
232
	}
233
234
	/**
235
	 * @generated
236
	 */
237
	protected boolean isApplicableElement(EObject element, Collection types) {
238
		IElementType type = ElementTypeRegistry.getInstance().getElementType(element);
239
		return types.contains(type);
240
	}
241
242
	/**
243
	 * @generated
244
	 */
245
	protected EObject selectElement(EObject[] elements) {
246
		Shell shell = Display.getCurrent().getActiveShell();
247
		ILabelProvider labelProvider = new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
248
		ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider);
249
		dialog.setMessage("Available domain model elements:");
250
		dialog.setTitle("Select domain model element");
251
		dialog.setMultipleSelection(false);
252
		dialog.setElements(elements);
253
		EObject selected = null;
254
		if (dialog.open() == Window.OK) {
255
			selected = (EObject) dialog.getFirstResult();
256
		}
257
		return selected;
258
	}
259
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/property/PropertyParser.java (+669 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. PropertyParser.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.property;
14
15
import java.io.*;
16
import org.eclipse.emf.ecore.EClass;
17
import org.eclipse.emf.ecore.EObject;
18
import org.eclipse.uml2.diagram.parser.*;
19
import org.eclipse.uml2.diagram.parser.lookup.LookupResolver;
20
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
21
import org.eclipse.uml2.uml.*;
22
23
public class PropertyParser extends ExternalParserBase implements PropertyParserConstants {
24
        private Property mySubject;
25
26
    private static class TypeLookupCallback implements LookupResolver.Callback {
27
        private final Property myProperty;
28
29
                public TypeLookupCallback(Property property){
30
                        myProperty = property;
31
        }
32
33
        public void lookupResolved(NamedElement resolution) {
34
                if (resolution instanceof Type){
35
                        myProperty.setType((Type)resolution);
36
                }
37
        }
38
    }
39
40
    public PropertyParser(){
41
        this(new StringReader(""));
42
    }
43
44
    public PropertyParser(LookupSuite lookup){
45
        this();
46
        setLookupSuite(lookup);
47
    }
48
49
        public EClass getSubjectClass(){
50
                return UMLPackage.eINSTANCE.getProperty();
51
        }
52
53
        public void parse(EObject target, String text) throws ExternalParserException {
54
                checkContext();
55
                ReInit(new StringReader(text));
56
                mySubject = (Property)target;
57
                Declaration();
58
                mySubject = null;
59
        }
60
61
        protected static int parseInt(Token t) throws ParseException {
62
                if (t.kind != PropertyParserConstants.INTEGER_LITERAL){
63
                        throw new IllegalStateException("Token: " + t + ", image: " + t.image);
64
                }
65
                try {
66
                        return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
67
                } catch (NumberFormatException e){
68
                        throw new ParseException("Not supported integer value:" + t.image);
69
                }
70
        }
71
72
  final public void Declaration() throws ParseException {
73
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
74
    case PLUS:
75
    case MINUS:
76
    case NUMBER_SIGN:
77
    case TILDE:
78
      Visibility();
79
      break;
80
    default:
81
      jj_la1[0] = jj_gen;
82
      ;
83
    }
84
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
85
    case SLASH:
86
      IsDerived();
87
      break;
88
    default:
89
      jj_la1[1] = jj_gen;
90
      ;
91
    }
92
    PropertyName();
93
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
94
    case COLON:
95
      PropertyType();
96
      break;
97
    default:
98
      jj_la1[2] = jj_gen;
99
      ;
100
    }
101
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
102
    case LBRACKET:
103
      Multiplicity();
104
      break;
105
    default:
106
      jj_la1[3] = jj_gen;
107
      ;
108
    }
109
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
110
    case EQUALS:
111
      DefaultValue();
112
      break;
113
    default:
114
      jj_la1[4] = jj_gen;
115
      ;
116
    }
117
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
118
    case LCURLY:
119
      PropertyModifiers();
120
      break;
121
    default:
122
      jj_la1[5] = jj_gen;
123
      ;
124
    }
125
    jj_consume_token(0);
126
  }
127
128
  final public void PropertyName() throws ParseException {
129
        String name;
130
    name = NameWithSpaces();
131
                mySubject.setName(name);
132
  }
133
134
  final public void Visibility() throws ParseException {
135
        VisibilityKind kind;
136
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
137
    case PLUS:
138
      jj_consume_token(PLUS);
139
                         kind = VisibilityKind.PUBLIC_LITERAL;
140
      break;
141
    case MINUS:
142
      jj_consume_token(MINUS);
143
                          kind = VisibilityKind.PRIVATE_LITERAL;
144
      break;
145
    case NUMBER_SIGN:
146
      jj_consume_token(NUMBER_SIGN);
147
                                kind = VisibilityKind.PROTECTED_LITERAL;
148
      break;
149
    case TILDE:
150
      jj_consume_token(TILDE);
151
                          kind = VisibilityKind.PACKAGE_LITERAL;
152
      break;
153
    default:
154
      jj_la1[6] = jj_gen;
155
      jj_consume_token(-1);
156
      throw new ParseException();
157
    }
158
                mySubject.setVisibility(kind);
159
  }
160
161
  final public void Multiplicity() throws ParseException {
162
    MultiplicityRange();
163
  }
164
165
/* XXX: Parse conflict in case of empty default value
166
void MultiplicityDesignator() :
167
{ }
168
{
169
	<LCURLY> 
170
	(
171
		( MultiplicityUnique() [ MultiplicityOrdered() ] ) 
172
		|
173
		( MultiplicityOrdered() [ MultiplicityUnique() ] ) 
174
	) 
175
	<RCURLY>
176
}
177
178
void MultiplicityUnique() :
179
{}
180
{
181
		<UNIQUE> { mySubject.setIsUnique(true); }
182
	|
183
		<NON_UNIQUE> { mySubject.setIsUnique(false); }	
184
}
185
186
void MultiplicityOrdered() :
187
{}
188
{
189
		<ORDERED> { mySubject.setIsOrdered(true); }
190
	|
191
		<UNORDERED> { mySubject.setIsOrdered(false); }
192
}
193
194
*/
195
196
/* XXX: ValueSpecification -- how to parse */
197
  final public void MultiplicityRange() throws ParseException {
198
        Token tLower = null;
199
        Token tUpper;
200
    jj_consume_token(LBRACKET);
201
    if (jj_2_1(2)) {
202
      tLower = jj_consume_token(INTEGER_LITERAL);
203
      jj_consume_token(DOT);
204
      jj_consume_token(DOT);
205
                                                                        mySubject.setLower(parseInt(tLower));
206
    } else {
207
      ;
208
    }
209
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
210
    case STAR:
211
      tUpper = jj_consume_token(STAR);
212
                                if (tLower == null){
213
                                        mySubject.setLower(0);
214
                                }
215
                                mySubject.setUpper(LiteralUnlimitedNatural.UNLIMITED);
216
      break;
217
    case INTEGER_LITERAL:
218
      tUpper = jj_consume_token(INTEGER_LITERAL);
219
                                if (tLower == null){
220
                                        mySubject.setLower(parseInt(tUpper));
221
                                }
222
                                mySubject.setUpper(parseInt(tUpper));
223
      break;
224
    default:
225
      jj_la1[7] = jj_gen;
226
      jj_consume_token(-1);
227
      throw new ParseException();
228
    }
229
    jj_consume_token(RBRACKET);
230
  }
231
232
  final public void IsDerived() throws ParseException {
233
    jj_consume_token(SLASH);
234
                  mySubject.setIsDerived(true);
235
  }
236
237
  final public void PropertyType() throws ParseException {
238
        String type;
239
    jj_consume_token(COLON);
240
    type = NameWithSpaces();
241
                                          applyLookup(Type.class, type, new TypeLookupCallback(mySubject));
242
  }
243
244
  final public String NameWithSpaces() throws ParseException {
245
        StringBuffer result = new StringBuffer();
246
        Token t;
247
    t = jj_consume_token(IDENTIFIER);
248
                                   result.append(t.image);
249
    label_1:
250
    while (true) {
251
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
252
      case IDENTIFIER:
253
        ;
254
        break;
255
      default:
256
        jj_la1[8] = jj_gen;
257
        break label_1;
258
      }
259
      t = jj_consume_token(IDENTIFIER);
260
                                     result.append(' '); result.append(t.image);
261
    }
262
                {if (true) return result.toString();}
263
    throw new Error("Missing return statement in function");
264
  }
265
266
  final public void DefaultValue() throws ParseException {
267
        Token t;
268
    jj_consume_token(EQUALS);
269
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
270
    case IDENTIFIER:
271
      t = jj_consume_token(IDENTIFIER);
272
      break;
273
    case INTEGER_LITERAL:
274
      t = jj_consume_token(INTEGER_LITERAL);
275
276
      break;
277
    default:
278
      jj_la1[9] = jj_gen;
279
      jj_consume_token(-1);
280
      throw new ParseException();
281
    }
282
                mySubject.setDefault(t.image);
283
  }
284
285
  final public void SimpleTokenPropertyModifier() throws ParseException {
286
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
287
    case READ_ONLY:
288
      jj_consume_token(READ_ONLY);
289
                              mySubject.setIsReadOnly(true);
290
      break;
291
    case UNION:
292
      jj_consume_token(UNION);
293
                          mySubject.setIsDerivedUnion(true);
294
      break;
295
    case ORDERED:
296
      jj_consume_token(ORDERED);
297
                            mySubject.setIsOrdered(true);
298
      break;
299
    case UNORDERED:
300
      jj_consume_token(UNORDERED);
301
                              mySubject.setIsOrdered(false);
302
      break;
303
    case UNIQUE:
304
      jj_consume_token(UNIQUE);
305
                           mySubject.setIsUnique(true);
306
      break;
307
    case NON_UNIQUE:
308
      jj_consume_token(NON_UNIQUE);
309
                               mySubject.setIsUnique(false);
310
      break;
311
    default:
312
      jj_la1[10] = jj_gen;
313
      jj_consume_token(-1);
314
      throw new ParseException();
315
    }
316
  }
317
318
  final public void ReferencingPropertyModifier() throws ParseException {
319
        String name;
320
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
321
    case SUBSETS:
322
      jj_consume_token(SUBSETS);
323
      name = NameWithSpaces();
324
                        Property subsets = lookup(Property.class, name);
325
                        if (subsets != null) {
326
                                mySubject.getSubsettedProperties().add(subsets);
327
                        }
328
      break;
329
    case REDEFINES:
330
      jj_consume_token(REDEFINES);
331
      name = NameWithSpaces();
332
                        RedefinableElement redefines = lookup(RedefinableElement.class, name);
333
                        if (redefines != null) {
334
                                mySubject.getRedefinedElements().add(redefines);
335
                        }
336
      break;
337
    default:
338
      jj_la1[11] = jj_gen;
339
      jj_consume_token(-1);
340
      throw new ParseException();
341
    }
342
  }
343
344
  final public void PropertyModifiers() throws ParseException {
345
    jj_consume_token(LCURLY);
346
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
347
    case READ_ONLY:
348
    case UNION:
349
    case ORDERED:
350
    case UNORDERED:
351
    case UNIQUE:
352
    case NON_UNIQUE:
353
      SimpleTokenPropertyModifier();
354
      break;
355
    case SUBSETS:
356
    case REDEFINES:
357
      ReferencingPropertyModifier();
358
      break;
359
    default:
360
      jj_la1[12] = jj_gen;
361
      jj_consume_token(-1);
362
      throw new ParseException();
363
    }
364
    label_2:
365
    while (true) {
366
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
367
      case COMMA:
368
        ;
369
        break;
370
      default:
371
        jj_la1[13] = jj_gen;
372
        break label_2;
373
      }
374
      jj_consume_token(COMMA);
375
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
376
      case READ_ONLY:
377
      case UNION:
378
      case ORDERED:
379
      case UNORDERED:
380
      case UNIQUE:
381
      case NON_UNIQUE:
382
        SimpleTokenPropertyModifier();
383
        break;
384
      case SUBSETS:
385
      case REDEFINES:
386
        ReferencingPropertyModifier();
387
        break;
388
      default:
389
        jj_la1[14] = jj_gen;
390
        jj_consume_token(-1);
391
        throw new ParseException();
392
      }
393
    }
394
    jj_consume_token(RCURLY);
395
  }
396
397
  final private boolean jj_2_1(int xla) {
398
    jj_la = xla; jj_lastpos = jj_scanpos = token;
399
    try { return !jj_3_1(); }
400
    catch(LookaheadSuccess ls) { return true; }
401
    finally { jj_save(0, xla); }
402
  }
403
404
  final private boolean jj_3_1() {
405
    if (jj_scan_token(INTEGER_LITERAL)) return true;
406
    if (jj_scan_token(DOT)) return true;
407
    return false;
408
  }
409
410
  public PropertyParserTokenManager token_source;
411
  JavaCharStream jj_input_stream;
412
  public Token token, jj_nt;
413
  private int jj_ntk;
414
  private Token jj_scanpos, jj_lastpos;
415
  private int jj_la;
416
  public boolean lookingAhead = false;
417
  private boolean jj_semLA;
418
  private int jj_gen;
419
  final private int[] jj_la1 = new int[15];
420
  static private int[] jj_la1_0;
421
  static {
422
      jj_la1_0();
423
   }
424
   private static void jj_la1_0() {
425
      jj_la1_0 = new int[] {0x7800,0x8,0x10,0x40,0x20,0x100,0x7800,0x2010000,0x4000000,0x6000000,0x1e60000,0x180000,0x1fe0000,0x400,0x1fe0000,};
426
   }
427
  final private JJCalls[] jj_2_rtns = new JJCalls[1];
428
  private boolean jj_rescan = false;
429
  private int jj_gc = 0;
430
431
  public PropertyParser(java.io.InputStream stream) {
432
    jj_input_stream = new JavaCharStream(stream, 1, 1);
433
    token_source = new PropertyParserTokenManager(jj_input_stream);
434
    token = new Token();
435
    jj_ntk = -1;
436
    jj_gen = 0;
437
    for (int i = 0; i < 15; i++) jj_la1[i] = -1;
438
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
439
  }
440
441
  public void ReInit(java.io.InputStream stream) {
442
    jj_input_stream.ReInit(stream, 1, 1);
443
    token_source.ReInit(jj_input_stream);
444
    token = new Token();
445
    jj_ntk = -1;
446
    jj_gen = 0;
447
    for (int i = 0; i < 15; i++) jj_la1[i] = -1;
448
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
449
  }
450
451
  public PropertyParser(java.io.Reader stream) {
452
    jj_input_stream = new JavaCharStream(stream, 1, 1);
453
    token_source = new PropertyParserTokenManager(jj_input_stream);
454
    token = new Token();
455
    jj_ntk = -1;
456
    jj_gen = 0;
457
    for (int i = 0; i < 15; i++) jj_la1[i] = -1;
458
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
459
  }
460
461
  public void ReInit(java.io.Reader stream) {
462
    jj_input_stream.ReInit(stream, 1, 1);
463
    token_source.ReInit(jj_input_stream);
464
    token = new Token();
465
    jj_ntk = -1;
466
    jj_gen = 0;
467
    for (int i = 0; i < 15; i++) jj_la1[i] = -1;
468
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
469
  }
470
471
  public PropertyParser(PropertyParserTokenManager tm) {
472
    token_source = tm;
473
    token = new Token();
474
    jj_ntk = -1;
475
    jj_gen = 0;
476
    for (int i = 0; i < 15; i++) jj_la1[i] = -1;
477
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
478
  }
479
480
  public void ReInit(PropertyParserTokenManager tm) {
481
    token_source = tm;
482
    token = new Token();
483
    jj_ntk = -1;
484
    jj_gen = 0;
485
    for (int i = 0; i < 15; i++) jj_la1[i] = -1;
486
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
487
  }
488
489
  final private Token jj_consume_token(int kind) throws ParseException {
490
    Token oldToken;
491
    if ((oldToken = token).next != null) token = token.next;
492
    else token = token.next = token_source.getNextToken();
493
    jj_ntk = -1;
494
    if (token.kind == kind) {
495
      jj_gen++;
496
      if (++jj_gc > 100) {
497
        jj_gc = 0;
498
        for (int i = 0; i < jj_2_rtns.length; i++) {
499
          JJCalls c = jj_2_rtns[i];
500
          while (c != null) {
501
            if (c.gen < jj_gen) c.first = null;
502
            c = c.next;
503
          }
504
        }
505
      }
506
      return token;
507
    }
508
    token = oldToken;
509
    jj_kind = kind;
510
    throw generateParseException();
511
  }
512
513
  static private final class LookaheadSuccess extends java.lang.Error { }
514
  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
515
  final private boolean jj_scan_token(int kind) {
516
    if (jj_scanpos == jj_lastpos) {
517
      jj_la--;
518
      if (jj_scanpos.next == null) {
519
        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
520
      } else {
521
        jj_lastpos = jj_scanpos = jj_scanpos.next;
522
      }
523
    } else {
524
      jj_scanpos = jj_scanpos.next;
525
    }
526
    if (jj_rescan) {
527
      int i = 0; Token tok = token;
528
      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
529
      if (tok != null) jj_add_error_token(kind, i);
530
    }
531
    if (jj_scanpos.kind != kind) return true;
532
    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
533
    return false;
534
  }
535
536
  final public Token getNextToken() {
537
    if (token.next != null) token = token.next;
538
    else token = token.next = token_source.getNextToken();
539
    jj_ntk = -1;
540
    jj_gen++;
541
    return token;
542
  }
543
544
  final public Token getToken(int index) {
545
    Token t = lookingAhead ? jj_scanpos : token;
546
    for (int i = 0; i < index; i++) {
547
      if (t.next != null) t = t.next;
548
      else t = t.next = token_source.getNextToken();
549
    }
550
    return t;
551
  }
552
553
  final private int jj_ntk() {
554
    if ((jj_nt=token.next) == null)
555
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
556
    else
557
      return (jj_ntk = jj_nt.kind);
558
  }
559
560
  private java.util.Vector jj_expentries = new java.util.Vector();
561
  private int[] jj_expentry;
562
  private int jj_kind = -1;
563
  private int[] jj_lasttokens = new int[100];
564
  private int jj_endpos;
565
566
  private void jj_add_error_token(int kind, int pos) {
567
    if (pos >= 100) return;
568
    if (pos == jj_endpos + 1) {
569
      jj_lasttokens[jj_endpos++] = kind;
570
    } else if (jj_endpos != 0) {
571
      jj_expentry = new int[jj_endpos];
572
      for (int i = 0; i < jj_endpos; i++) {
573
        jj_expentry[i] = jj_lasttokens[i];
574
      }
575
      boolean exists = false;
576
      for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
577
        int[] oldentry = (int[])(e.nextElement());
578
        if (oldentry.length == jj_expentry.length) {
579
          exists = true;
580
          for (int i = 0; i < jj_expentry.length; i++) {
581
            if (oldentry[i] != jj_expentry[i]) {
582
              exists = false;
583
              break;
584
            }
585
          }
586
          if (exists) break;
587
        }
588
      }
589
      if (!exists) jj_expentries.addElement(jj_expentry);
590
      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
591
    }
592
  }
593
594
  public ParseException generateParseException() {
595
    jj_expentries.removeAllElements();
596
    boolean[] la1tokens = new boolean[29];
597
    for (int i = 0; i < 29; i++) {
598
      la1tokens[i] = false;
599
    }
600
    if (jj_kind >= 0) {
601
      la1tokens[jj_kind] = true;
602
      jj_kind = -1;
603
    }
604
    for (int i = 0; i < 15; i++) {
605
      if (jj_la1[i] == jj_gen) {
606
        for (int j = 0; j < 32; j++) {
607
          if ((jj_la1_0[i] & (1<<j)) != 0) {
608
            la1tokens[j] = true;
609
          }
610
        }
611
      }
612
    }
613
    for (int i = 0; i < 29; i++) {
614
      if (la1tokens[i]) {
615
        jj_expentry = new int[1];
616
        jj_expentry[0] = i;
617
        jj_expentries.addElement(jj_expentry);
618
      }
619
    }
620
    jj_endpos = 0;
621
    jj_rescan_token();
622
    jj_add_error_token(0, 0);
623
    int[][] exptokseq = new int[jj_expentries.size()][];
624
    for (int i = 0; i < jj_expentries.size(); i++) {
625
      exptokseq[i] = (int[])jj_expentries.elementAt(i);
626
    }
627
    return new ParseException(token, exptokseq, tokenImage);
628
  }
629
630
  final public void enable_tracing() {
631
  }
632
633
  final public void disable_tracing() {
634
  }
635
636
  final private void jj_rescan_token() {
637
    jj_rescan = true;
638
    for (int i = 0; i < 1; i++) {
639
      JJCalls p = jj_2_rtns[i];
640
      do {
641
        if (p.gen > jj_gen) {
642
          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
643
          switch (i) {
644
            case 0: jj_3_1(); break;
645
          }
646
        }
647
        p = p.next;
648
      } while (p != null);
649
    }
650
    jj_rescan = false;
651
  }
652
653
  final private void jj_save(int index, int xla) {
654
    JJCalls p = jj_2_rtns[index];
655
    while (p.gen > jj_gen) {
656
      if (p.next == null) { p = p.next = new JJCalls(); break; }
657
      p = p.next;
658
    }
659
    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
660
  }
661
662
  static final class JJCalls {
663
    int gen;
664
    Token first;
665
    int arg;
666
    JJCalls next;
667
  }
668
669
}
(-)icons/linkTargetNavigatorGroup.gif (+5 lines)
Added Link Here
1
GIF89aÕÿÿ­r/‚GøØˆžf'øÐxøà˜øÐ€f>2èÆ”øè°èЈøðÈÿÿÿË6úöºøà øØ?Œ]Føè˜Ò«€üößãϹ´2àÀx­r+ðØ?¥l$yO@ž_­l$?R¼2ï߯¼…2Å6!ù,s@€pH,?È#âèh:‚¨T0ô4®
2
‹à‘?p©€Ñd¢Y`B‚¡‹p8G AØ%‚%HÁçW¶	_B†‰Š‹?’“’š??–B¥¦¥ B­®­©C³´µI·¸FA;Content-Type: image/gif
3
4
GIF89aÕÿÿ­r/‚GøØˆžf'øÐxøà˜øÐ€f>2èÆ”øè°èЈøðÈÿÿÿË6úöºøà øØ?Œ]Føè˜Ò«€üößãϹ´2àÀx­r+ðØ?¥l$yO@ž_­l$?R¼2ï߯¼…2Å6!ù,s@€pH,?È#âèh:‚¨T0ô4®
5
‹à‘?p©€Ñd¢Y`B‚¡‹p8G AØ%‚%HÁçW¶	_B†‰Š‹?’“’š??–B¥¦¥ B­®­©C³´µI·¸FA;
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLDiagramPreferenceInitializer.java (+17 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import org.eclipse.gmf.runtime.diagram.ui.preferences.DiagramPreferenceInitializer;
4
import org.eclipse.jface.preference.IPreferenceStore;
5
6
/**
7
 * @generated
8
 */
9
public class UMLDiagramPreferenceInitializer extends DiagramPreferenceInitializer {
10
11
	/**
12
	 * @generated
13
	 */
14
	protected IPreferenceStore getPreferenceStore() {
15
		return org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
16
	}
17
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/ConstraintConstrainedElementEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class ConstraintConstrainedElementEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationName3ViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class AssociationName3ViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(-15));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/DependencyName2ViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class DependencyName2ViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(40));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/EnumerationLiteralViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class EnumerationLiteralViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationLiteralEditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/PropertyEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class PropertyEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/property/ParseException.java (+194 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
2
package org.eclipse.uml2.diagram.clazz.parser.property;
3
4
import org.eclipse.uml2.diagram.parser.ExternalParserException;
5
6
/**
7
 * This exception is thrown when parse errors are encountered.
8
 * You can explicitly create objects of this exception type by
9
 * calling the method generateParseException in the generated
10
 * parser.
11
 *
12
 * You can modify this class to customize your error reporting
13
 * mechanisms so long as you retain the public fields.
14
 */
15
class ParseException extends ExternalParserException {
16
17
  /**
18
   * This constructor is used by the method "generateParseException"
19
   * in the generated parser.  Calling this constructor generates
20
   * a new object of this type with the fields "currentToken",
21
   * "expectedTokenSequences", and "tokenImage" set.  The boolean
22
   * flag "specialConstructor" is also set to true to indicate that
23
   * this constructor was used to create this object.
24
   * This constructor calls its super class with the empty string
25
   * to force the "toString" method of parent class "Throwable" to
26
   * print the error message in the form:
27
   *     ParseException: <result of getMessage>
28
   */
29
  public ParseException(Token currentTokenVal,
30
                        int[][] expectedTokenSequencesVal,
31
                        String[] tokenImageVal
32
                       )
33
  {
34
    super("");
35
    specialConstructor = true;
36
    currentToken = currentTokenVal;
37
    expectedTokenSequences = expectedTokenSequencesVal;
38
    tokenImage = tokenImageVal;
39
  }
40
41
  /**
42
   * The following constructors are for use by you for whatever
43
   * purpose you can think of.  Constructing the exception in this
44
   * manner makes the exception behave in the normal way - i.e., as
45
   * documented in the class "Throwable".  The fields "errorToken",
46
   * "expectedTokenSequences", and "tokenImage" do not contain
47
   * relevant information.  The JavaCC generated code does not use
48
   * these constructors.
49
   */
50
51
  public ParseException() {
52
    super();
53
    specialConstructor = false;
54
  }
55
56
  public ParseException(String message) {
57
    super(message);
58
    specialConstructor = false;
59
  }
60
61
  /**
62
   * This variable determines which constructor was used to create
63
   * this object and thereby affects the semantics of the
64
   * "getMessage" method (see below).
65
   */
66
  protected boolean specialConstructor;
67
68
  /**
69
   * This is the last token that has been consumed successfully.  If
70
   * this object has been created due to a parse error, the token
71
   * followng this token will (therefore) be the first error token.
72
   */
73
  public Token currentToken;
74
75
  /**
76
   * Each entry in this array is an array of integers.  Each array
77
   * of integers represents a sequence of tokens (by their ordinal
78
   * values) that is expected at this point of the parse.
79
   */
80
  public int[][] expectedTokenSequences;
81
82
  /**
83
   * This is a reference to the "tokenImage" array of the generated
84
   * parser within which the parse error occurred.  This array is
85
   * defined in the generated ...Constants interface.
86
   */
87
  public String[] tokenImage;
88
89
  /**
90
   * This method has the standard behavior when this object has been
91
   * created using the standard constructors.  Otherwise, it uses
92
   * "currentToken" and "expectedTokenSequences" to generate a parse
93
   * error message and returns it.  If this object has been created
94
   * due to a parse error, and you do not catch it (it gets thrown
95
   * from the parser), then this method is called during the printing
96
   * of the final stack trace, and hence the correct error message
97
   * gets displayed.
98
   */
99
  public String getMessage() {
100
    if (!specialConstructor) {
101
      return super.getMessage();
102
    }
103
    String expected = "";
104
    int maxSize = 0;
105
    for (int i = 0; i < expectedTokenSequences.length; i++) {
106
      if (maxSize < expectedTokenSequences[i].length) {
107
        maxSize = expectedTokenSequences[i].length;
108
      }
109
      for (int j = 0; j < expectedTokenSequences[i].length; j++) {
110
        expected += tokenImage[expectedTokenSequences[i][j]] + " ";
111
      }
112
      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
113
        expected += "...";
114
      }
115
      expected += eol + "    ";
116
    }
117
    String retval = "Encountered \"";
118
    Token tok = currentToken.next;
119
    for (int i = 0; i < maxSize; i++) {
120
      if (i != 0) retval += " ";
121
      if (tok.kind == 0) {
122
        retval += tokenImage[0];
123
        break;
124
      }
125
      retval += add_escapes(tok.image);
126
      tok = tok.next; 
127
    }
128
    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
129
    retval += "." + eol;
130
    if (expectedTokenSequences.length == 1) {
131
      retval += "Was expecting:" + eol + "    ";
132
    } else {
133
      retval += "Was expecting one of:" + eol + "    ";
134
    }
135
    retval += expected;
136
    return retval;
137
  }
138
139
  /**
140
   * The end of line string for this machine.
141
   */
142
  protected String eol = System.getProperty("line.separator", "\n");
143
 
144
  /**
145
   * Used to convert raw characters to their escaped version
146
   * when these raw version cannot be used as part of an ASCII
147
   * string literal.
148
   */
149
  protected String add_escapes(String str) {
150
      StringBuffer retval = new StringBuffer();
151
      char ch;
152
      for (int i = 0; i < str.length(); i++) {
153
        switch (str.charAt(i))
154
        {
155
           case 0 :
156
              continue;
157
           case '\b':
158
              retval.append("\\b");
159
              continue;
160
           case '\t':
161
              retval.append("\\t");
162
              continue;
163
           case '\n':
164
              retval.append("\\n");
165
              continue;
166
           case '\f':
167
              retval.append("\\f");
168
              continue;
169
           case '\r':
170
              retval.append("\\r");
171
              continue;
172
           case '\"':
173
              retval.append("\\\"");
174
              continue;
175
           case '\'':
176
              retval.append("\\\'");
177
              continue;
178
           case '\\':
179
              retval.append("\\\\");
180
              continue;
181
           default:
182
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
183
                 String s = "0000" + Integer.toString(ch, 16);
184
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
185
              } else {
186
                 retval.append(ch);
187
              }
188
              continue;
189
        }
190
      }
191
      return retval.toString();
192
   }
193
194
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/ConstraintCompartmentViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class ConstraintCompartmentViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintCompartmentEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/UMLBaseEditHelper.java (+68 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
4
import org.eclipse.gmf.runtime.common.core.command.ICommand;
5
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper;
6
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
7
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
8
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
9
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
10
import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
11
12
/**
13
 * @generated
14
 */
15
public class UMLBaseEditHelper extends AbstractEditHelper {
16
17
	/**
18
	 * @generated
19
	 */
20
	public static final String EDIT_POLICY_COMMAND = "edit policy command"; //$NON-NLS-1$
21
22
	/**
23
	 * @generated
24
	 */
25
	protected ICommand getInsteadCommand(IEditCommandRequest req) {
26
		ICommand epCommand = (ICommand) req.getParameter(EDIT_POLICY_COMMAND);
27
		req.setParameter(EDIT_POLICY_COMMAND, null);
28
		ICommand ehCommand = super.getInsteadCommand(req);
29
		if (epCommand == null) {
30
			return ehCommand;
31
		}
32
		if (ehCommand == null) {
33
			return epCommand;
34
		}
35
		CompositeCommand command = new CompositeCommand(null);
36
		command.add(epCommand);
37
		command.add(ehCommand);
38
		return command;
39
	}
40
41
	/**
42
	 * @generated
43
	 */
44
	protected ICommand getCreateCommand(CreateElementRequest req) {
45
		return null;
46
	}
47
48
	/**
49
	 * @generated
50
	 */
51
	protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req) {
52
		return null;
53
	}
54
55
	/**
56
	 * @generated
57
	 */
58
	protected ICommand getDestroyElementCommand(DestroyElementRequest req) {
59
		return null;
60
	}
61
62
	/**
63
	 * @generated
64
	 */
65
	protected ICommand getDestroyReferenceCommand(DestroyReferenceRequest req) {
66
		return null;
67
	}
68
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/end/AssociationEndToString.java (+189 lines)
Added Link Here
1
/*
2
 * Copyright (c) 2006 Borland Software Corporation
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    Michael Golubev (Borland) - initial API and implementation
11
 */
12
13
package org.eclipse.uml2.diagram.clazz.parser.association.end;
14
15
import java.util.Arrays;
16
import java.util.LinkedList;
17
import java.util.List;
18
19
import org.eclipse.emf.ecore.EObject;
20
import org.eclipse.emf.ecore.EStructuralFeature;
21
import org.eclipse.uml2.diagram.clazz.association.AssociationEndConvention;
22
import org.eclipse.uml2.diagram.clazz.parser.property.PropertyToString;
23
import org.eclipse.uml2.diagram.parser.ExternalToString;
24
import org.eclipse.uml2.uml.Association;
25
import org.eclipse.uml2.uml.Property;
26
import org.eclipse.uml2.uml.TypedElement;
27
import org.eclipse.uml2.uml.UMLPackage;
28
import org.eclipse.uml2.uml.ValueSpecification;
29
30
public abstract class AssociationEndToString extends PropertyToString {
31
	private final boolean mySourceNotTarget;
32
33
	public AssociationEndToString(boolean sourceNotTarget){
34
		mySourceNotTarget = sourceNotTarget;
35
	}
36
	
37
	@Override
38
	protected Property asProperty(EObject object) {
39
		return asProperty(object, mySourceNotTarget);
40
	}
41
	
42
	protected static Property asProperty(EObject object, boolean sourceNotTarget) {
43
		if (false == object instanceof Association){
44
			throw new IllegalStateException("I can not provide toString for: " + object);
45
		}
46
		Association association = (Association)object;
47
		if (!association.isBinary()){
48
			throw new IllegalStateException("I can not provide toString for not binary association: " + object);
49
		}
50
		return AssociationEndConvention.getMemberEnd(association, sourceNotTarget);
51
	}
52
53
	/**
54
	 * NOTE: it DOES NOT extends enclosing AssociationEndToString
55
	 */
56
	public static class EDIT extends PropertyToString.EDIT {
57
		private final boolean myIsSource;
58
59
		public EDIT(boolean isSource){
60
			myIsSource = isSource;
61
		}
62
		
63
		@Override
64
		protected void appendType(StringBuffer result, TypedElement typedElement) {
65
			//no types for association ends
66
			//thus, do nothing
67
		}
68
		
69
		@Override
70
		protected void appendDefault(StringBuffer result, Property property) {
71
			//no defaults for association ends
72
			//again, do nothing
73
		}
74
		
75
		protected Property asProperty(EObject object) {
76
			return AssociationEndToString.asProperty(object, myIsSource);
77
		}
78
	}
79
	
80
	public static class ROLE_VIEW extends AssociationEndToString implements ExternalToString.WithReferences {
81
		public ROLE_VIEW(boolean sourceNotTarget){
82
			super(sourceNotTarget);
83
		}
84
		
85
		private static final List AFFECTING = Arrays.asList(new EStructuralFeature[] {
86
			UMLPackage.eINSTANCE.getNamedElement_Visibility(),
87
			UMLPackage.eINSTANCE.getProperty_IsDerived(),		
88
			UMLPackage.eINSTANCE.getNamedElement_Name(),
89
		});
90
		
91
		public String getToString(EObject object, int flags) {
92
			Property property = asProperty(object);
93
			StringBuffer result = new StringBuffer();
94
			result.append(getVisibility(property));
95
			result.append(getIsDerived(property));
96
			result.append(property.getName());
97
			return result.toString();
98
		}
99
		
100
		public boolean isAffectingFeature(EStructuralFeature feature) {
101
			return AFFECTING.contains(feature);
102
		}
103
		
104
		public List getAdditionalReferencedElements(EObject object) {
105
			Property property = asProperty(object);
106
			List result = new LinkedList();
107
			result.add(property);
108
			return result;
109
		}
110
	}
111
	
112
	public static class MULTIPLICITY_VIEW extends AssociationEndToString implements ExternalToString.WithReferences {
113
		
114
		public MULTIPLICITY_VIEW(boolean sourceNotTarget){
115
			super(sourceNotTarget);
116
		}
117
		
118
		private static final List AFFECTING = Arrays.asList(new EStructuralFeature[] {
119
				UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue(),
120
				UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue(),
121
				UMLPackage.eINSTANCE.getLiteralUnlimitedNatural_Value(), 
122
				UMLPackage.eINSTANCE.getLiteralInteger_Value(),
123
				UMLPackage.eINSTANCE.getLiteralString_Value(),
124
			});
125
			
126
		public String getToString(EObject object, int flags) {
127
			Property property = asProperty(object);
128
			StringBuffer result = new StringBuffer();
129
			appendMultiplicity(result, property);
130
			return result.toString();
131
		}
132
		
133
		public boolean isAffectingFeature(EStructuralFeature feature) {
134
			return AFFECTING.contains(feature);
135
		}
136
		
137
		public List getAdditionalReferencedElements(EObject object) {
138
			Property property = asProperty(object);
139
			List result = new LinkedList();
140
			result.add(property);
141
			ValueSpecification upper = property.getUpperValue();
142
			if (upper != null){
143
				result.add(upper);
144
			}
145
			ValueSpecification lower = property.getLowerValue();
146
			if (lower != null){
147
				result.add(lower);
148
			}
149
			return result;
150
		}
151
	}
152
	
153
	public static class MODIFIERS_VIEW extends AssociationEndToString implements ExternalToString.WithReferences {
154
		public MODIFIERS_VIEW(boolean sourceNotTarget){
155
			super(sourceNotTarget);
156
		}
157
				
158
		private static final List AFFECTING = Arrays.asList(new EStructuralFeature[] {
159
				UMLPackage.eINSTANCE.getMultiplicityElement_IsOrdered(),
160
				UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique(),
161
				UMLPackage.eINSTANCE.getProperty_IsDerivedUnion(),
162
				UMLPackage.eINSTANCE.getProperty_SubsettedProperty(), 
163
				UMLPackage.eINSTANCE.getRedefinableElement_RedefinedElement(),
164
				UMLPackage.eINSTANCE.getNamedElement_Name(),
165
			});
166
		
167
		public boolean isAffectingFeature(EStructuralFeature feature) {
168
			return AFFECTING.contains(feature);
169
		}
170
		
171
		public String getToString(EObject object, int flags) {
172
			Property property = asProperty(object);
173
			StringBuffer result = new StringBuffer();
174
			appendPropertyModifiers(result, property);
175
			return result.toString();
176
		}
177
		
178
		public List getAdditionalReferencedElements(EObject object) {
179
			Property property = asProperty(object);
180
			List result = new LinkedList();
181
			result.add(property);
182
			result.addAll(property.getSubsettedProperties());
183
			result.addAll(property.getRedefinedElements());
184
			return result;
185
		}
186
		
187
		
188
	}
189
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Operation3ViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class Operation3ViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Operation3EditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/association/AssociationEndConvention.java (+30 lines)
Added Link Here
1
/*
2
 * Copyright (c) 2006 Borland Software Corporation
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    Michael Golubev (Borland) - initial API and implementation
11
 */
12
13
package org.eclipse.uml2.diagram.clazz.association;
14
15
import org.eclipse.uml2.uml.Association;
16
import org.eclipse.uml2.uml.Property;
17
18
public class AssociationEndConvention {
19
	public static Property getMemberEnd(Association association, boolean sourceNotTarget){
20
		return (Property)association.getMemberEnds().get(sourceNotTarget ? 0 : 1);
21
	}
22
	
23
	public static Property getSourceEnd(Association association){
24
		return getMemberEnd(association, true);
25
	}
26
27
	public static Property getTargetEnd(Association association){
28
		return getMemberEnd(association, false);
29
	}
30
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationClassViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class AssociationClassViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassEditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLDiagramEditorPlugin.java (+219 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IPath;
7
import org.eclipse.core.runtime.IStatus;
8
import org.eclipse.core.runtime.Path;
9
import org.eclipse.core.runtime.Status;
10
import org.eclipse.emf.common.notify.AdapterFactory;
11
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
12
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
13
import org.eclipse.emf.edit.provider.IItemLabelProvider;
14
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
15
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
16
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
17
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
18
import org.eclipse.jface.resource.ImageDescriptor;
19
import org.eclipse.swt.graphics.Image;
20
import org.eclipse.ui.plugin.AbstractUIPlugin;
21
import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
22
import org.osgi.framework.BundleContext;
23
24
/**
25
 * @generated
26
 */
27
public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
28
29
	/**
30
	 * @generated
31
	 */
32
	public static final String ID = "org.eclipse.uml2.diagram.clazz"; //$NON-NLS-1$
33
34
	/**
35
	 * @generated
36
	 */
37
	public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID);
38
39
	/**
40
	 * @generated
41
	 */
42
	private static UMLDiagramEditorPlugin instance;
43
44
	/**
45
	 * @generated
46
	 */
47
	private ComposedAdapterFactory adapterFactory;
48
49
	/**
50
	 * @generated
51
	 */
52
	public UMLDiagramEditorPlugin() {
53
	}
54
55
	/**
56
	 * @generated
57
	 */
58
	public void start(BundleContext context) throws Exception {
59
		super.start(context);
60
		instance = this;
61
		PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
62
		adapterFactory = createAdapterFactory();
63
	}
64
65
	/**
66
	 * @generated
67
	 */
68
	public void stop(BundleContext context) throws Exception {
69
		adapterFactory.dispose();
70
		adapterFactory = null;
71
		instance = null;
72
		super.stop(context);
73
	}
74
75
	/**
76
	 * @generated
77
	 */
78
	public static UMLDiagramEditorPlugin getInstance() {
79
		return instance;
80
	}
81
82
	/**
83
	 * @generated
84
	 */
85
	protected ComposedAdapterFactory createAdapterFactory() {
86
		List factories = new ArrayList();
87
		fillItemProviderFactories(factories);
88
		return new ComposedAdapterFactory(factories);
89
	}
90
91
	/**
92
	 * @generated
93
	 */
94
	protected void fillItemProviderFactories(List factories) {
95
		factories.add(new UMLItemProviderAdapterFactory());
96
		factories.add(new EcoreItemProviderAdapterFactory());
97
		factories.add(new ResourceItemProviderAdapterFactory());
98
		factories.add(new ReflectiveItemProviderAdapterFactory());
99
	}
100
101
	/**
102
	 * @generated
103
	 */
104
	public AdapterFactory getItemProvidersAdapterFactory() {
105
		return adapterFactory;
106
	}
107
108
	/**
109
	 * @generated
110
	 */
111
	public ImageDescriptor getItemImageDescriptor(Object item) {
112
		IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory.adapt(item, IItemLabelProvider.class);
113
		if (labelProvider != null) {
114
			return ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(item));
115
		}
116
		return null;
117
	}
118
119
	/**
120
	 * Returns an image descriptor for the image file at the given
121
	 * plug-in relative path.
122
	 *
123
	 * @generated
124
	 * @param path the path
125
	 * @return the image descriptor
126
	 */
127
	public static ImageDescriptor getBundledImageDescriptor(String path) {
128
		return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
129
	}
130
131
	/**
132
	 * Respects images residing in any plug-in. If path is relative,
133
	 * then this bundle is looked up for the image, otherwise, for absolute 
134
	 * path, first segment is taken as id of plug-in with image
135
	 *
136
	 * @generated
137
	 * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
138
	 * @return the image descriptor
139
	 */
140
	public static ImageDescriptor findImageDescriptor(String path) {
141
		final IPath p = new Path(path);
142
		if (p.isAbsolute() && p.segmentCount() > 1) {
143
			return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p.removeFirstSegments(1).makeAbsolute().toString());
144
		} else {
145
			return getBundledImageDescriptor(p.makeAbsolute().toString());
146
		}
147
	}
148
149
	/**
150
	 * Returns an image for the image file at the given plug-in relative path.
151
	 * Client do not need to dispose this image. Images will be disposed automatically.
152
	 *
153
	 * @generated
154
	 * @param path the path
155
	 * @return image instance
156
	 */
157
	public Image getBundledImage(String path) {
158
		Image image = getImageRegistry().get(path);
159
		if (image == null) {
160
			getImageRegistry().put(path, getBundledImageDescriptor(path));
161
			image = getImageRegistry().get(path);
162
		}
163
		return image;
164
	}
165
166
	/**
167
	 * @generated
168
	 */
169
	public void logError(String error) {
170
		logError(error, null);
171
	}
172
173
	/**
174
	 * @param throwable actual error or null could be passed
175
	 * @generated
176
	 */
177
	public void logError(String error, Throwable throwable) {
178
		if (error == null && throwable != null) {
179
			error = throwable.getMessage();
180
		}
181
		getLog().log(new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, IStatus.OK, error, throwable));
182
		debug(error, throwable);
183
	}
184
185
	/**
186
	 * @generated
187
	 */
188
	public void logInfo(String message) {
189
		logInfo(message, null);
190
	}
191
192
	/**
193
	 * @param throwable actual error or null could be passed
194
	 * @generated
195
	 */
196
	public void logInfo(String message, Throwable throwable) {
197
		if (message == null && throwable != null) {
198
			message = throwable.getMessage();
199
		}
200
		getLog().log(new Status(IStatus.INFO, UMLDiagramEditorPlugin.ID, IStatus.OK, message, throwable));
201
		debug(message, throwable);
202
	}
203
204
	/**
205
	 * @generated
206
	 */
207
	private void debug(String message, Throwable throwable) {
208
		if (!isDebugging()) {
209
			return;
210
		}
211
		if (message != null) {
212
			System.err.println(message);
213
		}
214
		if (throwable != null) {
215
			throwable.printStackTrace();
216
		}
217
	}
218
219
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/slot/SlotParserConstants.java (+80 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. SlotParserConstants.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.slot;
14
15
public interface SlotParserConstants {
16
17
  int EOF = 0;
18
  int SLASH = 3;
19
  int COLON = 4;
20
  int EQUALS = 5;
21
  int LBRACKET = 6;
22
  int RBRACKET = 7;
23
  int LCURLY = 8;
24
  int RCURLY = 9;
25
  int COMMA = 10;
26
  int PLUS = 11;
27
  int MINUS = 12;
28
  int NUMBER_SIGN = 13;
29
  int TILDE = 14;
30
  int DOT = 15;
31
  int STAR = 16;
32
  int READ_ONLY = 17;
33
  int UNION = 18;
34
  int SUBSETS = 19;
35
  int REDEFINES = 20;
36
  int ORDERED = 21;
37
  int UNORDERED = 22;
38
  int UNIQUE = 23;
39
  int NON_UNIQUE = 24;
40
  int INTEGER_LITERAL = 25;
41
  int IDENTIFIER = 26;
42
  int LETTER = 27;
43
  int DIGIT = 28;
44
45
  int DEFAULT = 0;
46
47
  String[] tokenImage = {
48
    "<EOF>",
49
    "\" \"",
50
    "\"\\t\"",
51
    "\"/\"",
52
    "\":\"",
53
    "\"=\"",
54
    "\"[\"",
55
    "\"]\"",
56
    "\"{\"",
57
    "\"}\"",
58
    "\",\"",
59
    "\"+\"",
60
    "\"-\"",
61
    "\"#\"",
62
    "\"~\"",
63
    "\".\"",
64
    "\"*\"",
65
    "\"readOnly\"",
66
    "\"union\"",
67
    "\"subsets\"",
68
    "\"redefines\"",
69
    "\"ordered\"",
70
    "\"unordered\"",
71
    "\"unique\"",
72
    "\"nonunique\"",
73
    "<INTEGER_LITERAL>",
74
    "<IDENTIFIER>",
75
    "<LETTER>",
76
    "<DIGIT>",
77
    "\"\\\"\"",
78
  };
79
80
}
(-)src/org/eclipse/uml2/diagram/clazz/providers/UMLIconProvider.java (+31 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.providers;
2
3
import org.eclipse.core.runtime.IAdaptable;
4
import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
5
import org.eclipse.gmf.runtime.common.core.service.IOperation;
6
import org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation;
7
import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider;
8
import org.eclipse.swt.graphics.Image;
9
10
/**
11
 * @generated
12
 */
13
public class UMLIconProvider extends AbstractProvider implements IIconProvider {
14
15
	/**
16
	 * @generated
17
	 */
18
	public Image getIcon(IAdaptable hint, int flags) {
19
		return UMLElementTypes.getImage(hint);
20
	}
21
22
	/**
23
	 * @generated
24
	 */
25
	public boolean provides(IOperation operation) {
26
		if (operation instanceof GetIconOperation) {
27
			return ((GetIconOperation) operation).execute(this) != null;
28
		}
29
		return false;
30
	}
31
}
(-)src/org/eclipse/uml2/diagram/clazz/navigator/UMLNavigatorItem.java (+73 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.navigator;
2
3
import org.eclipse.emf.ecore.EObject;
4
import org.eclipse.gmf.runtime.notation.View;
5
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
6
7
/**
8
 * @generated
9
 */
10
public class UMLNavigatorItem extends UMLAbstractNavigatorItem {
11
12
	/**
13
	 * @generated
14
	 */
15
	private View myView;
16
17
	/**
18
	 * @generated
19
	 */
20
	public UMLNavigatorItem(View view, Object parent) {
21
		super(parent);
22
		myView = view;
23
	}
24
25
	/**
26
	 * @generated
27
	 */
28
	public View getView() {
29
		return myView;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	public String getModelID() {
36
		return UMLVisualIDRegistry.getModelID(myView);
37
	}
38
39
	/**
40
	 * @generated
41
	 */
42
	public int getVisualID() {
43
		return UMLVisualIDRegistry.getVisualID(myView);
44
	}
45
46
	/**
47
	 * @generated
48
	 */
49
	public Object getAdapter(Class adapter) {
50
		if (View.class.isAssignableFrom(adapter) || EObject.class.isAssignableFrom(adapter)) {
51
			return myView;
52
		}
53
		return super.getAdapter(adapter);
54
	}
55
56
	/**
57
	 * @generated
58
	 */
59
	public boolean equals(Object obj) {
60
		if (obj instanceof UMLNavigatorItem) {
61
			EObject eObject = getView().getElement();
62
			EObject anotherEObject = ((UMLNavigatorItem) obj).getView().getElement();
63
			if (eObject == null) {
64
				return anotherEObject == null;
65
			} else if (anotherEObject == null) {
66
				return false;
67
			}
68
			return eObject.eResource().getURIFragment(eObject).equals(anotherEObject.eResource().getURIFragment(anotherEObject));
69
		}
70
		return super.equals(obj);
71
	}
72
73
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/name/AssociationNameToString.java (+64 lines)
Added Link Here
1
/*
2
 * Copyright (c) 2006 Borland Software Corporation
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    Michael Golubev (Borland) - initial API and implementation
11
 */
12
13
package org.eclipse.uml2.diagram.clazz.parser.association.name;
14
15
import java.util.Arrays;
16
import java.util.List;
17
18
import org.eclipse.emf.ecore.EObject;
19
import org.eclipse.emf.ecore.EStructuralFeature;
20
import org.eclipse.uml2.diagram.parser.AbstractToString;
21
import org.eclipse.uml2.uml.Association;
22
import org.eclipse.uml2.uml.UMLPackage;
23
24
public abstract class AssociationNameToString extends AbstractToString {
25
	public static class EDIT extends AssociationNameToString {
26
		
27
		public boolean isAffectingFeature(EStructuralFeature feature) {
28
			throw new UnsupportedOperationException("I am edit toString, I am not expected to be asked");
29
		}
30
		
31
	}
32
	
33
	public static class VIEW extends AssociationNameToString {
34
		private static final List AFFECTING = Arrays.asList(new EStructuralFeature[] {
35
			UMLPackage.eINSTANCE.getAssociation_IsDerived(),		
36
			UMLPackage.eINSTANCE.getNamedElement_Name(),
37
		});
38
		
39
		public boolean isAffectingFeature(EStructuralFeature feature) {
40
			return AFFECTING.contains(feature);
41
		}
42
	}
43
	
44
	public String getToString(EObject object, int flags) {
45
		Association association = asAssociation(object);
46
		StringBuffer result = new StringBuffer();
47
		result.append(getIsDerived(association));
48
		appendName(result, association);
49
		
50
		return result.toString();
51
	}
52
53
	protected Association asAssociation(EObject object){
54
		if (false == object instanceof Association){
55
			throw new IllegalStateException("I can not provide toString for: " + object);
56
		}
57
		return (Association)object;
58
	}
59
	
60
	protected String getIsDerived(Association association) {
61
		return association.isDerived() ? "/" : "";
62
	}
63
	
64
}
(-)plugin.xml (+1067 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse version="3.0"?>
3
4
<plugin>
5
6
<!-- gmf generator persistent region begin -->
7
8
<!-- gmf generator persistent region end -->
9
10
   <extension point="org.eclipse.core.runtime.preferences">
11
      <initializer class="org.eclipse.uml2.diagram.clazz.part.UMLDiagramPreferenceInitializer"/>
12
   </extension>
13
14
   <extension point="org.eclipse.team.core.fileTypes">
15
      <fileTypes
16
         type="text"
17
         extension="umlclass_diagram">
18
      </fileTypes>
19
   </extension>
20
21
   <extension point="org.eclipse.emf.ecore.extension_parser">
22
      <parser
23
         type="umlclass_diagram"
24
         class="org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory">
25
      </parser>
26
   </extension>
27
28
   <extension point="org.eclipse.ui.editors">
29
     <editor
30
        id="org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorID"
31
        name="%editorName"
32
        icon="icons/obj16/UMLDiagramFile.gif"
33
        extensions="umlclass_diagram"
34
        default="true"
35
        class="org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditor"
36
        matchingStrategy="org.eclipse.uml2.diagram.clazz.part.UMLMatchingStrategy"
37
        contributorClass="org.eclipse.uml2.diagram.clazz.part.UMLDiagramActionBarContributor">
38
     </editor>
39
   </extension>
40
41
   <extension point="org.eclipse.ui.newWizards">
42
  	  <wizard
43
  	     name="%newWizardName"
44
  	     icon="icons/obj16/UMLDiagramFile.gif"
45
  	     category="org.eclipse.ui.Examples"
46
  	     class="org.eclipse.uml2.diagram.clazz.part.UMLCreationWizard"
47
  	     id="org.eclipse.uml2.diagram.clazz.part.UMLCreationWizardID">
48
  	  	 <description>%newWizardDesc</description>  
49
      </wizard>
50
   </extension>
51
52
   <extension point="org.eclipse.ui.popupMenus">
53
      <objectContribution
54
            id="org.eclipse.uml2.diagram.clazz.ui.objectContribution.IFile1"
55
            nameFilter="*.uml"
56
            objectClass="org.eclipse.core.resources.IFile">
57
         <action
58
               label="%initDiagramActionLabel"
59
               class="org.eclipse.uml2.diagram.clazz.part.UMLInitDiagramFileAction"
60
               menubarPath="additions"
61
               enablesFor="1"
62
               id="org.eclipse.uml2.diagram.clazz.part.UMLInitDiagramFileActionID">
63
         </action>
64
      </objectContribution>  
65
      <objectContribution
66
            adaptable="false"
67
            id="org.eclipse.uml2.diagram.clazz.ui.objectContribution.PackageEditPart2"
68
            objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart">
69
         <action
70
               class="org.eclipse.uml2.diagram.clazz.part.UMLLoadResourceAction"
71
               enablesFor="1"
72
               id="org.eclipse.uml2.diagram.clazz.part.UMLLoadResourceActionID"
73
               label="%loadResourceActionLabel"
74
               menubarPath="additions">
75
         </action>
76
      </objectContribution>                      
77
  </extension>
78
79
   <extension point="org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders">
80
      <contributionItemProvider
81
            class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider"
82
            checkPluginLoaded="false">
83
         <Priority name="Low"/>
84
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
85
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Package3EditPart"/>
86
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
87
         </popupContribution>
88
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
89
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.ClassEditPart"/>
90
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
91
         </popupContribution>
92
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
93
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeEditPart"/>
94
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
95
         </popupContribution>
96
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
97
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeEditPart"/>
98
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
99
         </popupContribution>
100
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
101
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationEditPart"/>
102
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
103
         </popupContribution>
104
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
105
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassEditPart"/>
106
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
107
         </popupContribution>
108
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
109
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationEditPart"/>
110
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
111
         </popupContribution>
112
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
113
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.PropertyEditPart"/>
114
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
115
         </popupContribution>
116
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
117
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.OperationEditPart"/>
118
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
119
         </popupContribution>
120
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
121
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Class3EditPart"/>
122
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
123
         </popupContribution>
124
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
125
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.PortEditPart"/>
126
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
127
         </popupContribution>
128
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
129
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.PortNameEditPart"/>
130
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
131
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
132
         </popupContribution>
133
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
134
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Property2EditPart"/>
135
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
136
         </popupContribution>
137
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
138
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Operation2EditPart"/>
139
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
140
         </popupContribution>
141
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
142
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Property3EditPart"/>
143
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
144
         </popupContribution>
145
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
146
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Operation3EditPart"/>
147
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
148
         </popupContribution>
149
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
150
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Property4EditPart"/>
151
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
152
         </popupContribution>
153
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
154
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Operation4EditPart"/>
155
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
156
         </popupContribution>
157
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
158
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationLiteralEditPart"/>
159
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
160
         </popupContribution>
161
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
162
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Property5EditPart"/>
163
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
164
         </popupContribution>
165
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
166
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Operation5EditPart"/>
167
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
168
         </popupContribution>
169
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
170
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.LiteralStringEditPart"/>
171
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
172
         </popupContribution>
173
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
174
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.SlotEditPart"/>
175
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
176
         </popupContribution>
177
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
178
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Package2EditPart"/>
179
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
180
         </popupContribution>
181
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
182
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.PackageNameEditPart"/>
183
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
184
         </popupContribution>
185
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
186
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Class2EditPart"/>
187
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
188
         </popupContribution>
189
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
190
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.ClassNameEditPart"/>
191
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
192
         </popupContribution>
193
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
194
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClass2EditPart"/>
195
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
196
         </popupContribution>
197
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
198
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassNameEditPart"/>
199
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
200
         </popupContribution>
201
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
202
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.DataType2EditPart"/>
203
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
204
         </popupContribution>
205
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
206
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeNameEditPart"/>
207
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
208
         </popupContribution>
209
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
210
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveType2EditPart"/>
211
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
212
         </popupContribution>
213
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
214
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeNameEditPart"/>
215
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
216
         </popupContribution>
217
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
218
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Enumeration2EditPart"/>
219
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
220
         </popupContribution>
221
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
222
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationNameEditPart"/>
223
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
224
         </popupContribution>
225
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
226
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceEditPart"/>
227
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
228
         </popupContribution>
229
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
230
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceNameEditPart"/>
231
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
232
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
233
         </popupContribution>
234
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
235
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintEditPart"/>
236
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
237
         </popupContribution>
238
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
239
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintNameEditPart"/>
240
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
241
         </popupContribution>
242
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
243
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecification2EditPart"/>
244
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
245
         </popupContribution>
246
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
247
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationNameEditPart"/>
248
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
249
         </popupContribution>
250
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
251
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.DependencyEditPart"/>
252
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
253
         </popupContribution>
254
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
255
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.DependencyNameEditPart"/>
256
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
257
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
258
         </popupContribution>
259
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
260
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.GeneralizationEditPart"/>
261
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
262
         </popupContribution>
263
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
264
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Dependency2EditPart"/>
265
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
266
         </popupContribution>
267
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
268
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.DependencyName2EditPart"/>
269
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
270
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
271
         </popupContribution>
272
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
273
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.Property6EditPart"/>
274
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
275
         </popupContribution>
276
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
277
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.PropertyNameEditPart"/>
278
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
279
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
280
         </popupContribution>
281
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
282
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintConstrainedElementEditPart"/>
283
            <popupAction path="/editGroup" id="deleteFromModelAction"/>
284
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
285
         </popupContribution>
286
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
287
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.AssociationEditPart"/>
288
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
289
         </popupContribution>
290
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
291
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.AssociationNameEditPart"/>
292
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
293
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
294
         </popupContribution>
295
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
296
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName2EditPart"/>
297
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
298
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
299
         </popupContribution>
300
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
301
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName3EditPart"/>
302
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
303
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
304
         </popupContribution>
305
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
306
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName4EditPart"/>
307
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
308
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
309
         </popupContribution>
310
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
311
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName5EditPart"/>
312
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
313
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
314
         </popupContribution>
315
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
316
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName6EditPart"/>
317
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
318
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
319
         </popupContribution>
320
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
321
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.AssociationName7EditPart"/>
322
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
323
            <popupPredefinedItem id="deleteFromModelAction" remove="true"/>
324
         </popupContribution>
325
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
326
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.DependencySupplierEditPart"/>
327
            <popupAction path="/editGroup" id="deleteFromModelAction"/>
328
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
329
         </popupContribution>
330
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
331
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.DependencyClientEditPart"/>
332
            <popupAction path="/editGroup" id="deleteFromModelAction"/>
333
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
334
         </popupContribution>
335
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
336
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceRealizationEditPart"/>
337
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
338
         </popupContribution>
339
         <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
340
            <popupStructuredContributionCriteria objectClass="org.eclipse.uml2.diagram.clazz.edit.parts.UsageEditPart"/>
341
            <popupPredefinedItem id="deleteFromDiagramAction" remove="true"/>
342
         </popupContribution>
343
      </contributionItemProvider>
344
   </extension>
345
346
   <extension point="org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders">
347
      <GlobalActionHandlerProvider
348
         class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandlerProvider"
349
         id="UMLClassPresentation">
350
         <Priority name="Lowest"/>
351
         <ViewId id="org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorID">
352
            <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
353
               <GlobalActionId actionId="delete"/>
354
            </ElementType>
355
            <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart">
356
               <GlobalActionId actionId="save"/>
357
            </ElementType>
358
         </ViewId>
359
      </GlobalActionHandlerProvider>
360
      <GlobalActionHandlerProvider
361
         class="org.eclipse.gmf.runtime.diagram.ui.providers.ide.providers.DiagramIDEGlobalActionHandlerProvider"
362
         id="UMLClassPresentationIDE">
363
         <Priority name="Lowest"/>
364
         <ViewId id="org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorID">
365
            <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
366
               <GlobalActionId actionId="bookmark"/>
367
            </ElementType>
368
         </ViewId>
369
      </GlobalActionHandlerProvider>
370
      <GlobalActionHandlerProvider
371
            class="org.eclipse.gmf.runtime.diagram.ui.render.providers.DiagramUIRenderGlobalActionHandlerProvider"
372
            id="UMLClassRender">
373
         <Priority name="Lowest"/>
374
         <ViewId id="org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorID">
375
            <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
376
               <GlobalActionId actionId="cut"/>
377
               <GlobalActionId actionId="copy"/>
378
               <GlobalActionId actionId="paste"/>
379
            </ElementType>
380
         </ViewId>
381
      </GlobalActionHandlerProvider>
382
   </extension>
383
384
   <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders">
385
      <viewProvider class="org.eclipse.uml2.diagram.clazz.providers.UMLViewProvider">
386
         <Priority name="Lowest"/>
387
         <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="UMLClass"/>
388
         <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints=""/>
389
         <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints=""/>
390
      </viewProvider>
391
   </extension>
392
393
   <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders">
394
      <editpartProvider class="org.eclipse.uml2.diagram.clazz.providers.UMLEditPartProvider">
395
         <Priority name="Lowest"/>
396
      </editpartProvider>
397
   </extension>
398
399
   <extension point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
400
      <paletteProvider class="org.eclipse.uml2.diagram.clazz.providers.UMLPaletteProvider">
401
         <Priority name="Lowest"/>
402
         <editor id="org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorID"/>
403
      </paletteProvider>
404
   </extension>
405
406
   <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders">
407
      <modelingAssistantProvider class="org.eclipse.uml2.diagram.clazz.providers.UMLModelingAssistantProvider">
408
         <Priority name="Lowest"/>
409
      </modelingAssistantProvider>
410
   </extension>
411
412
   <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders">
413
      <IconProvider class="org.eclipse.uml2.diagram.clazz.providers.UMLIconProvider">
414
         <Priority name="Low"/>
415
      </IconProvider>
416
   </extension>
417
418
   <extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders">
419
      <ParserProvider class="org.eclipse.uml2.diagram.clazz.providers.UMLParserProvider">
420
         <Priority name="Lowest"/>
421
      </ParserProvider>
422
   </extension>
423
424
   <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
425
426
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
427
         <metamodelType
428
               id="org.eclipse.uml2.diagram.clazz.Package_1000"
429
               name="Undefined"
430
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
431
               eclass="Package"
432
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.PackageEditHelper">
433
            <param name="semanticHint" value="1000"/>
434
         </metamodelType>
435
      </metamodel>
436
437
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
438
         <specializationType
439
               id="org.eclipse.uml2.diagram.clazz.Package_3006"
440
               name="Package"
441
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
442
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.Package2EditHelperAdvice">
443
            <specializes id="org.eclipse.uml2.diagram.clazz.Package_1000"/>
444
            <param name="semanticHint" value="3006"/>
445
         </specializationType>
446
      </metamodel>
447
448
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
449
         <metamodelType
450
               id="org.eclipse.uml2.diagram.clazz.Class_3007"
451
               name="Class"
452
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
453
               eclass="Class"
454
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.ClassEditHelper">
455
            <param name="semanticHint" value="3007"/>
456
         </metamodelType>
457
      </metamodel>
458
459
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
460
         <metamodelType
461
               id="org.eclipse.uml2.diagram.clazz.DataType_3008"
462
               name="DataType"
463
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
464
               eclass="DataType"
465
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.DataTypeEditHelper">
466
            <param name="semanticHint" value="3008"/>
467
         </metamodelType>
468
      </metamodel>
469
470
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
471
         <metamodelType
472
               id="org.eclipse.uml2.diagram.clazz.PrimitiveType_3009"
473
               name="PrimitiveType"
474
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
475
               eclass="PrimitiveType"
476
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.PrimitiveTypeEditHelper">
477
            <param name="semanticHint" value="3009"/>
478
         </metamodelType>
479
      </metamodel>
480
481
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
482
         <metamodelType
483
               id="org.eclipse.uml2.diagram.clazz.Enumeration_3011"
484
               name="Enumeration"
485
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
486
               eclass="Enumeration"
487
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.EnumerationEditHelper">
488
            <param name="semanticHint" value="3011"/>
489
         </metamodelType>
490
      </metamodel>
491
492
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
493
         <metamodelType
494
               id="org.eclipse.uml2.diagram.clazz.AssociationClass_3012"
495
               name="AssociationClass"
496
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
497
               eclass="AssociationClass"
498
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.AssociationClassEditHelper">
499
            <param name="semanticHint" value="3012"/>
500
         </metamodelType>
501
      </metamodel>
502
503
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
504
         <metamodelType
505
               id="org.eclipse.uml2.diagram.clazz.InstanceSpecification_3013"
506
               name="InstanceSpecification"
507
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
508
               eclass="InstanceSpecification"
509
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.InstanceSpecificationEditHelper">
510
            <param name="semanticHint" value="3013"/>
511
         </metamodelType>
512
      </metamodel>
513
514
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
515
         <metamodelType
516
               id="org.eclipse.uml2.diagram.clazz.Property_3001"
517
               name="Property"
518
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
519
               eclass="Property"
520
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.PropertyEditHelper">
521
            <param name="semanticHint" value="3001"/>
522
         </metamodelType>
523
      </metamodel>
524
525
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
526
         <metamodelType
527
               id="org.eclipse.uml2.diagram.clazz.Operation_3002"
528
               name="Operation"
529
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
530
               eclass="Operation"
531
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.OperationEditHelper">
532
            <param name="semanticHint" value="3002"/>
533
         </metamodelType>
534
      </metamodel>
535
536
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
537
         <specializationType
538
               id="org.eclipse.uml2.diagram.clazz.Class_3003"
539
               name="Class"
540
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
541
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.Class2EditHelperAdvice">
542
            <specializes id="org.eclipse.uml2.diagram.clazz.Class_3007"/>
543
            <param name="semanticHint" value="3003"/>
544
         </specializationType>
545
      </metamodel>
546
547
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
548
         <metamodelType
549
               id="org.eclipse.uml2.diagram.clazz.Port_3025"
550
               name="Port"
551
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
552
               eclass="Port"
553
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.PortEditHelper">
554
            <param name="semanticHint" value="3025"/>
555
         </metamodelType>
556
      </metamodel>
557
558
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
559
         <specializationType
560
               id="org.eclipse.uml2.diagram.clazz.Property_3019"
561
               name="Property"
562
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
563
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.PropertyEditHelperAdvice">
564
            <specializes id="org.eclipse.uml2.diagram.clazz.Property_3001"/>
565
            <param name="semanticHint" value="3019"/>
566
         </specializationType>
567
      </metamodel>
568
569
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
570
         <specializationType
571
               id="org.eclipse.uml2.diagram.clazz.Operation_3020"
572
               name="Operation"
573
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
574
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.OperationEditHelperAdvice">
575
            <specializes id="org.eclipse.uml2.diagram.clazz.Operation_3002"/>
576
            <param name="semanticHint" value="3020"/>
577
         </specializationType>
578
      </metamodel>
579
580
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
581
         <specializationType
582
               id="org.eclipse.uml2.diagram.clazz.Property_3014"
583
               name="Property"
584
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
585
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.Property2EditHelperAdvice">
586
            <specializes id="org.eclipse.uml2.diagram.clazz.Property_3001"/>
587
            <param name="semanticHint" value="3014"/>
588
         </specializationType>
589
      </metamodel>
590
591
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
592
         <specializationType
593
               id="org.eclipse.uml2.diagram.clazz.Operation_3015"
594
               name="Operation"
595
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
596
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.Operation2EditHelperAdvice">
597
            <specializes id="org.eclipse.uml2.diagram.clazz.Operation_3002"/>
598
            <param name="semanticHint" value="3015"/>
599
         </specializationType>
600
      </metamodel>
601
602
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
603
         <specializationType
604
               id="org.eclipse.uml2.diagram.clazz.Property_3021"
605
               name="Property"
606
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
607
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.Property3EditHelperAdvice">
608
            <specializes id="org.eclipse.uml2.diagram.clazz.Property_3001"/>
609
            <param name="semanticHint" value="3021"/>
610
         </specializationType>
611
      </metamodel>
612
613
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
614
         <specializationType
615
               id="org.eclipse.uml2.diagram.clazz.Operation_3022"
616
               name="Operation"
617
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
618
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.Operation3EditHelperAdvice">
619
            <specializes id="org.eclipse.uml2.diagram.clazz.Operation_3002"/>
620
            <param name="semanticHint" value="3022"/>
621
         </specializationType>
622
      </metamodel>
623
624
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
625
         <metamodelType
626
               id="org.eclipse.uml2.diagram.clazz.EnumerationLiteral_3016"
627
               name="EnumerationLiteral"
628
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
629
               eclass="EnumerationLiteral"
630
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.EnumerationLiteralEditHelper">
631
            <param name="semanticHint" value="3016"/>
632
         </metamodelType>
633
      </metamodel>
634
635
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
636
         <specializationType
637
               id="org.eclipse.uml2.diagram.clazz.Property_3023"
638
               name="Property"
639
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
640
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.Property4EditHelperAdvice">
641
            <specializes id="org.eclipse.uml2.diagram.clazz.Property_3001"/>
642
            <param name="semanticHint" value="3023"/>
643
         </specializationType>
644
      </metamodel>
645
646
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
647
         <specializationType
648
               id="org.eclipse.uml2.diagram.clazz.Operation_3024"
649
               name="Operation"
650
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
651
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.Operation4EditHelperAdvice">
652
            <specializes id="org.eclipse.uml2.diagram.clazz.Operation_3002"/>
653
            <param name="semanticHint" value="3024"/>
654
         </specializationType>
655
      </metamodel>
656
657
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
658
         <metamodelType
659
               id="org.eclipse.uml2.diagram.clazz.LiteralString_3005"
660
               name="LiteralString"
661
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
662
               eclass="LiteralString"
663
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.LiteralStringEditHelper">
664
            <param name="semanticHint" value="3005"/>
665
         </metamodelType>
666
      </metamodel>
667
668
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
669
         <metamodelType
670
               id="org.eclipse.uml2.diagram.clazz.Slot_3017"
671
               name="Slot"
672
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
673
               eclass="Slot"
674
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.SlotEditHelper">
675
            <param name="semanticHint" value="3017"/>
676
         </metamodelType>
677
      </metamodel>
678
679
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
680
         <specializationType
681
               id="org.eclipse.uml2.diagram.clazz.Package_2002"
682
               name="Package"
683
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
684
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.PackageEditHelperAdvice">
685
            <specializes id="org.eclipse.uml2.diagram.clazz.Package_1000"/>
686
            <param name="semanticHint" value="2002"/>
687
         </specializationType>
688
      </metamodel>
689
690
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
691
         <specializationType
692
               id="org.eclipse.uml2.diagram.clazz.Class_2001"
693
               name="Class"
694
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
695
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.ClassEditHelperAdvice">
696
            <specializes id="org.eclipse.uml2.diagram.clazz.Class_3007"/>
697
            <param name="semanticHint" value="2001"/>
698
         </specializationType>
699
      </metamodel>
700
701
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
702
         <specializationType
703
               id="org.eclipse.uml2.diagram.clazz.AssociationClass_2007"
704
               name="AssociationClass"
705
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
706
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.AssociationClassEditHelperAdvice">
707
            <specializes id="org.eclipse.uml2.diagram.clazz.AssociationClass_3012"/>
708
            <param name="semanticHint" value="2007"/>
709
         </specializationType>
710
      </metamodel>
711
712
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
713
         <specializationType
714
               id="org.eclipse.uml2.diagram.clazz.DataType_2004"
715
               name="DataType"
716
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
717
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.DataTypeEditHelperAdvice">
718
            <specializes id="org.eclipse.uml2.diagram.clazz.DataType_3008"/>
719
            <param name="semanticHint" value="2004"/>
720
         </specializationType>
721
      </metamodel>
722
723
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
724
         <specializationType
725
               id="org.eclipse.uml2.diagram.clazz.PrimitiveType_2005"
726
               name="PrimitiveType"
727
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
728
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.PrimitiveTypeEditHelperAdvice">
729
            <specializes id="org.eclipse.uml2.diagram.clazz.PrimitiveType_3009"/>
730
            <param name="semanticHint" value="2005"/>
731
         </specializationType>
732
      </metamodel>
733
734
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
735
         <specializationType
736
               id="org.eclipse.uml2.diagram.clazz.Enumeration_2003"
737
               name="Enumeration"
738
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
739
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.EnumerationEditHelperAdvice">
740
            <specializes id="org.eclipse.uml2.diagram.clazz.Enumeration_3011"/>
741
            <param name="semanticHint" value="2003"/>
742
         </specializationType>
743
      </metamodel>
744
745
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
746
         <metamodelType
747
               id="org.eclipse.uml2.diagram.clazz.Interface_2010"
748
               name="Interface"
749
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
750
               eclass="Interface"
751
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.InterfaceEditHelper">
752
            <param name="semanticHint" value="2010"/>
753
         </metamodelType>
754
      </metamodel>
755
756
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
757
         <metamodelType
758
               id="org.eclipse.uml2.diagram.clazz.Constraint_2006"
759
               name="Constraint"
760
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
761
               eclass="Constraint"
762
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.ConstraintEditHelper">
763
            <param name="semanticHint" value="2006"/>
764
         </metamodelType>
765
      </metamodel>
766
767
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
768
         <specializationType
769
               id="org.eclipse.uml2.diagram.clazz.InstanceSpecification_2008"
770
               name="InstanceSpecification"
771
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
772
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.InstanceSpecificationEditHelperAdvice">
773
            <specializes id="org.eclipse.uml2.diagram.clazz.InstanceSpecification_3013"/>
774
            <param name="semanticHint" value="2008"/>
775
         </specializationType>
776
      </metamodel>
777
778
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
779
         <metamodelType
780
               id="org.eclipse.uml2.diagram.clazz.Dependency_2009"
781
               name="Dependency"
782
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
783
               eclass="Dependency"
784
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.DependencyEditHelper">
785
            <param name="semanticHint" value="2009"/>
786
         </metamodelType>
787
      </metamodel>
788
789
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
790
         <metamodelType
791
               id="org.eclipse.uml2.diagram.clazz.Generalization_4001"
792
               name="Generalization"
793
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
794
               eclass="Generalization"
795
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.GeneralizationEditHelper">
796
            <param name="semanticHint" value="4001"/>
797
         </metamodelType>
798
      </metamodel>
799
800
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
801
         <specializationType
802
               id="org.eclipse.uml2.diagram.clazz.Dependency_4002"
803
               name="Dependency"
804
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
805
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.DependencyEditHelperAdvice">
806
            <specializes id="org.eclipse.uml2.diagram.clazz.Dependency_2009"/>
807
            <param name="semanticHint" value="4002"/>
808
         </specializationType>
809
      </metamodel>
810
811
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
812
         <specializationType
813
               id="org.eclipse.uml2.diagram.clazz.Property_4003"
814
               name="Property"
815
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
816
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.Property5EditHelperAdvice">
817
            <specializes id="org.eclipse.uml2.diagram.clazz.Property_3001"/>
818
            <param name="semanticHint" value="4003"/>
819
         </specializationType>
820
      </metamodel>
821
822
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
823
         <specializationType
824
               id="org.eclipse.uml2.diagram.clazz.ConstraintConstrainedElement_4004"
825
               name="Undefined"
826
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
827
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.ConstraintConstrainedElementEditHelperAdvice">
828
            <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
829
            <param name="semanticHint" value="4004"/>
830
         </specializationType>
831
      </metamodel>
832
833
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
834
         <metamodelType
835
               id="org.eclipse.uml2.diagram.clazz.Association_4005"
836
               name="Association"
837
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
838
               eclass="Association"
839
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.AssociationEditHelper">
840
            <param name="semanticHint" value="4005"/>
841
         </metamodelType>
842
      </metamodel>
843
844
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
845
         <specializationType
846
               id="org.eclipse.uml2.diagram.clazz.DependencySupplier_4006"
847
               name="Undefined"
848
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
849
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.DependencySupplierEditHelperAdvice">
850
            <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
851
            <param name="semanticHint" value="4006"/>
852
         </specializationType>
853
      </metamodel>
854
855
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
856
         <specializationType
857
               id="org.eclipse.uml2.diagram.clazz.DependencyClient_4007"
858
               name="Undefined"
859
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
860
               edithelperadvice="org.eclipse.uml2.diagram.clazz.edit.helpers.DependencyClientEditHelperAdvice">
861
            <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
862
            <param name="semanticHint" value="4007"/>
863
         </specializationType>
864
      </metamodel>
865
866
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
867
         <metamodelType
868
               id="org.eclipse.uml2.diagram.clazz.InterfaceRealization_4008"
869
               name="InterfaceRealization"
870
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
871
               eclass="InterfaceRealization"
872
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.InterfaceRealizationEditHelper">
873
            <param name="semanticHint" value="4008"/>
874
         </metamodelType>
875
      </metamodel>
876
877
      <metamodel nsURI="http://www.eclipse.org/uml2/2.0.0/UML">
878
         <metamodelType
879
               id="org.eclipse.uml2.diagram.clazz.Usage_4009"
880
               name="Usage"
881
               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
882
               eclass="Usage"
883
               edithelper="org.eclipse.uml2.diagram.clazz.edit.helpers.UsageEditHelper">
884
            <param name="semanticHint" value="4009"/>
885
         </metamodelType>
886
      </metamodel>
887
   </extension>
888
889
   <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings">
890
      <clientContext id="UMLClassClientContext">
891
         <enablement>
892
            <test
893
               property="org.eclipse.gmf.runtime.emf.core.editingDomain"
894
               value="org.eclipse.uml2.diagram.clazz.EditingDomain"/>
895
         </enablement>
896
      </clientContext> 
897
      <binding context="UMLClassClientContext">
898
         <elementType ref="org.eclipse.uml2.diagram.clazz.Package_1000"/>
899
         <elementType ref="org.eclipse.uml2.diagram.clazz.Package_3006"/>
900
         <elementType ref="org.eclipse.uml2.diagram.clazz.Class_3007"/>
901
         <elementType ref="org.eclipse.uml2.diagram.clazz.DataType_3008"/>
902
         <elementType ref="org.eclipse.uml2.diagram.clazz.PrimitiveType_3009"/>
903
         <elementType ref="org.eclipse.uml2.diagram.clazz.Enumeration_3011"/>
904
         <elementType ref="org.eclipse.uml2.diagram.clazz.AssociationClass_3012"/>
905
         <elementType ref="org.eclipse.uml2.diagram.clazz.InstanceSpecification_3013"/>
906
         <elementType ref="org.eclipse.uml2.diagram.clazz.Property_3001"/>
907
         <elementType ref="org.eclipse.uml2.diagram.clazz.Operation_3002"/>
908
         <elementType ref="org.eclipse.uml2.diagram.clazz.Class_3003"/>
909
         <elementType ref="org.eclipse.uml2.diagram.clazz.Port_3025"/>
910
         <elementType ref="org.eclipse.uml2.diagram.clazz.Property_3019"/>
911
         <elementType ref="org.eclipse.uml2.diagram.clazz.Operation_3020"/>
912
         <elementType ref="org.eclipse.uml2.diagram.clazz.Property_3014"/>
913
         <elementType ref="org.eclipse.uml2.diagram.clazz.Operation_3015"/>
914
         <elementType ref="org.eclipse.uml2.diagram.clazz.Property_3021"/>
915
         <elementType ref="org.eclipse.uml2.diagram.clazz.Operation_3022"/>
916
         <elementType ref="org.eclipse.uml2.diagram.clazz.EnumerationLiteral_3016"/>
917
         <elementType ref="org.eclipse.uml2.diagram.clazz.Property_3023"/>
918
         <elementType ref="org.eclipse.uml2.diagram.clazz.Operation_3024"/>
919
         <elementType ref="org.eclipse.uml2.diagram.clazz.LiteralString_3005"/>
920
         <elementType ref="org.eclipse.uml2.diagram.clazz.Slot_3017"/>
921
         <elementType ref="org.eclipse.uml2.diagram.clazz.Package_2002"/>
922
         <elementType ref="org.eclipse.uml2.diagram.clazz.Class_2001"/>
923
         <elementType ref="org.eclipse.uml2.diagram.clazz.AssociationClass_2007"/>
924
         <elementType ref="org.eclipse.uml2.diagram.clazz.DataType_2004"/>
925
         <elementType ref="org.eclipse.uml2.diagram.clazz.PrimitiveType_2005"/>
926
         <elementType ref="org.eclipse.uml2.diagram.clazz.Enumeration_2003"/>
927
         <elementType ref="org.eclipse.uml2.diagram.clazz.Interface_2010"/>
928
         <elementType ref="org.eclipse.uml2.diagram.clazz.Constraint_2006"/>
929
         <elementType ref="org.eclipse.uml2.diagram.clazz.InstanceSpecification_2008"/>
930
         <elementType ref="org.eclipse.uml2.diagram.clazz.Dependency_2009"/>
931
         <elementType ref="org.eclipse.uml2.diagram.clazz.Generalization_4001"/>
932
         <elementType ref="org.eclipse.uml2.diagram.clazz.Dependency_4002"/>
933
         <elementType ref="org.eclipse.uml2.diagram.clazz.Property_4003"/>
934
         <elementType ref="org.eclipse.uml2.diagram.clazz.ConstraintConstrainedElement_4004"/>
935
         <elementType ref="org.eclipse.uml2.diagram.clazz.Association_4005"/>
936
         <elementType ref="org.eclipse.uml2.diagram.clazz.DependencySupplier_4006"/>
937
         <elementType ref="org.eclipse.uml2.diagram.clazz.DependencyClient_4007"/>
938
         <elementType ref="org.eclipse.uml2.diagram.clazz.InterfaceRealization_4008"/>
939
         <elementType ref="org.eclipse.uml2.diagram.clazz.Usage_4009"/>
940
         <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
941
      </binding>
942
   </extension>
943
944
   <extension point="org.eclipse.ui.navigator.viewer">
945
      <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
946
         <includes>
947
            <contentExtension pattern="org.eclipse.uml2.diagram.clazz.resourceContent"/>
948
            <contentExtension pattern="org.eclipse.uml2.diagram.clazz.navigatorLinkHelper"/>
949
         </includes>
950
      </viewerContentBinding>
951
   </extension>
952
953
   <extension point="org.eclipse.ui.navigator.navigatorContent">
954
      <navigatorContent 
955
            id="org.eclipse.uml2.diagram.clazz.resourceContent" 
956
            name="%navigatorContentName" 
957
            priority="normal" 
958
            contentProvider="org.eclipse.uml2.diagram.clazz.navigator.UMLNavigatorContentProvider" 
959
            labelProvider="org.eclipse.uml2.diagram.clazz.navigator.UMLNavigatorLabelProvider"
960
            icon="icons/obj16/UMLDiagramFile.gif"
961
            activeByDefault="true">
962
         <triggerPoints>
963
            <or>
964
	            <and>
965
    	           <instanceof value="org.eclipse.core.resources.IFile"/>
966
        	       <test property="org.eclipse.core.resources.extension" value="umlclass_diagram"/>
967
            	</and>
968
            	<instanceof value="org.eclipse.uml2.diagram.clazz.navigator.UMLAbstractNavigatorItem"/>
969
            </or>
970
         </triggerPoints>
971
         <possibleChildren>
972
         	<instanceof value="org.eclipse.uml2.diagram.clazz.navigator.UMLAbstractNavigatorItem"/>
973
         </possibleChildren>
974
         <commonSorter 
975
               id="org.eclipse.uml2.diagram.clazz.navigatorSorter" 
976
               class="org.eclipse.uml2.diagram.clazz.navigator.UMLNavigatorSorter">
977
            <parentExpression>
978
               <or>
979
	              <and>
980
    	             <instanceof value="org.eclipse.core.resources.IFile"/>
981
        	         <test property="org.eclipse.core.resources.extension" value="umlclass_diagram"/>
982
                  </and>
983
                  <instanceof value="org.eclipse.uml2.diagram.clazz.navigator.UMLAbstractNavigatorItem"/>
984
               </or>
985
            </parentExpression>
986
         </commonSorter>
987
         <actionProvider
988
               id="org.eclipse.uml2.diagram.clazz.navigatorActionProvider"
989
               class="org.eclipse.uml2.diagram.clazz.navigator.UMLNavigatorActionProvider">
990
         </actionProvider>
991
      </navigatorContent>
992
   </extension>
993
   
994
   <extension point="org.eclipse.ui.navigator.linkHelper">
995
      <linkHelper
996
            id="org.eclipse.uml2.diagram.clazz.navigatorLinkHelper"
997
            class="org.eclipse.uml2.diagram.clazz.navigator.UMLNavigatorLinkHelper">
998
         <editorInputEnablement>
999
            <instanceof value="org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.document.FileEditorInputProxy"/>
1000
         </editorInputEnablement>
1001
         <selectionEnablement>
1002
            <instanceof value="org.eclipse.uml2.diagram.clazz.navigator.UMLAbstractNavigatorItem"/>
1003
         </selectionEnablement>
1004
      </linkHelper>
1005
   </extension>
1006
1007
   <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
1008
      <propertyContributor contributorId="org.eclipse.uml2.diagram.clazz"
1009
            labelProvider="org.eclipse.uml2.diagram.clazz.sheet.UMLSheetLabelProvider">
1010
         <propertyCategory category="domain"/>
1011
         <propertyCategory category="visual"/>
1012
         <propertyCategory category="extra"/>
1013
      </propertyContributor>
1014
   </extension>
1015
1016
   <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
1017
      <propertyTabs contributorId="org.eclipse.uml2.diagram.clazz">
1018
         <propertyTab
1019
             category="visual"
1020
             id="property.tab.AppearancePropertySection"
1021
             label="%tab.appearance"/>
1022
          <propertyTab
1023
             category="visual"
1024
             id="property.tab.DiagramPropertySection"
1025
             label="%tab.diagram"/>
1026
          <propertyTab
1027
             category="domain"
1028
             id="property.tab.domain"
1029
             label="%tab.domain"/>
1030
      </propertyTabs>
1031
   </extension>
1032
1033
   <extension point="org.eclipse.ui.views.properties.tabbed.propertySections">
1034
      <propertySections contributorId="org.eclipse.uml2.diagram.clazz">
1035
1036
         <propertySection id="property.section.ConnectorAppearancePropertySection" 
1037
            filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ConnectionEditPartPropertySectionFilter" 
1038
            class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ConnectionAppearancePropertySection" 
1039
            tab="property.tab.AppearancePropertySection">
1040
         </propertySection>
1041
         <propertySection id="property.section.ShapeColorAndFontPropertySection" 
1042
            filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ShapeEditPartPropertySectionFilter" 
1043
            class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection" 
1044
            tab="property.tab.AppearancePropertySection">
1045
         </propertySection> 
1046
         <propertySection id="property.section.DiagramColorsAndFontsPropertySection" 
1047
            filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter" 
1048
            class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.DiagramColorsAndFontsPropertySection" 
1049
            tab="property.tab.AppearancePropertySection">
1050
         </propertySection>              
1051
1052
          <propertySection id="property.section.RulerGridPropertySection" 
1053
             filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter" 
1054
             class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection" 
1055
             tab="property.tab.DiagramPropertySection">
1056
          </propertySection>              
1057
         <propertySection
1058
            id="property.section.domain" 
1059
            tab="property.tab.domain"
1060
            class="org.eclipse.uml2.diagram.clazz.sheet.UMLPropertySection">
1061
            <input type="org.eclipse.gmf.runtime.notation.View"/>
1062
            <input type="org.eclipse.gef.EditPart"/>
1063
            <input type="org.eclipse.uml2.diagram.clazz.navigator.UMLAbstractNavigatorItem"/>
1064
         </propertySection>
1065
      </propertySections>
1066
   </extension>
1067
</plugin>
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PackageViewFactory.java (+42 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory;
8
import org.eclipse.gmf.runtime.notation.MeasurementUnit;
9
import org.eclipse.gmf.runtime.notation.NotationFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
12
/**
13
 * @generated
14
 */
15
public class PackageViewFactory extends DiagramViewFactory {
16
17
	/**
18
	 * @generated 
19
	 */
20
	protected List createStyles(View view) {
21
		List styles = new ArrayList();
22
		styles.add(NotationFactory.eINSTANCE.createPageStyle());
23
		styles.add(NotationFactory.eINSTANCE.createGuideStyle());
24
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
25
		return styles;
26
	}
27
28
	/**
29
	 * @generated
30
	 */
31
	protected void decorateView(View view, IAdaptable semanticAdapter, String diagramKind) {
32
		super.decorateView(view, semanticAdapter, diagramKind);
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected MeasurementUnit getMeasurementUnit() {
39
		return MeasurementUnit.PIXEL_LITERAL;
40
	}
41
42
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLDiagramEditorUtil.java (+204 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import java.io.IOException;
4
import java.io.InputStream;
5
import java.util.ArrayList;
6
import java.util.Collections;
7
import java.util.HashMap;
8
import java.util.List;
9
import java.util.Map;
10
11
import org.eclipse.core.resources.IResourceStatus;
12
import org.eclipse.core.resources.ResourcesPlugin;
13
14
import org.eclipse.core.commands.ExecutionException;
15
import org.eclipse.core.commands.operations.OperationHistoryFactory;
16
import org.eclipse.core.resources.IFile;
17
import org.eclipse.core.resources.IResource;
18
import org.eclipse.core.runtime.CoreException;
19
import org.eclipse.core.runtime.NullProgressMonitor;
20
import org.eclipse.core.runtime.IAdaptable;
21
import org.eclipse.core.runtime.IPath;
22
import org.eclipse.core.runtime.IProgressMonitor;
23
import org.eclipse.core.runtime.Path;
24
import org.eclipse.core.runtime.SubProgressMonitor;
25
import org.eclipse.emf.common.util.URI;
26
import org.eclipse.emf.ecore.EObject;
27
import org.eclipse.emf.ecore.resource.Resource;
28
import org.eclipse.emf.ecore.resource.ResourceSet;
29
import org.eclipse.emf.ecore.xmi.XMIResource;
30
import org.eclipse.jface.dialogs.ErrorDialog;
31
32
import org.eclipse.emf.transaction.TransactionalEditingDomain;
33
import java.io.ByteArrayInputStream;
34
35
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
36
import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
37
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
38
import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
39
import org.eclipse.gmf.runtime.notation.Diagram;
40
import org.eclipse.swt.widgets.Shell;
41
import org.eclipse.ui.IEditorPart;
42
import org.eclipse.ui.IWorkbenchPage;
43
import org.eclipse.ui.IWorkbenchWindow;
44
import org.eclipse.ui.PartInitException;
45
import org.eclipse.ui.ide.IDE;
46
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
47
48
import org.eclipse.uml2.uml.UMLFactory;
49
50
/**
51
 * @generated
52
 */
53
public class UMLDiagramEditorUtil {
54
55
	/**
56
	 * @generated
57
	 */
58
	public static final URI createAndOpenDiagram(IPath containerPath, String fileName, IWorkbenchWindow window, IProgressMonitor progressMonitor, boolean openEditor, boolean saveDiagram) {
59
		IFile diagramFile = createNewDiagramFile(containerPath, fileName, window.getShell(), progressMonitor);
60
		if (diagramFile != null && openEditor) {
61
			openDiagramEditor(window, diagramFile, saveDiagram, progressMonitor);
62
		}
63
		return URI.createPlatformResourceURI(diagramFile.getFullPath().toString());
64
	}
65
66
	/**
67
	 * @generated
68
	 */
69
	public static final IEditorPart openDiagramEditor(IWorkbenchWindow window, IFile file, boolean saveDiagram, IProgressMonitor progressMonitor) {
70
		IEditorPart editorPart = null;
71
		try {
72
			IWorkbenchPage page = window.getActivePage();
73
			if (page != null) {
74
				editorPart = openDiagramEditor(page, file);
75
				if (saveDiagram) {
76
					editorPart.doSave(progressMonitor);
77
				}
78
			}
79
			file.refreshLocal(IResource.DEPTH_ZERO, null);
80
			return editorPart;
81
		} catch (Exception e) {
82
			UMLDiagramEditorPlugin.getInstance().logError("Error opening diagram", e);
83
		}
84
		return null;
85
	}
86
87
	/**
88
	 * @generated
89
	 */
90
	public static final IEditorPart openDiagramEditor(IWorkbenchPage page, IFile file) throws PartInitException {
91
		return IDE.openEditor(page, file);
92
	}
93
94
	/**
95
	 * <p>
96
	 * This method should be called within a workspace modify operation since it creates resources.
97
	 * </p>
98
	 * @generated
99
	 * @return the created file resource, or <code>null</code> if the file was not created
100
	 */
101
	public static final IFile createNewDiagramFile(IPath containerFullPath, String fileName, Shell shell, IProgressMonitor progressMonitor) {
102
		TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
103
		ResourceSet resourceSet = editingDomain.getResourceSet();
104
		progressMonitor.beginTask("Creating diagram and model files", 3); //$NON-NLS-1$
105
		final IFile diagramFile = createNewFile(containerFullPath, fileName, shell);
106
		final Resource diagramResource = resourceSet.createResource(URI.createPlatformResourceURI(diagramFile.getFullPath().toString()));
107
		List affectedFiles = new ArrayList();
108
		affectedFiles.add(diagramFile);
109
		IPath modelFileRelativePath = diagramFile.getFullPath().removeFileExtension().addFileExtension("uml"); //$NON-NLS-1$
110
		IFile modelFile = diagramFile.getParent().getFile(new Path(modelFileRelativePath.lastSegment()));
111
		final Resource modelResource = resourceSet.createResource(URI.createPlatformResourceURI(modelFile.getFullPath().toString()));
112
		affectedFiles.add(modelFile);
113
		AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, "Creating diagram and model", affectedFiles) { //$NON-NLS-1$
114
115
			protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
116
				org.eclipse.uml2.uml.Package model = createInitialModel();
117
				modelResource.getContents().add(createInitialRoot(model));
118
				Diagram diagram = ViewService.createDiagram(model, PackageEditPart.MODEL_ID, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
119
				if (diagram != null) {
120
					diagramResource.getContents().add(diagram);
121
					diagram.setName(diagramFile.getName());
122
					diagram.setElement(model);
123
				}
124
				try {
125
					Map options = new HashMap();
126
					options.put(XMIResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$
127
					modelResource.save(options);
128
					diagramResource.save(Collections.EMPTY_MAP);
129
				} catch (IOException e) {
130
131
					UMLDiagramEditorPlugin.getInstance().logError("Unable to store model and diagram resources", e); //$NON-NLS-1$
132
				}
133
				return CommandResult.newOKCommandResult();
134
			}
135
		};
136
137
		try {
138
			OperationHistoryFactory.getOperationHistory().execute(command, new SubProgressMonitor(progressMonitor, 1), null);
139
		} catch (ExecutionException e) {
140
			UMLDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
141
		}
142
143
		try {
144
			modelFile.setCharset("UTF-8", new SubProgressMonitor(progressMonitor, 1)); //$NON-NLS-1$
145
		} catch (CoreException e) {
146
			UMLDiagramEditorPlugin.getInstance().logError("Unable to set charset for model file", e); //$NON-NLS-1$
147
		}
148
		try {
149
			diagramFile.setCharset("UTF-8", new SubProgressMonitor(progressMonitor, 1)); //$NON-NLS-1$
150
		} catch (CoreException e) {
151
			UMLDiagramEditorPlugin.getInstance().logError("Unable to set charset for diagram file", e); //$NON-NLS-1$
152
		}
153
154
		return diagramFile;
155
	}
156
157
	/**
158
	 * Create a new instance of domain element associated with canvas.
159
	 * @generated NOT
160
	 */
161
	private static org.eclipse.uml2.uml.Package createInitialModel() {
162
		org.eclipse.uml2.uml.Package root = UMLFactory.eINSTANCE.createModel();
163
		root.setName("Model");
164
		return root;
165
	}
166
167
	/**
168
	 * @generated
169
	 */
170
	private static EObject createInitialRoot(org.eclipse.uml2.uml.Package model) {
171
		return model;
172
	}
173
174
	/**
175
	 * @generated
176
	 */
177
	public static IFile createNewFile(IPath containerPath, String fileName, Shell shell) {
178
		IPath newFilePath = containerPath.append(fileName);
179
		IFile newFileHandle = ResourcesPlugin.getWorkspace().getRoot().getFile(newFilePath);
180
		try {
181
			createFile(newFileHandle);
182
		} catch (CoreException e) {
183
			ErrorDialog.openError(shell, "Creation Problems", null, e.getStatus());
184
			return null;
185
		}
186
		return newFileHandle;
187
	}
188
189
	/**
190
	 * @generated
191
	 */
192
	protected static void createFile(IFile fileHandle) throws CoreException {
193
		try {
194
			fileHandle.create(new ByteArrayInputStream(new byte[0]), false, new NullProgressMonitor());
195
		} catch (CoreException e) {
196
			// If the file already existed locally, just refresh to get contents
197
			if (e.getStatus().getCode() == IResourceStatus.PATH_OCCUPIED) {
198
				fileHandle.refreshLocal(IResource.DEPTH_ZERO, null);
199
			} else {
200
				throw e;
201
			}
202
		}
203
	}
204
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/instance/TokenMgrError.java (+144 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.instance;
14
15
public class TokenMgrError extends Error
16
{
17
   /*
18
    * Ordinals for various reasons why an Error of this type can be thrown.
19
    */
20
21
   /**
22
    * Lexical error occured.
23
    */
24
   static final int LEXICAL_ERROR = 0;
25
26
   /**
27
    * An attempt wass made to create a second instance of a static token manager.
28
    */
29
   static final int STATIC_LEXER_ERROR = 1;
30
31
   /**
32
    * Tried to change to an invalid lexical state.
33
    */
34
   static final int INVALID_LEXICAL_STATE = 2;
35
36
   /**
37
    * Detected (and bailed out of) an infinite loop in the token manager.
38
    */
39
   static final int LOOP_DETECTED = 3;
40
41
   /**
42
    * Indicates the reason why the exception is thrown. It will have
43
    * one of the above 4 values.
44
    */
45
   int errorCode;
46
47
   /**
48
    * Replaces unprintable characters by their espaced (or unicode escaped)
49
    * equivalents in the given string
50
    */
51
   protected static final String addEscapes(String str) {
52
      StringBuffer retval = new StringBuffer();
53
      char ch;
54
      for (int i = 0; i < str.length(); i++) {
55
        switch (str.charAt(i))
56
        {
57
           case 0 :
58
              continue;
59
           case '\b':
60
              retval.append("\\b");
61
              continue;
62
           case '\t':
63
              retval.append("\\t");
64
              continue;
65
           case '\n':
66
              retval.append("\\n");
67
              continue;
68
           case '\f':
69
              retval.append("\\f");
70
              continue;
71
           case '\r':
72
              retval.append("\\r");
73
              continue;
74
           case '\"':
75
              retval.append("\\\"");
76
              continue;
77
           case '\'':
78
              retval.append("\\\'");
79
              continue;
80
           case '\\':
81
              retval.append("\\\\");
82
              continue;
83
           default:
84
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
85
                 String s = "0000" + Integer.toString(ch, 16);
86
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
87
              } else {
88
                 retval.append(ch);
89
              }
90
              continue;
91
        }
92
      }
93
      return retval.toString();
94
   }
95
96
   /**
97
    * Returns a detailed message for the Error when it is thrown by the
98
    * token manager to indicate a lexical error.
99
    * Parameters : 
100
    *    EOFSeen     : indicates if EOF caused the lexicl error
101
    *    curLexState : lexical state in which this error occured
102
    *    errorLine   : line number when the error occured
103
    *    errorColumn : column number when the error occured
104
    *    errorAfter  : prefix that was seen before this error occured
105
    *    curchar     : the offending character
106
    * Note: You can customize the lexical error message by modifying this method.
107
    */
108
   protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
109
      return("Lexical error at line " +
110
           errorLine + ", column " +
111
           errorColumn + ".  Encountered: " +
112
           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
113
           "after : \"" + addEscapes(errorAfter) + "\"");
114
   }
115
116
   /**
117
    * You can also modify the body of this method to customize your error messages.
118
    * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
119
    * of end-users concern, so you can return something like : 
120
    *
121
    *     "Internal Error : Please file a bug report .... "
122
    *
123
    * from this method for such cases in the release version of your parser.
124
    */
125
   public String getMessage() {
126
      return super.getMessage();
127
   }
128
129
   /*
130
    * Constructors of various flavors follow.
131
    */
132
133
   public TokenMgrError() {
134
   }
135
136
   public TokenMgrError(String message, int reason) {
137
      super(message);
138
      errorCode = reason;
139
   }
140
141
   public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
142
      this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
143
   }
144
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationClassOperationsViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class AssociationClassOperationsViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassOperationsEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/property/PropertyToString.java (+153 lines)
Added Link Here
1
/*
2
 * Copyright (c) 2006 Borland Software Corporation
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    Michael Golubev (Borland) - initial API and implementation
11
 */
12
13
package org.eclipse.uml2.diagram.clazz.parser.property;
14
15
import java.util.Arrays;
16
import java.util.Iterator;
17
import java.util.LinkedList;
18
import java.util.List;
19
20
import org.eclipse.emf.ecore.EObject;
21
import org.eclipse.emf.ecore.EStructuralFeature;
22
import org.eclipse.uml2.diagram.parser.AbstractToString;
23
import org.eclipse.uml2.uml.Property;
24
import org.eclipse.uml2.uml.UMLFactory;
25
import org.eclipse.uml2.uml.UMLPackage;
26
import org.eclipse.uml2.uml.ValueSpecification;
27
28
public abstract class PropertyToString extends AbstractToString {
29
	private static final Property DEFAULT_VALUES_PROTOTYPE = UMLFactory.eINSTANCE.createProperty();
30
	
31
	public static class EDIT extends PropertyToString {
32
		public String getToString(EObject object, int flags) {
33
			Property property = asProperty(object);
34
			StringBuffer result = new StringBuffer();
35
			result.append(getVisibility(property));
36
			result.append(getIsDerived(property));
37
			appendName(result, property);
38
			appendType(result, property);
39
			appendMultiplicity(result, property);
40
			appendDefault(result, property);
41
			appendPropertyModifiers(result, property);
42
			
43
			return result.toString();
44
		}
45
		
46
		public boolean isAffectingFeature(EStructuralFeature feature) {
47
			throw new UnsupportedOperationException("I am edit toString, I am not expected to be asked");
48
		}
49
		
50
	}
51
	
52
	public static class VIEW extends PropertyToString implements WithReferences {
53
		private static final List AFFECTING = Arrays.asList(new EStructuralFeature[] {
54
			UMLPackage.eINSTANCE.getNamedElement_Visibility(),
55
			UMLPackage.eINSTANCE.getProperty_IsDerived(),		
56
			UMLPackage.eINSTANCE.getProperty_DefaultValue(),
57
			UMLPackage.eINSTANCE.getNamedElement_Name(),
58
			UMLPackage.eINSTANCE.getTypedElement_Type(),
59
			UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue(),
60
			UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue(),
61
			UMLPackage.eINSTANCE.getLiteralUnlimitedNatural_Value(), 
62
			UMLPackage.eINSTANCE.getLiteralInteger_Value(),
63
			UMLPackage.eINSTANCE.getLiteralString_Value(),
64
		});
65
		
66
		public String getToString(EObject object, int flags) {
67
			Property property = asProperty(object);
68
			StringBuffer result = new StringBuffer();
69
			result.append(getVisibility(property));
70
			result.append(getIsDerived(property));
71
			result.append(property.getName());
72
			appendType(result, property);
73
			appendMultiplicity(result, property);
74
			appendDefault(result, property);
75
			return result.toString();
76
		}
77
		
78
		public boolean isAffectingFeature(EStructuralFeature feature) {
79
			return AFFECTING.contains(feature);
80
		}
81
		
82
		public List getAdditionalReferencedElements(EObject object) {
83
			Property property = asProperty(object);
84
			List result = new LinkedList();
85
			result.add(property);
86
			ValueSpecification upper = property.getUpperValue();
87
			if (upper != null){
88
				result.add(upper);
89
			}
90
			ValueSpecification lower = property.getLowerValue();
91
			if (lower != null){
92
				result.add(lower);
93
			}
94
			if (property.getType() != null){
95
				result.add(property.getType());
96
			}
97
			return result;
98
		}
99
		
100
	}
101
	
102
	protected Property asProperty(EObject object){
103
		if (false == object instanceof Property){
104
			throw new IllegalStateException("I can not provide toString for: " + object);
105
		}
106
		return (Property)object;
107
	}
108
	
109
	protected void appendPropertyModifiers(StringBuffer result, Property property) {
110
		ModifiersBuilder builder = new ModifiersBuilder();
111
		if (property.isReadOnly()){
112
			builder.appendModifier("readOnly");
113
		}
114
		if (property.isDerivedUnion()){
115
			builder.appendModifier("union");
116
		}
117
		if (property.isOrdered()){
118
			builder.appendModifier("ordered");
119
		}
120
		if (property.isUnique() != DEFAULT_VALUES_PROTOTYPE.isUnique()){
121
			builder.appendModifier(property.isUnique() ? "unique" : "nonunique");
122
		}
123
		for (Iterator subsets = property.getSubsettedProperties().iterator(); subsets.hasNext();){
124
			Property next = (Property) subsets.next();
125
			String nextName = next.getName();
126
			if (!isEmpty(nextName)){
127
				builder.appendModifier("subsets " + nextName);
128
			}
129
		}
130
		for (Iterator redefines = property.getRedefinedProperties().iterator(); redefines.hasNext();){
131
			Property next = (Property) redefines.next();
132
			String nextName = next.getName();
133
			if (!isEmpty(nextName)){
134
				builder.appendModifier("redefines " + nextName);
135
			}
136
		}
137
		builder.writeInto(result);
138
	}
139
	
140
	protected void appendDefault(StringBuffer result, Property property) {
141
		String def = property.getDefault();
142
		if (isEmpty(def)){
143
			return;
144
		}
145
		result.append(" = ");
146
		result.append(def);
147
	}
148
149
	protected String getIsDerived(Property property) {
150
		return property.isDerived() ? "/" : "";
151
	}
152
	
153
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/InstanceSpecificationEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class InstanceSpecificationEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/DependencyViewFactory.java (+52 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
10
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.View;
13
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyNameEditPart;
14
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
15
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
16
17
/**
18
 * @generated
19
 */
20
public class DependencyViewFactory extends AbstractShapeViewFactory {
21
22
	/**
23
	 * @generated 
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
28
		styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
29
		styles.add(NotationFactory.eINSTANCE.createFillStyle());
30
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
31
		return styles;
32
	}
33
34
	/**
35
	 * @generated
36
	 */
37
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
38
		if (semanticHint == null) {
39
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.DependencyEditPart.VISUAL_ID);
40
			view.setType(semanticHint);
41
		}
42
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
43
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
44
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
45
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
46
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
47
			view.getEAnnotations().add(shortcutAnnotation);
48
		}
49
		getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(DependencyNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
50
	}
51
52
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/operation/Token.java (+92 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.operation;
14
15
/**
16
 * Describes the input token stream.
17
 */
18
19
public class Token {
20
21
  /**
22
   * An integer that describes the kind of this token.  This numbering
23
   * system is determined by JavaCCParser, and a table of these numbers is
24
   * stored in the file ...Constants.java.
25
   */
26
  public int kind;
27
28
  /**
29
   * beginLine and beginColumn describe the position of the first character
30
   * of this token; endLine and endColumn describe the position of the
31
   * last character of this token.
32
   */
33
  public int beginLine, beginColumn, endLine, endColumn;
34
35
  /**
36
   * The string image of the token.
37
   */
38
  public String image;
39
40
  /**
41
   * A reference to the next regular (non-special) token from the input
42
   * stream.  If this is the last token from the input stream, or if the
43
   * token manager has not read tokens beyond this one, this field is
44
   * set to null.  This is true only if this token is also a regular
45
   * token.  Otherwise, see below for a description of the contents of
46
   * this field.
47
   */
48
  public Token next;
49
50
  /**
51
   * This field is used to access special tokens that occur prior to this
52
   * token, but after the immediately preceding regular (non-special) token.
53
   * If there are no such special tokens, this field is set to null.
54
   * When there are more than one such special token, this field refers
55
   * to the last of these special tokens, which in turn refers to the next
56
   * previous special token through its specialToken field, and so on
57
   * until the first special token (whose specialToken field is null).
58
   * The next fields of special tokens refer to other special tokens that
59
   * immediately follow it (without an intervening regular token).  If there
60
   * is no such token, this field is null.
61
   */
62
  public Token specialToken;
63
64
  /**
65
   * Returns the image.
66
   */
67
  public String toString()
68
  {
69
     return image;
70
  }
71
72
  /**
73
   * Returns a new Token object, by default. However, if you want, you
74
   * can create and return subclass objects based on the value of ofKind.
75
   * Simply add the cases to the switch for all those special cases.
76
   * For example, if you have a subclass of Token called IDToken that
77
   * you want to create if ofKind is ID, simlpy add something like :
78
   *
79
   *    case MyParserConstants.ID : return new IDToken();
80
   *
81
   * to the following switch statement. Then you can cast matchedToken
82
   * variable to the appropriate type and use it in your lexical actions.
83
   */
84
  public static final Token newToken(int ofKind)
85
  {
86
     switch(ofKind)
87
     {
88
       default : return new Token();
89
     }
90
  }
91
92
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/end/JavaCharStream.java (+558 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.end;
14
15
/**
16
 * An implementation of interface CharStream, where the stream is assumed to
17
 * contain only ASCII characters (with java-like unicode escape processing).
18
 */
19
20
public class JavaCharStream
21
{
22
  public static final boolean staticFlag = false;
23
  static final int hexval(char c) throws java.io.IOException {
24
    switch(c)
25
    {
26
       case '0' :
27
          return 0;
28
       case '1' :
29
          return 1;
30
       case '2' :
31
          return 2;
32
       case '3' :
33
          return 3;
34
       case '4' :
35
          return 4;
36
       case '5' :
37
          return 5;
38
       case '6' :
39
          return 6;
40
       case '7' :
41
          return 7;
42
       case '8' :
43
          return 8;
44
       case '9' :
45
          return 9;
46
47
       case 'a' :
48
       case 'A' :
49
          return 10;
50
       case 'b' :
51
       case 'B' :
52
          return 11;
53
       case 'c' :
54
       case 'C' :
55
          return 12;
56
       case 'd' :
57
       case 'D' :
58
          return 13;
59
       case 'e' :
60
       case 'E' :
61
          return 14;
62
       case 'f' :
63
       case 'F' :
64
          return 15;
65
    }
66
67
    throw new java.io.IOException(); // Should never come here
68
  }
69
70
  public int bufpos = -1;
71
  int bufsize;
72
  int available;
73
  int tokenBegin;
74
  protected int bufline[];
75
  protected int bufcolumn[];
76
77
  protected int column = 0;
78
  protected int line = 1;
79
80
  protected boolean prevCharIsCR = false;
81
  protected boolean prevCharIsLF = false;
82
83
  protected java.io.Reader inputStream;
84
85
  protected char[] nextCharBuf;
86
  protected char[] buffer;
87
  protected int maxNextCharInd = 0;
88
  protected int nextCharInd = -1;
89
  protected int inBuf = 0;
90
91
  protected void ExpandBuff(boolean wrapAround)
92
  {
93
     char[] newbuffer = new char[bufsize + 2048];
94
     int newbufline[] = new int[bufsize + 2048];
95
     int newbufcolumn[] = new int[bufsize + 2048];
96
97
     try
98
     {
99
        if (wrapAround)
100
        {
101
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
102
           System.arraycopy(buffer, 0, newbuffer,
103
                                             bufsize - tokenBegin, bufpos);
104
           buffer = newbuffer;
105
106
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
107
           System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
108
           bufline = newbufline;
109
110
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
111
           System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
112
           bufcolumn = newbufcolumn;
113
114
           bufpos += (bufsize - tokenBegin);
115
        }
116
        else
117
        {
118
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
119
           buffer = newbuffer;
120
121
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
122
           bufline = newbufline;
123
124
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
125
           bufcolumn = newbufcolumn;
126
127
           bufpos -= tokenBegin;
128
        }
129
     }
130
     catch (Throwable t)
131
     {
132
        throw new Error(t.getMessage());
133
     }
134
135
     available = (bufsize += 2048);
136
     tokenBegin = 0;
137
  }
138
139
  protected void FillBuff() throws java.io.IOException
140
  {
141
     int i;
142
     if (maxNextCharInd == 4096)
143
        maxNextCharInd = nextCharInd = 0;
144
145
     try {
146
        if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
147
                                            4096 - maxNextCharInd)) == -1)
148
        {
149
           inputStream.close();
150
           throw new java.io.IOException();
151
        }
152
        else
153
           maxNextCharInd += i;
154
        return;
155
     }
156
     catch(java.io.IOException e) {
157
        if (bufpos != 0)
158
        {
159
           --bufpos;
160
           backup(0);
161
        }
162
        else
163
        {
164
           bufline[bufpos] = line;
165
           bufcolumn[bufpos] = column;
166
        }
167
        throw e;
168
     }
169
  }
170
171
  protected char ReadByte() throws java.io.IOException
172
  {
173
     if (++nextCharInd >= maxNextCharInd)
174
        FillBuff();
175
176
     return nextCharBuf[nextCharInd];
177
  }
178
179
  public char BeginToken() throws java.io.IOException
180
  {     
181
     if (inBuf > 0)
182
     {
183
        --inBuf;
184
185
        if (++bufpos == bufsize)
186
           bufpos = 0;
187
188
        tokenBegin = bufpos;
189
        return buffer[bufpos];
190
     }
191
192
     tokenBegin = 0;
193
     bufpos = -1;
194
195
     return readChar();
196
  }     
197
198
  protected void AdjustBuffSize()
199
  {
200
     if (available == bufsize)
201
     {
202
        if (tokenBegin > 2048)
203
        {
204
           bufpos = 0;
205
           available = tokenBegin;
206
        }
207
        else
208
           ExpandBuff(false);
209
     }
210
     else if (available > tokenBegin)
211
        available = bufsize;
212
     else if ((tokenBegin - available) < 2048)
213
        ExpandBuff(true);
214
     else
215
        available = tokenBegin;
216
  }
217
218
  protected void UpdateLineColumn(char c)
219
  {
220
     column++;
221
222
     if (prevCharIsLF)
223
     {
224
        prevCharIsLF = false;
225
        line += (column = 1);
226
     }
227
     else if (prevCharIsCR)
228
     {
229
        prevCharIsCR = false;
230
        if (c == '\n')
231
        {
232
           prevCharIsLF = true;
233
        }
234
        else
235
           line += (column = 1);
236
     }
237
238
     switch (c)
239
     {
240
        case '\r' :
241
           prevCharIsCR = true;
242
           break;
243
        case '\n' :
244
           prevCharIsLF = true;
245
           break;
246
        case '\t' :
247
           column--;
248
           column += (8 - (column & 07));
249
           break;
250
        default :
251
           break;
252
     }
253
254
     bufline[bufpos] = line;
255
     bufcolumn[bufpos] = column;
256
  }
257
258
  public char readChar() throws java.io.IOException
259
  {
260
     if (inBuf > 0)
261
     {
262
        --inBuf;
263
264
        if (++bufpos == bufsize)
265
           bufpos = 0;
266
267
        return buffer[bufpos];
268
     }
269
270
     char c;
271
272
     if (++bufpos == available)
273
        AdjustBuffSize();
274
275
     if ((buffer[bufpos] = c = ReadByte()) == '\\')
276
     {
277
        UpdateLineColumn(c);
278
279
        int backSlashCnt = 1;
280
281
        for (;;) // Read all the backslashes
282
        {
283
           if (++bufpos == available)
284
              AdjustBuffSize();
285
286
           try
287
           {
288
              if ((buffer[bufpos] = c = ReadByte()) != '\\')
289
              {
290
                 UpdateLineColumn(c);
291
                 // found a non-backslash char.
292
                 if ((c == 'u') && ((backSlashCnt & 1) == 1))
293
                 {
294
                    if (--bufpos < 0)
295
                       bufpos = bufsize - 1;
296
297
                    break;
298
                 }
299
300
                 backup(backSlashCnt);
301
                 return '\\';
302
              }
303
           }
304
           catch(java.io.IOException e)
305
           {
306
              if (backSlashCnt > 1)
307
                 backup(backSlashCnt);
308
309
              return '\\';
310
           }
311
312
           UpdateLineColumn(c);
313
           backSlashCnt++;
314
        }
315
316
        // Here, we have seen an odd number of backslash's followed by a 'u'
317
        try
318
        {
319
           while ((c = ReadByte()) == 'u')
320
              ++column;
321
322
           buffer[bufpos] = c = (char)(hexval(c) << 12 |
323
                                       hexval(ReadByte()) << 8 |
324
                                       hexval(ReadByte()) << 4 |
325
                                       hexval(ReadByte()));
326
327
           column += 4;
328
        }
329
        catch(java.io.IOException e)
330
        {
331
           throw new Error("Invalid escape character at line " + line +
332
                                         " column " + column + ".");
333
        }
334
335
        if (backSlashCnt == 1)
336
           return c;
337
        else
338
        {
339
           backup(backSlashCnt - 1);
340
           return '\\';
341
        }
342
     }
343
     else
344
     {
345
        UpdateLineColumn(c);
346
        return (c);
347
     }
348
  }
349
350
  /**
351
   * @deprecated 
352
   * @see #getEndColumn
353
   */
354
355
  public int getColumn() {
356
     return bufcolumn[bufpos];
357
  }
358
359
  /**
360
   * @deprecated 
361
   * @see #getEndLine
362
   */
363
364
  public int getLine() {
365
     return bufline[bufpos];
366
  }
367
368
  public int getEndColumn() {
369
     return bufcolumn[bufpos];
370
  }
371
372
  public int getEndLine() {
373
     return bufline[bufpos];
374
  }
375
376
  public int getBeginColumn() {
377
     return bufcolumn[tokenBegin];
378
  }
379
380
  public int getBeginLine() {
381
     return bufline[tokenBegin];
382
  }
383
384
  public void backup(int amount) {
385
386
    inBuf += amount;
387
    if ((bufpos -= amount) < 0)
388
       bufpos += bufsize;
389
  }
390
391
  public JavaCharStream(java.io.Reader dstream,
392
                 int startline, int startcolumn, int buffersize)
393
  {
394
    inputStream = dstream;
395
    line = startline;
396
    column = startcolumn - 1;
397
398
    available = bufsize = buffersize;
399
    buffer = new char[buffersize];
400
    bufline = new int[buffersize];
401
    bufcolumn = new int[buffersize];
402
    nextCharBuf = new char[4096];
403
  }
404
405
  public JavaCharStream(java.io.Reader dstream,
406
                                        int startline, int startcolumn)
407
  {
408
     this(dstream, startline, startcolumn, 4096);
409
  }
410
411
  public JavaCharStream(java.io.Reader dstream)
412
  {
413
     this(dstream, 1, 1, 4096);
414
  }
415
  public void ReInit(java.io.Reader dstream,
416
                 int startline, int startcolumn, int buffersize)
417
  {
418
    inputStream = dstream;
419
    line = startline;
420
    column = startcolumn - 1;
421
422
    if (buffer == null || buffersize != buffer.length)
423
    {
424
      available = bufsize = buffersize;
425
      buffer = new char[buffersize];
426
      bufline = new int[buffersize];
427
      bufcolumn = new int[buffersize];
428
      nextCharBuf = new char[4096];
429
    }
430
    prevCharIsLF = prevCharIsCR = false;
431
    tokenBegin = inBuf = maxNextCharInd = 0;
432
    nextCharInd = bufpos = -1;
433
  }
434
435
  public void ReInit(java.io.Reader dstream,
436
                                        int startline, int startcolumn)
437
  {
438
     ReInit(dstream, startline, startcolumn, 4096);
439
  }
440
441
  public void ReInit(java.io.Reader dstream)
442
  {
443
     ReInit(dstream, 1, 1, 4096);
444
  }
445
  public JavaCharStream(java.io.InputStream dstream, int startline,
446
  int startcolumn, int buffersize)
447
  {
448
     this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
449
  }
450
451
  public JavaCharStream(java.io.InputStream dstream, int startline,
452
                                                           int startcolumn)
453
  {
454
     this(dstream, startline, startcolumn, 4096);
455
  }
456
457
  public JavaCharStream(java.io.InputStream dstream)
458
  {
459
     this(dstream, 1, 1, 4096);
460
  }
461
462
  public void ReInit(java.io.InputStream dstream, int startline,
463
  int startcolumn, int buffersize)
464
  {
465
     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
466
  }
467
  public void ReInit(java.io.InputStream dstream, int startline,
468
                                                           int startcolumn)
469
  {
470
     ReInit(dstream, startline, startcolumn, 4096);
471
  }
472
  public void ReInit(java.io.InputStream dstream)
473
  {
474
     ReInit(dstream, 1, 1, 4096);
475
  }
476
477
  public String GetImage()
478
  {
479
     if (bufpos >= tokenBegin)
480
        return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
481
     else
482
        return new String(buffer, tokenBegin, bufsize - tokenBegin) +
483
                              new String(buffer, 0, bufpos + 1);
484
  }
485
486
  public char[] GetSuffix(int len)
487
  {
488
     char[] ret = new char[len];
489
490
     if ((bufpos + 1) >= len)
491
        System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
492
     else
493
     {
494
        System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
495
                                                          len - bufpos - 1);
496
        System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
497
     }
498
499
     return ret;
500
  }
501
502
  public void Done()
503
  {
504
     nextCharBuf = null;
505
     buffer = null;
506
     bufline = null;
507
     bufcolumn = null;
508
  }
509
510
  /**
511
   * Method to adjust line and column numbers for the start of a token.
512
   */
513
  public void adjustBeginLineColumn(int newLine, int newCol)
514
  {
515
     int start = tokenBegin;
516
     int len;
517
518
     if (bufpos >= tokenBegin)
519
     {
520
        len = bufpos - tokenBegin + inBuf + 1;
521
     }
522
     else
523
     {
524
        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
525
     }
526
527
     int i = 0, j = 0, k = 0;
528
     int nextColDiff = 0, columnDiff = 0;
529
530
     while (i < len &&
531
            bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
532
     {
533
        bufline[j] = newLine;
534
        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
535
        bufcolumn[j] = newCol + columnDiff;
536
        columnDiff = nextColDiff;
537
        i++;
538
     } 
539
540
     if (i < len)
541
     {
542
        bufline[j] = newLine++;
543
        bufcolumn[j] = newCol + columnDiff;
544
545
        while (i++ < len)
546
        {
547
           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
548
              bufline[j] = newLine++;
549
           else
550
              bufline[j] = newLine;
551
        }
552
     }
553
554
     line = bufline[j];
555
     column = bufcolumn[j];
556
  }
557
558
}
(-)src/org/eclipse/uml2/diagram/clazz/providers/UMLAbstractParser.java (+377 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.providers;
2
3
import java.text.MessageFormat;
4
import java.text.ParsePosition;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EClassifier;
8
import org.eclipse.emf.ecore.EDataType;
9
import org.eclipse.emf.ecore.EEnum;
10
import org.eclipse.emf.ecore.EEnumLiteral;
11
import org.eclipse.emf.ecore.EObject;
12
import org.eclipse.emf.ecore.EStructuralFeature;
13
import org.eclipse.gmf.runtime.common.core.command.ICommand;
14
import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
15
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
16
import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
17
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
18
import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
19
import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
20
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
21
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
22
23
/**
24
 * @generated
25
 */
26
public abstract class UMLAbstractParser implements IParser {
27
28
	/**
29
	 * @generated
30
	 */
31
	private String viewPattern;
32
33
	/**
34
	 * @generated
35
	 */
36
	private MessageFormat viewProcessor;
37
38
	/**
39
	 * @generated
40
	 */
41
	private String editPattern;
42
43
	/**
44
	 * @generated
45
	 */
46
	private MessageFormat editProcessor;
47
48
	/**
49
	 * @generated
50
	 */
51
	public String getViewPattern() {
52
		return viewPattern;
53
	}
54
55
	/**
56
	 * @generated
57
	 */
58
	protected MessageFormat getViewProcessor() {
59
		return viewProcessor;
60
	}
61
62
	/**
63
	 * @generated
64
	 */
65
	public void setViewPattern(String viewPattern) {
66
		this.viewPattern = viewPattern;
67
		viewProcessor = createViewProcessor(viewPattern);
68
	}
69
70
	/**
71
	 * @generated
72
	 */
73
	protected MessageFormat createViewProcessor(String viewPattern) {
74
		return new MessageFormat(viewPattern);
75
	}
76
77
	/**
78
	 * @generated
79
	 */
80
	public String getEditPattern() {
81
		return editPattern;
82
	}
83
84
	/**
85
	 * @generated
86
	 */
87
	protected MessageFormat getEditProcessor() {
88
		return editProcessor;
89
	}
90
91
	/**
92
	 * @generated
93
	 */
94
	public void setEditPattern(String editPattern) {
95
		this.editPattern = editPattern;
96
		editProcessor = createEditProcessor(editPattern);
97
	}
98
99
	/**
100
	 * @generated
101
	 */
102
	protected MessageFormat createEditProcessor(String editPattern) {
103
		return new MessageFormat(editPattern);
104
	}
105
106
	/**
107
	 * @generated
108
	 */
109
	public String getPrintString(IAdaptable adapter, int flags) {
110
		return getStringByPattern(adapter, flags, getViewPattern(), getViewProcessor());
111
	}
112
113
	/**
114
	 * @generated
115
	 */
116
	public String getEditString(IAdaptable adapter, int flags) {
117
		return getStringByPattern(adapter, flags, getEditPattern(), getEditProcessor());
118
	}
119
120
	/**
121
	 * @generated
122
	 */
123
	protected abstract String getStringByPattern(IAdaptable adapter, int flags, String pattern, MessageFormat processor);
124
125
	/**
126
	 * @generated
127
	 */
128
	public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
129
		ParsePosition pos = new ParsePosition(0);
130
		Object[] values = getEditProcessor().parse(editString, pos);
131
		if (values == null) {
132
			return new ParserEditStatus(UMLDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, "Invalid input at " + pos.getErrorIndex());
133
		}
134
		return validateNewValues(values);
135
	}
136
137
	/**
138
	 * @generated
139
	 */
140
	protected IParserEditStatus validateNewValues(Object[] values) {
141
		return ParserEditStatus.EDITABLE_STATUS;
142
	}
143
144
	/**
145
	 * @generated
146
	 */
147
	public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
148
		Object[] values = getEditProcessor().parse(newString, new ParsePosition(0));
149
		if (values == null || validateNewValues(values).getCode() != IParserEditStatus.EDITABLE) {
150
			return UnexecutableCommand.INSTANCE;
151
		}
152
		return getParseCommand(adapter, values);
153
	}
154
155
	/**
156
	 * @generated
157
	 */
158
	protected abstract ICommand getParseCommand(IAdaptable adapter, Object[] values);
159
160
	/**
161
	 * @generated
162
	 */
163
	public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
164
		return null;
165
	}
166
167
	/**
168
	 * @generated
169
	 */
170
	protected ICommand getModificationCommand(EObject element, EStructuralFeature feature, Object value) {
171
		value = getValidNewValue(feature, value);
172
		if (value instanceof InvalidValue) {
173
			return UnexecutableCommand.INSTANCE;
174
		}
175
		SetRequest request = new SetRequest(element, feature, value);
176
		return new SetValueCommand(request);
177
	}
178
179
	/**
180
	 * @generated
181
	 */
182
	protected Object getValidValue(EStructuralFeature feature, Object value) {
183
		EClassifier type = feature.getEType();
184
		if (type instanceof EDataType) {
185
			Class iClass = type.getInstanceClass();
186
			if (String.class.equals(iClass)) {
187
				if (value == null) {
188
					value = ""; //$NON-NLS-1$
189
				}
190
			}
191
		}
192
		return value;
193
	}
194
195
	/**
196
	 * @generated
197
	 */
198
	protected Object getValidNewValue(EStructuralFeature feature, Object value) {
199
		EClassifier type = feature.getEType();
200
		if (type instanceof EDataType) {
201
			Class iClass = type.getInstanceClass();
202
			if (Boolean.TYPE.equals(iClass)) {
203
				if (value instanceof Boolean) {
204
					// ok
205
				} else if (value instanceof String) {
206
					value = Boolean.valueOf((String) value);
207
				} else {
208
					value = new InvalidValue("Value of type Boolean is expected");
209
				}
210
			} else if (Character.TYPE.equals(iClass)) {
211
				if (value instanceof Character) {
212
					// ok
213
				} else if (value instanceof String) {
214
					String s = (String) value;
215
					if (s.length() == 0) {
216
						value = null;
217
					} else {
218
						value = new Character(s.charAt(0));
219
					}
220
				} else {
221
					value = new InvalidValue("Value of type Character is expected");
222
				}
223
			} else if (Byte.TYPE.equals(iClass)) {
224
				if (value instanceof Byte) {
225
					// ok
226
				} else if (value instanceof Number) {
227
					value = new Byte(((Number) value).byteValue());
228
				} else if (value instanceof String) {
229
					String s = (String) value;
230
					if (s.length() == 0) {
231
						value = null;
232
					} else {
233
						try {
234
							value = Byte.valueOf(s);
235
						} catch (NumberFormatException nfe) {
236
							value = new InvalidValue("String value does not convert to Byte value");
237
						}
238
					}
239
				} else {
240
					value = new InvalidValue("Value of type Byte is expected");
241
				}
242
			} else if (Short.TYPE.equals(iClass)) {
243
				if (value instanceof Short) {
244
					// ok
245
				} else if (value instanceof Number) {
246
					value = new Short(((Number) value).shortValue());
247
				} else if (value instanceof String) {
248
					String s = (String) value;
249
					if (s.length() == 0) {
250
						value = null;
251
					} else {
252
						try {
253
							value = Short.valueOf(s);
254
						} catch (NumberFormatException nfe) {
255
							value = new InvalidValue("String value does not convert to Short value");
256
						}
257
					}
258
				} else {
259
					value = new InvalidValue("Value of type Short is expected");
260
				}
261
			} else if (Integer.TYPE.equals(iClass)) {
262
				if (value instanceof Integer) {
263
					// ok
264
				} else if (value instanceof Number) {
265
					value = new Integer(((Number) value).intValue());
266
				} else if (value instanceof String) {
267
					String s = (String) value;
268
					if (s.length() == 0) {
269
						value = null;
270
					} else {
271
						try {
272
							value = Integer.valueOf(s);
273
						} catch (NumberFormatException nfe) {
274
							value = new InvalidValue("String value does not convert to Integer value");
275
						}
276
					}
277
				} else {
278
					value = new InvalidValue("Value of type Integer is expected");
279
				}
280
			} else if (Long.TYPE.equals(iClass)) {
281
				if (value instanceof Long) {
282
					// ok
283
				} else if (value instanceof Number) {
284
					value = new Long(((Number) value).longValue());
285
				} else if (value instanceof String) {
286
					String s = (String) value;
287
					if (s.length() == 0) {
288
						value = null;
289
					} else {
290
						try {
291
							value = Long.valueOf(s);
292
						} catch (NumberFormatException nfe) {
293
							value = new InvalidValue("String value does not convert to Long value");
294
						}
295
					}
296
				} else {
297
					value = new InvalidValue("Value of type Long is expected");
298
				}
299
			} else if (Float.TYPE.equals(iClass)) {
300
				if (value instanceof Float) {
301
					// ok
302
				} else if (value instanceof Number) {
303
					value = new Float(((Number) value).floatValue());
304
				} else if (value instanceof String) {
305
					String s = (String) value;
306
					if (s.length() == 0) {
307
						value = null;
308
					} else {
309
						try {
310
							value = Float.valueOf(s);
311
						} catch (NumberFormatException nfe) {
312
							value = new InvalidValue("String value does not convert to Float value");
313
						}
314
					}
315
				} else {
316
					value = new InvalidValue("Value of type Float is expected");
317
				}
318
			} else if (Double.TYPE.equals(iClass)) {
319
				if (value instanceof Double) {
320
					// ok
321
				} else if (value instanceof Number) {
322
					value = new Double(((Number) value).doubleValue());
323
				} else if (value instanceof String) {
324
					String s = (String) value;
325
					if (s.length() == 0) {
326
						value = null;
327
					} else {
328
						try {
329
							value = Double.valueOf(s);
330
						} catch (NumberFormatException nfe) {
331
							value = new InvalidValue("String value does not convert to Double value");
332
						}
333
					}
334
				} else {
335
					value = new InvalidValue("Value of type Double is expected");
336
				}
337
			} else if (type instanceof EEnum) {
338
				if (value instanceof String) {
339
					EEnumLiteral literal = ((EEnum) type).getEEnumLiteralByLiteral((String) value);
340
					if (literal == null) {
341
						value = new InvalidValue("Unknown literal: " + value);
342
					} else {
343
						value = literal.getInstance();
344
					}
345
				} else {
346
					value = new InvalidValue("Value of type String is expected");
347
				}
348
			}
349
		}
350
		return value;
351
	}
352
353
	/**
354
	 * @generated
355
	 */
356
	protected class InvalidValue {
357
358
		/**
359
		 * @generated
360
		 */
361
		private String description;
362
363
		/**
364
		 * @generated
365
		 */
366
		public InvalidValue(String description) {
367
			this.description = description;
368
		}
369
370
		/**
371
		 * @generated
372
		 */
373
		public String toString() {
374
			return description;
375
		}
376
	}
377
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationName2ViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class AssociationName2ViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(-15));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/DataTypeEditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class DataTypeEditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/ClassOperationsViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class ClassOperationsViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.ClassOperationsEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-).project (+28 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>org.eclipse.uml2.diagram.clazz</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.jdt.core.javabuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
		<buildCommand>
14
			<name>org.eclipse.pde.ManifestBuilder</name>
15
			<arguments>
16
			</arguments>
17
		</buildCommand>
18
		<buildCommand>
19
			<name>org.eclipse.pde.SchemaBuilder</name>
20
			<arguments>
21
			</arguments>
22
		</buildCommand>
23
	</buildSpec>
24
	<natures>
25
		<nature>org.eclipse.jdt.core.javanature</nature>
26
		<nature>org.eclipse.pde.PluginNature</nature>
27
	</natures>
28
</projectDescription>
(-)src/org/eclipse/uml2/diagram/clazz/expressions/UMLAbstractExpression.java (+210 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.expressions;
2
3
import java.math.BigDecimal;
4
import java.math.BigInteger;
5
import java.util.Collection;
6
import java.util.Collections;
7
import java.util.Iterator;
8
import java.util.Map;
9
10
import org.eclipse.core.runtime.IStatus;
11
import org.eclipse.core.runtime.Platform;
12
import org.eclipse.core.runtime.Status;
13
import org.eclipse.emf.ecore.EClassifier;
14
import org.eclipse.emf.ecore.EObject;
15
import org.eclipse.emf.ecore.EStructuralFeature;
16
import org.eclipse.emf.ecore.ETypedElement;
17
import org.eclipse.emf.ecore.util.EcoreUtil;
18
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
19
20
/**
21
 * @generated
22
 */
23
public abstract class UMLAbstractExpression {
24
25
	/**
26
	 * @generated
27
	 */
28
	private static final boolean DISABLED_NO_IMPL_EXCEPTION_LOG = Boolean.valueOf(
29
			Platform.getDebugOption(UMLDiagramEditorPlugin.getInstance().getBundle().getSymbolicName() + "/debug/disableNoExprImplExceptionLog")).booleanValue();
30
31
	/**
32
	 * @generated
33
	 */
34
	private String body;
35
36
	/**
37
	 * @generated
38
	 */
39
	private EClassifier context;
40
41
	/**
42
	 * @generated
43
	 */
44
	private IStatus status = Status.OK_STATUS;
45
46
	/**
47
	 * @generated
48
	 */
49
	protected UMLAbstractExpression(EClassifier context) {
50
		this.context = context;
51
	}
52
53
	/**
54
	 * @generated
55
	 */
56
	protected UMLAbstractExpression(String body, EClassifier context, Map env) {
57
		this.body = body;
58
		this.context = context;
59
	}
60
61
	/**
62
	 * @generated
63
	 */
64
	protected void setStatus(int severity, String message, Throwable throwable) {
65
		String pluginID = UMLDiagramEditorPlugin.ID;
66
		this.status = new Status(severity, pluginID, -1, (message != null) ? message : "", throwable); //$NON-NLS-1$
67
		if (!this.status.isOK()) {
68
			UMLDiagramEditorPlugin.getInstance().logError("Expression problem:" + message + "body:" + body, throwable); //$NON-NLS-1$ //$NON-NLS-2$
69
70
		}
71
	}
72
73
	/**
74
	 * @generated
75
	 */
76
	protected abstract Object doEvaluate(Object context, Map env);
77
78
	/**
79
	 * @generated
80
	 */
81
	public Object evaluate(Object context) {
82
		return evaluate(context, Collections.EMPTY_MAP);
83
	}
84
85
	/**
86
	 * @generated
87
	 */
88
	public Object evaluate(Object context, Map env) {
89
		if (context().isInstance(context)) {
90
			try {
91
				return doEvaluate(context, env);
92
			} catch (Exception e) {
93
				if (DISABLED_NO_IMPL_EXCEPTION_LOG && e instanceof NoImplException) {
94
					return null;
95
				}
96
				UMLDiagramEditorPlugin.getInstance().logError("Expression evaluation failure: " + body, e);
97
			}
98
		}
99
		return null;
100
	}
101
102
	/**
103
	 * @generated
104
	 */
105
	public IStatus getStatus() {
106
		return status;
107
	}
108
109
	/**
110
	 * @generated
111
	 */
112
	public String body() {
113
		return body;
114
	}
115
116
	/**
117
	 * @generated
118
	 */
119
	public EClassifier context() {
120
		return context;
121
	}
122
123
	/**
124
	 * @generated
125
	 */
126
	public void assignTo(EStructuralFeature feature, EObject target) {
127
		Object value = evaluate(target);
128
		value = (value != null) ? performCast(value, feature) : null;
129
		if (feature.isMany()) {
130
			Collection destCollection = (Collection) target.eGet(feature);
131
			destCollection.clear();
132
			if (value instanceof Collection) {
133
				Collection valueCollection = (Collection) value;
134
				for (Iterator it = valueCollection.iterator(); it.hasNext();) {
135
					destCollection.add(performCast(it.next(), feature));
136
				}
137
			} else {
138
				destCollection.add(value);
139
			}
140
			return;
141
		}
142
		target.eSet(feature, value);
143
	}
144
145
	/**
146
	 * @generated
147
	 */
148
	protected Object performCast(Object value, ETypedElement targetType) {
149
		if (targetType.getEType() == null || targetType.getEType().getInstanceClass() == null) {
150
			return value;
151
		}
152
		Class targetClass = targetType.getEType().getInstanceClass();
153
		if (value != null && value instanceof Number) {
154
			Number num = (Number) value;
155
			Class valClass = value.getClass();
156
			Class targetWrapperClass = targetClass;
157
			if (targetClass.isPrimitive()) {
158
				targetWrapperClass = EcoreUtil.wrapperClassFor(targetClass);
159
			}
160
			if (valClass.equals(targetWrapperClass)) {
161
				return value;
162
			}
163
			if (Number.class.isAssignableFrom(targetWrapperClass)) {
164
				if (targetWrapperClass.equals(Byte.class))
165
					return new Byte(num.byteValue());
166
				if (targetWrapperClass.equals(Integer.class))
167
					return new Integer(num.intValue());
168
				if (targetWrapperClass.equals(Short.class))
169
					return new Short(num.shortValue());
170
				if (targetWrapperClass.equals(Long.class))
171
					return new Long(num.longValue());
172
				if (targetWrapperClass.equals(BigInteger.class))
173
					return BigInteger.valueOf(num.longValue());
174
				if (targetWrapperClass.equals(Float.class))
175
					return new Float(num.floatValue());
176
				if (targetWrapperClass.equals(Double.class))
177
					return new Double(num.doubleValue());
178
				if (targetWrapperClass.equals(BigDecimal.class))
179
					return new BigDecimal(num.doubleValue());
180
			}
181
		}
182
		return value;
183
	}
184
185
	/**
186
	 * @generated
187
	 */
188
	public static final UMLAbstractExpression createNullExpression(EClassifier context) {
189
		return new UMLAbstractExpression(context) {
190
191
			protected Object doEvaluate(Object context, Map env) {
192
				// TODO - log entry about not provider available for this expression
193
				return null;
194
			}
195
		};
196
	}
197
198
	/**
199
	 * @generated
200
	 */
201
	public static class NoImplException extends RuntimeException {
202
203
		/**
204
		 * @generated
205
		 */
206
		public NoImplException(String message) {
207
			super(message);
208
		}
209
	}
210
}
(-)src/org/eclipse/uml2/diagram/clazz/navigator/UMLNavigatorLabelProvider.java (+1277 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.navigator;
2
3
import org.eclipse.core.runtime.IAdaptable;
4
import org.eclipse.emf.ecore.EObject;
5
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
6
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
7
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
8
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
9
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.jface.resource.ImageDescriptor;
12
import org.eclipse.jface.resource.ImageRegistry;
13
import org.eclipse.jface.viewers.LabelProvider;
14
import org.eclipse.swt.graphics.Image;
15
import org.eclipse.ui.IMemento;
16
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
17
import org.eclipse.ui.navigator.ICommonLabelProvider;
18
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClass2EditPart;
19
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassEditPart;
20
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationClassNameEditPart;
21
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationEditPart;
22
import org.eclipse.uml2.diagram.clazz.edit.parts.AssociationNameEditPart;
23
import org.eclipse.uml2.diagram.clazz.edit.parts.Class2EditPart;
24
import org.eclipse.uml2.diagram.clazz.edit.parts.Class3EditPart;
25
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassEditPart;
26
import org.eclipse.uml2.diagram.clazz.edit.parts.ClassNameEditPart;
27
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintConstrainedElementEditPart;
28
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintEditPart;
29
import org.eclipse.uml2.diagram.clazz.edit.parts.ConstraintNameEditPart;
30
import org.eclipse.uml2.diagram.clazz.edit.parts.DataType2EditPart;
31
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeEditPart;
32
import org.eclipse.uml2.diagram.clazz.edit.parts.DataTypeNameEditPart;
33
import org.eclipse.uml2.diagram.clazz.edit.parts.Dependency2EditPart;
34
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyClientEditPart;
35
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyEditPart;
36
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyName2EditPart;
37
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencyNameEditPart;
38
import org.eclipse.uml2.diagram.clazz.edit.parts.DependencySupplierEditPart;
39
import org.eclipse.uml2.diagram.clazz.edit.parts.Enumeration2EditPart;
40
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationEditPart;
41
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationLiteralEditPart;
42
import org.eclipse.uml2.diagram.clazz.edit.parts.EnumerationNameEditPart;
43
import org.eclipse.uml2.diagram.clazz.edit.parts.GeneralizationEditPart;
44
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecification2EditPart;
45
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationEditPart;
46
import org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationNameEditPart;
47
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceEditPart;
48
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceNameEditPart;
49
import org.eclipse.uml2.diagram.clazz.edit.parts.InterfaceRealizationEditPart;
50
import org.eclipse.uml2.diagram.clazz.edit.parts.LiteralStringEditPart;
51
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation2EditPart;
52
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation3EditPart;
53
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation4EditPart;
54
import org.eclipse.uml2.diagram.clazz.edit.parts.Operation5EditPart;
55
import org.eclipse.uml2.diagram.clazz.edit.parts.OperationEditPart;
56
import org.eclipse.uml2.diagram.clazz.edit.parts.Package2EditPart;
57
import org.eclipse.uml2.diagram.clazz.edit.parts.Package3EditPart;
58
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
59
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageNameEditPart;
60
import org.eclipse.uml2.diagram.clazz.edit.parts.PortEditPart;
61
import org.eclipse.uml2.diagram.clazz.edit.parts.PortNameEditPart;
62
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveType2EditPart;
63
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeEditPart;
64
import org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeNameEditPart;
65
import org.eclipse.uml2.diagram.clazz.edit.parts.Property2EditPart;
66
import org.eclipse.uml2.diagram.clazz.edit.parts.Property3EditPart;
67
import org.eclipse.uml2.diagram.clazz.edit.parts.Property4EditPart;
68
import org.eclipse.uml2.diagram.clazz.edit.parts.Property5EditPart;
69
import org.eclipse.uml2.diagram.clazz.edit.parts.Property6EditPart;
70
import org.eclipse.uml2.diagram.clazz.edit.parts.PropertyEditPart;
71
import org.eclipse.uml2.diagram.clazz.edit.parts.PropertyNameEditPart;
72
import org.eclipse.uml2.diagram.clazz.edit.parts.SlotEditPart;
73
import org.eclipse.uml2.diagram.clazz.edit.parts.UsageEditPart;
74
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
75
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
76
import org.eclipse.uml2.diagram.clazz.providers.UMLElementTypes;
77
import org.eclipse.uml2.uml.Generalization;
78
import org.eclipse.uml2.uml.NamedElement;
79
80
/**
81
 * @generated
82
 */
83
public class UMLNavigatorLabelProvider extends LabelProvider implements ICommonLabelProvider {
84
85
	/**
86
	 * @generated
87
	 */
88
	static {
89
		UMLDiagramEditorPlugin.getInstance().getImageRegistry().put("Navigator?InvalidElement", ImageDescriptor.getMissingImageDescriptor());
90
		UMLDiagramEditorPlugin.getInstance().getImageRegistry().put("Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor());
91
		UMLDiagramEditorPlugin.getInstance().getImageRegistry().put("Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor());
92
	}
93
94
	/**
95
	 * @generated
96
	 */
97
	public Image getImage(Object element) {
98
		if (false == element instanceof UMLAbstractNavigatorItem) {
99
			return super.getImage(element);
100
		}
101
102
		UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element;
103
		if (!PackageEditPart.MODEL_ID.equals(abstractNavigatorItem.getModelID())) {
104
			return super.getImage(element);
105
		}
106
107
		if (abstractNavigatorItem instanceof UMLNavigatorItem) {
108
			UMLNavigatorItem navigatorItem = (UMLNavigatorItem) abstractNavigatorItem;
109
			switch (navigatorItem.getVisualID()) {
110
			case Package2EditPart.VISUAL_ID:
111
				return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.0.0/UML?Package", UMLElementTypes.Package_2002);
112
			case Class2EditPart.VISUAL_ID:
113
				return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.0.0/UML?Class", UMLElementTypes.Class_2001);
114
			case AssociationClass2EditPart.VISUAL_ID:
115
				return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.0.0/UML?AssociationClass", UMLElementTypes.AssociationClass_2007);
116
			case DataType2EditPart.VISUAL_ID:
117
				return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.0.0/UML?DataType", UMLElementTypes.DataType_2004);
118
			case PrimitiveType2EditPart.VISUAL_ID:
119
				return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.0.0/UML?PrimitiveType", UMLElementTypes.PrimitiveType_2005);
120
			case Enumeration2EditPart.VISUAL_ID:
121
				return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.0.0/UML?Enumeration", UMLElementTypes.Enumeration_2003);
122
			case InterfaceEditPart.VISUAL_ID:
123
				return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.0.0/UML?Interface", UMLElementTypes.Interface_2010);
124
			case ConstraintEditPart.VISUAL_ID:
125
				return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.0.0/UML?Constraint", UMLElementTypes.Constraint_2006);
126
			case InstanceSpecification2EditPart.VISUAL_ID:
127
				return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.0.0/UML?InstanceSpecification", UMLElementTypes.InstanceSpecification_2008);
128
			case DependencyEditPart.VISUAL_ID:
129
				return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.0.0/UML?Dependency", UMLElementTypes.Dependency_2009);
130
			case Package3EditPart.VISUAL_ID:
131
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Package", UMLElementTypes.Package_3006);
132
			case ClassEditPart.VISUAL_ID:
133
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Class", UMLElementTypes.Class_3007);
134
			case DataTypeEditPart.VISUAL_ID:
135
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?DataType", UMLElementTypes.DataType_3008);
136
			case PrimitiveTypeEditPart.VISUAL_ID:
137
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?PrimitiveType", UMLElementTypes.PrimitiveType_3009);
138
			case EnumerationEditPart.VISUAL_ID:
139
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Enumeration", UMLElementTypes.Enumeration_3011);
140
			case AssociationClassEditPart.VISUAL_ID:
141
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?AssociationClass", UMLElementTypes.AssociationClass_3012);
142
			case InstanceSpecificationEditPart.VISUAL_ID:
143
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?InstanceSpecification", UMLElementTypes.InstanceSpecification_3013);
144
			case PropertyEditPart.VISUAL_ID:
145
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Property", UMLElementTypes.Property_3001);
146
			case OperationEditPart.VISUAL_ID:
147
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Operation", UMLElementTypes.Operation_3002);
148
			case Class3EditPart.VISUAL_ID:
149
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Class", UMLElementTypes.Class_3003);
150
			case PortEditPart.VISUAL_ID:
151
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Port", UMLElementTypes.Port_3025);
152
			case Property2EditPart.VISUAL_ID:
153
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Property", UMLElementTypes.Property_3019);
154
			case Operation2EditPart.VISUAL_ID:
155
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Operation", UMLElementTypes.Operation_3020);
156
			case Property3EditPart.VISUAL_ID:
157
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Property", UMLElementTypes.Property_3014);
158
			case Operation3EditPart.VISUAL_ID:
159
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Operation", UMLElementTypes.Operation_3015);
160
			case Property4EditPart.VISUAL_ID:
161
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Property", UMLElementTypes.Property_3021);
162
			case Operation4EditPart.VISUAL_ID:
163
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Operation", UMLElementTypes.Operation_3022);
164
			case EnumerationLiteralEditPart.VISUAL_ID:
165
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?EnumerationLiteral", UMLElementTypes.EnumerationLiteral_3016);
166
			case Property5EditPart.VISUAL_ID:
167
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Property", UMLElementTypes.Property_3023);
168
			case Operation5EditPart.VISUAL_ID:
169
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Operation", UMLElementTypes.Operation_3024);
170
			case LiteralStringEditPart.VISUAL_ID:
171
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?LiteralString", UMLElementTypes.LiteralString_3005);
172
			case SlotEditPart.VISUAL_ID:
173
				return getImage("Navigator?Node?http://www.eclipse.org/uml2/2.0.0/UML?Slot", UMLElementTypes.Slot_3017);
174
			case PackageEditPart.VISUAL_ID:
175
				return getImage("Navigator?Diagram?http://www.eclipse.org/uml2/2.0.0/UML?Package", UMLElementTypes.Package_1000);
176
			case GeneralizationEditPart.VISUAL_ID:
177
				return getImage("Navigator?Link?http://www.eclipse.org/uml2/2.0.0/UML?Generalization", UMLElementTypes.Generalization_4001);
178
			case Dependency2EditPart.VISUAL_ID:
179
				return getImage("Navigator?Link?http://www.eclipse.org/uml2/2.0.0/UML?Dependency", UMLElementTypes.Dependency_4002);
180
			case Property6EditPart.VISUAL_ID:
181
				return getImage("Navigator?Link?http://www.eclipse.org/uml2/2.0.0/UML?Property", UMLElementTypes.Property_4003);
182
			case ConstraintConstrainedElementEditPart.VISUAL_ID:
183
				return getImage("Navigator?Link?http://www.eclipse.org/uml2/2.0.0/UML?Constraint?constrainedElement", UMLElementTypes.ConstraintConstrainedElement_4004);
184
			case AssociationEditPart.VISUAL_ID:
185
				return getImage("Navigator?Link?http://www.eclipse.org/uml2/2.0.0/UML?Association", UMLElementTypes.Association_4005);
186
			case DependencySupplierEditPart.VISUAL_ID:
187
				return getImage("Navigator?Link?http://www.eclipse.org/uml2/2.0.0/UML?Dependency?supplier", UMLElementTypes.DependencySupplier_4006);
188
			case DependencyClientEditPart.VISUAL_ID:
189
				return getImage("Navigator?Link?http://www.eclipse.org/uml2/2.0.0/UML?Dependency?client", UMLElementTypes.DependencyClient_4007);
190
			case InterfaceRealizationEditPart.VISUAL_ID:
191
				return getImage("Navigator?Link?http://www.eclipse.org/uml2/2.0.0/UML?InterfaceRealization", UMLElementTypes.InterfaceRealization_4008);
192
			case UsageEditPart.VISUAL_ID:
193
				return getImage("Navigator?Link?http://www.eclipse.org/uml2/2.0.0/UML?Usage", UMLElementTypes.Usage_4009);
194
			default:
195
				return getImage("Navigator?UnknownElement", null);
196
			}
197
		} else if (abstractNavigatorItem instanceof UMLNavigatorGroup) {
198
			UMLNavigatorGroup group = (UMLNavigatorGroup) element;
199
			return UMLDiagramEditorPlugin.getInstance().getBundledImage(group.getIcon());
200
		}
201
		return super.getImage(element);
202
	}
203
204
	/**
205
	 * @generated
206
	 */
207
	private Image getImage(String key, IElementType elementType) {
208
		ImageRegistry imageRegistry = UMLDiagramEditorPlugin.getInstance().getImageRegistry();
209
		Image image = imageRegistry.get(key);
210
		if (image == null && elementType != null && UMLElementTypes.isKnownElementType(elementType)) {
211
			image = UMLElementTypes.getImage(elementType);
212
			imageRegistry.put(key, image);
213
		}
214
215
		if (image == null) {
216
			image = imageRegistry.get("Navigator?ImageNotFound");
217
			imageRegistry.put(key, image);
218
		}
219
		return image;
220
	}
221
222
	/**
223
	 * @generated
224
	 */
225
	public String getText(Object element) {
226
		if (false == element instanceof UMLAbstractNavigatorItem) {
227
			return super.getText(element);
228
		}
229
230
		UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element;
231
		if (!PackageEditPart.MODEL_ID.equals(abstractNavigatorItem.getModelID())) {
232
			return super.getText(element);
233
		}
234
235
		if (abstractNavigatorItem instanceof UMLNavigatorItem) {
236
			UMLNavigatorItem navigatorItem = (UMLNavigatorItem) abstractNavigatorItem;
237
			switch (navigatorItem.getVisualID()) {
238
			case Package2EditPart.VISUAL_ID:
239
				return getPackage_2002Text(navigatorItem.getView());
240
			case Class2EditPart.VISUAL_ID:
241
				return getClass_2001Text(navigatorItem.getView());
242
			case AssociationClass2EditPart.VISUAL_ID:
243
				return getAssociationClass_2007Text(navigatorItem.getView());
244
			case DataType2EditPart.VISUAL_ID:
245
				return getDataType_2004Text(navigatorItem.getView());
246
			case PrimitiveType2EditPart.VISUAL_ID:
247
				return getPrimitiveType_2005Text(navigatorItem.getView());
248
			case Enumeration2EditPart.VISUAL_ID:
249
				return getEnumeration_2003Text(navigatorItem.getView());
250
			case InterfaceEditPart.VISUAL_ID:
251
				return getInterface_2010Text(navigatorItem.getView());
252
			case ConstraintEditPart.VISUAL_ID:
253
				return getConstraint_2006Text(navigatorItem.getView());
254
			case InstanceSpecification2EditPart.VISUAL_ID:
255
				return getInstanceSpecification_2008Text(navigatorItem.getView());
256
			case DependencyEditPart.VISUAL_ID:
257
				return getDependency_2009Text(navigatorItem.getView());
258
			case Package3EditPart.VISUAL_ID:
259
				return getPackage_3006Text(navigatorItem.getView());
260
			case ClassEditPart.VISUAL_ID:
261
				return getClass_3007Text(navigatorItem.getView());
262
			case DataTypeEditPart.VISUAL_ID:
263
				return getDataType_3008Text(navigatorItem.getView());
264
			case PrimitiveTypeEditPart.VISUAL_ID:
265
				return getPrimitiveType_3009Text(navigatorItem.getView());
266
			case EnumerationEditPart.VISUAL_ID:
267
				return getEnumeration_3011Text(navigatorItem.getView());
268
			case AssociationClassEditPart.VISUAL_ID:
269
				return getAssociationClass_3012Text(navigatorItem.getView());
270
			case InstanceSpecificationEditPart.VISUAL_ID:
271
				return getInstanceSpecification_3013Text(navigatorItem.getView());
272
			case PropertyEditPart.VISUAL_ID:
273
				return getProperty_3001Text(navigatorItem.getView());
274
			case OperationEditPart.VISUAL_ID:
275
				return getOperation_3002Text(navigatorItem.getView());
276
			case Class3EditPart.VISUAL_ID:
277
				return getClass_3003Text(navigatorItem.getView());
278
			case PortEditPart.VISUAL_ID:
279
				return getPort_3025Text(navigatorItem.getView());
280
			case Property2EditPart.VISUAL_ID:
281
				return getProperty_3019Text(navigatorItem.getView());
282
			case Operation2EditPart.VISUAL_ID:
283
				return getOperation_3020Text(navigatorItem.getView());
284
			case Property3EditPart.VISUAL_ID:
285
				return getProperty_3014Text(navigatorItem.getView());
286
			case Operation3EditPart.VISUAL_ID:
287
				return getOperation_3015Text(navigatorItem.getView());
288
			case Property4EditPart.VISUAL_ID:
289
				return getProperty_3021Text(navigatorItem.getView());
290
			case Operation4EditPart.VISUAL_ID:
291
				return getOperation_3022Text(navigatorItem.getView());
292
			case EnumerationLiteralEditPart.VISUAL_ID:
293
				return getEnumerationLiteral_3016Text(navigatorItem.getView());
294
			case Property5EditPart.VISUAL_ID:
295
				return getProperty_3023Text(navigatorItem.getView());
296
			case Operation5EditPart.VISUAL_ID:
297
				return getOperation_3024Text(navigatorItem.getView());
298
			case LiteralStringEditPart.VISUAL_ID:
299
				return getLiteralString_3005Text(navigatorItem.getView());
300
			case SlotEditPart.VISUAL_ID:
301
				return getSlot_3017Text(navigatorItem.getView());
302
			case PackageEditPart.VISUAL_ID:
303
				return getPackage_1000Text(navigatorItem.getView());
304
			case GeneralizationEditPart.VISUAL_ID:
305
				return getGeneralization_4001Text(navigatorItem.getView());
306
			case Dependency2EditPart.VISUAL_ID:
307
				return getDependency_4002Text(navigatorItem.getView());
308
			case Property6EditPart.VISUAL_ID:
309
				return getProperty_4003Text(navigatorItem.getView());
310
			case ConstraintConstrainedElementEditPart.VISUAL_ID:
311
				return getConstraintConstrainedElement_4004Text(navigatorItem.getView());
312
			case AssociationEditPart.VISUAL_ID:
313
				return getAssociation_4005Text(navigatorItem.getView());
314
			case DependencySupplierEditPart.VISUAL_ID:
315
				return getDependencySupplier_4006Text(navigatorItem.getView());
316
			case DependencyClientEditPart.VISUAL_ID:
317
				return getDependencyClient_4007Text(navigatorItem.getView());
318
			case InterfaceRealizationEditPart.VISUAL_ID:
319
				return getInterfaceRealization_4008Text(navigatorItem.getView());
320
			case UsageEditPart.VISUAL_ID:
321
				return getUsage_4009Text(navigatorItem.getView());
322
			default:
323
				return getUnknownElementText(navigatorItem.getView());
324
			}
325
		} else if (abstractNavigatorItem instanceof UMLNavigatorGroup) {
326
			UMLNavigatorGroup group = (UMLNavigatorGroup) element;
327
			return group.getGroupName();
328
		}
329
		return super.getText(element);
330
	}
331
332
	/**
333
	 * @generated
334
	 */
335
	private String getPackage_2002Text(View view) {
336
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
337
338
			public Object getAdapter(Class adapter) {
339
				if (String.class.equals(adapter)) {
340
					return UMLVisualIDRegistry.getType(PackageNameEditPart.VISUAL_ID);
341
				}
342
				if (IElementType.class.equals(adapter)) {
343
					return UMLElementTypes.Package_2002;
344
				}
345
				return null;
346
			}
347
		});
348
		if (parser != null) {
349
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
350
		} else {
351
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5004);
352
			return "";
353
		}
354
	}
355
356
	/**
357
	 * @generated
358
	 */
359
	private String getClass_2001Text(View view) {
360
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
361
362
			public Object getAdapter(Class adapter) {
363
				if (String.class.equals(adapter)) {
364
					return UMLVisualIDRegistry.getType(ClassNameEditPart.VISUAL_ID);
365
				}
366
				if (IElementType.class.equals(adapter)) {
367
					return UMLElementTypes.Class_2001;
368
				}
369
				return null;
370
			}
371
		});
372
		if (parser != null) {
373
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
374
		} else {
375
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5003);
376
			return "";
377
		}
378
	}
379
380
	/**
381
	 * @generated
382
	 */
383
	private String getAssociationClass_2007Text(View view) {
384
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
385
386
			public Object getAdapter(Class adapter) {
387
				if (String.class.equals(adapter)) {
388
					return UMLVisualIDRegistry.getType(AssociationClassNameEditPart.VISUAL_ID);
389
				}
390
				if (IElementType.class.equals(adapter)) {
391
					return UMLElementTypes.AssociationClass_2007;
392
				}
393
				return null;
394
			}
395
		});
396
		if (parser != null) {
397
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
398
		} else {
399
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5009);
400
			return "";
401
		}
402
	}
403
404
	/**
405
	 * @generated
406
	 */
407
	private String getDataType_2004Text(View view) {
408
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
409
410
			public Object getAdapter(Class adapter) {
411
				if (String.class.equals(adapter)) {
412
					return UMLVisualIDRegistry.getType(DataTypeNameEditPart.VISUAL_ID);
413
				}
414
				if (IElementType.class.equals(adapter)) {
415
					return UMLElementTypes.DataType_2004;
416
				}
417
				return null;
418
			}
419
		});
420
		if (parser != null) {
421
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
422
		} else {
423
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5006);
424
			return "";
425
		}
426
	}
427
428
	/**
429
	 * @generated
430
	 */
431
	private String getPrimitiveType_2005Text(View view) {
432
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
433
434
			public Object getAdapter(Class adapter) {
435
				if (String.class.equals(adapter)) {
436
					return UMLVisualIDRegistry.getType(PrimitiveTypeNameEditPart.VISUAL_ID);
437
				}
438
				if (IElementType.class.equals(adapter)) {
439
					return UMLElementTypes.PrimitiveType_2005;
440
				}
441
				return null;
442
			}
443
		});
444
		if (parser != null) {
445
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
446
		} else {
447
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5007);
448
			return "";
449
		}
450
	}
451
452
	/**
453
	 * @generated
454
	 */
455
	private String getEnumeration_2003Text(View view) {
456
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
457
458
			public Object getAdapter(Class adapter) {
459
				if (String.class.equals(adapter)) {
460
					return UMLVisualIDRegistry.getType(EnumerationNameEditPart.VISUAL_ID);
461
				}
462
				if (IElementType.class.equals(adapter)) {
463
					return UMLElementTypes.Enumeration_2003;
464
				}
465
				return null;
466
			}
467
		});
468
		if (parser != null) {
469
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
470
		} else {
471
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5005);
472
			return "";
473
		}
474
	}
475
476
	/**
477
	 * @generated
478
	 */
479
	private String getInterface_2010Text(View view) {
480
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
481
482
			public Object getAdapter(Class adapter) {
483
				if (String.class.equals(adapter)) {
484
					return UMLVisualIDRegistry.getType(InterfaceNameEditPart.VISUAL_ID);
485
				}
486
				if (IElementType.class.equals(adapter)) {
487
					return UMLElementTypes.Interface_2010;
488
				}
489
				return null;
490
			}
491
		});
492
		if (parser != null) {
493
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
494
		} else {
495
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5012);
496
			return "";
497
		}
498
	}
499
500
	/**
501
	 * @generated
502
	 */
503
	private String getConstraint_2006Text(View view) {
504
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
505
506
			public Object getAdapter(Class adapter) {
507
				if (String.class.equals(adapter)) {
508
					return UMLVisualIDRegistry.getType(ConstraintNameEditPart.VISUAL_ID);
509
				}
510
				if (IElementType.class.equals(adapter)) {
511
					return UMLElementTypes.Constraint_2006;
512
				}
513
				return null;
514
			}
515
		});
516
		if (parser != null) {
517
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
518
		} else {
519
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5008);
520
			return "";
521
		}
522
	}
523
524
	/**
525
	 * @generated
526
	 */
527
	private String getInstanceSpecification_2008Text(View view) {
528
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
529
530
			public Object getAdapter(Class adapter) {
531
				if (String.class.equals(adapter)) {
532
					return UMLVisualIDRegistry.getType(InstanceSpecificationNameEditPart.VISUAL_ID);
533
				}
534
				if (IElementType.class.equals(adapter)) {
535
					return UMLElementTypes.InstanceSpecification_2008;
536
				}
537
				return null;
538
			}
539
		});
540
		if (parser != null) {
541
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
542
		} else {
543
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5010);
544
			return "";
545
		}
546
	}
547
548
	/**
549
	 * @generated
550
	 */
551
	private String getDependency_2009Text(View view) {
552
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
553
554
			public Object getAdapter(Class adapter) {
555
				if (String.class.equals(adapter)) {
556
					return UMLVisualIDRegistry.getType(DependencyNameEditPart.VISUAL_ID);
557
				}
558
				if (IElementType.class.equals(adapter)) {
559
					return UMLElementTypes.Dependency_2009;
560
				}
561
				return null;
562
			}
563
		});
564
		if (parser != null) {
565
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
566
		} else {
567
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5011);
568
			return "";
569
		}
570
	}
571
572
	/**
573
	 * @generated
574
	 */
575
	private String getPackage_3006Text(View view) {
576
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
577
578
			public Object getAdapter(Class adapter) {
579
				if (String.class.equals(adapter)) {
580
					return UMLVisualIDRegistry.getType(Package3EditPart.VISUAL_ID);
581
				}
582
				if (IElementType.class.equals(adapter)) {
583
					return UMLElementTypes.Package_3006;
584
				}
585
				return null;
586
			}
587
		});
588
		if (parser != null) {
589
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
590
		} else {
591
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3006);
592
			return "";
593
		}
594
	}
595
596
	/**
597
	 * @generated
598
	 */
599
	private String getClass_3007Text(View view) {
600
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
601
602
			public Object getAdapter(Class adapter) {
603
				if (String.class.equals(adapter)) {
604
					return UMLVisualIDRegistry.getType(ClassEditPart.VISUAL_ID);
605
				}
606
				if (IElementType.class.equals(adapter)) {
607
					return UMLElementTypes.Class_3007;
608
				}
609
				return null;
610
			}
611
		});
612
		if (parser != null) {
613
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
614
		} else {
615
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3007);
616
			return "";
617
		}
618
	}
619
620
	/**
621
	 * @generated
622
	 */
623
	private String getDataType_3008Text(View view) {
624
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
625
626
			public Object getAdapter(Class adapter) {
627
				if (String.class.equals(adapter)) {
628
					return UMLVisualIDRegistry.getType(DataTypeEditPart.VISUAL_ID);
629
				}
630
				if (IElementType.class.equals(adapter)) {
631
					return UMLElementTypes.DataType_3008;
632
				}
633
				return null;
634
			}
635
		});
636
		if (parser != null) {
637
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
638
		} else {
639
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3008);
640
			return "";
641
		}
642
	}
643
644
	/**
645
	 * @generated
646
	 */
647
	private String getPrimitiveType_3009Text(View view) {
648
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
649
650
			public Object getAdapter(Class adapter) {
651
				if (String.class.equals(adapter)) {
652
					return UMLVisualIDRegistry.getType(PrimitiveTypeEditPart.VISUAL_ID);
653
				}
654
				if (IElementType.class.equals(adapter)) {
655
					return UMLElementTypes.PrimitiveType_3009;
656
				}
657
				return null;
658
			}
659
		});
660
		if (parser != null) {
661
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
662
		} else {
663
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3009);
664
			return "";
665
		}
666
	}
667
668
	/**
669
	 * @generated
670
	 */
671
	private String getEnumeration_3011Text(View view) {
672
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
673
674
			public Object getAdapter(Class adapter) {
675
				if (String.class.equals(adapter)) {
676
					return UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID);
677
				}
678
				if (IElementType.class.equals(adapter)) {
679
					return UMLElementTypes.Enumeration_3011;
680
				}
681
				return null;
682
			}
683
		});
684
		if (parser != null) {
685
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
686
		} else {
687
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3011);
688
			return "";
689
		}
690
	}
691
692
	/**
693
	 * @generated
694
	 */
695
	private String getAssociationClass_3012Text(View view) {
696
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
697
698
			public Object getAdapter(Class adapter) {
699
				if (String.class.equals(adapter)) {
700
					return UMLVisualIDRegistry.getType(AssociationClassEditPart.VISUAL_ID);
701
				}
702
				if (IElementType.class.equals(adapter)) {
703
					return UMLElementTypes.AssociationClass_3012;
704
				}
705
				return null;
706
			}
707
		});
708
		if (parser != null) {
709
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
710
		} else {
711
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3012);
712
			return "";
713
		}
714
	}
715
716
	/**
717
	 * @generated
718
	 */
719
	private String getInstanceSpecification_3013Text(View view) {
720
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
721
722
			public Object getAdapter(Class adapter) {
723
				if (String.class.equals(adapter)) {
724
					return UMLVisualIDRegistry.getType(InstanceSpecificationEditPart.VISUAL_ID);
725
				}
726
				if (IElementType.class.equals(adapter)) {
727
					return UMLElementTypes.InstanceSpecification_3013;
728
				}
729
				return null;
730
			}
731
		});
732
		if (parser != null) {
733
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
734
		} else {
735
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3013);
736
			return "";
737
		}
738
	}
739
740
	/**
741
	 * @generated
742
	 */
743
	private String getProperty_3001Text(View view) {
744
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
745
746
			public Object getAdapter(Class adapter) {
747
				if (String.class.equals(adapter)) {
748
					return UMLVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID);
749
				}
750
				if (IElementType.class.equals(adapter)) {
751
					return UMLElementTypes.Property_3001;
752
				}
753
				return null;
754
			}
755
		});
756
		if (parser != null) {
757
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
758
		} else {
759
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3001);
760
			return "";
761
		}
762
	}
763
764
	/**
765
	 * @generated
766
	 */
767
	private String getOperation_3002Text(View view) {
768
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
769
770
			public Object getAdapter(Class adapter) {
771
				if (String.class.equals(adapter)) {
772
					return UMLVisualIDRegistry.getType(OperationEditPart.VISUAL_ID);
773
				}
774
				if (IElementType.class.equals(adapter)) {
775
					return UMLElementTypes.Operation_3002;
776
				}
777
				return null;
778
			}
779
		});
780
		if (parser != null) {
781
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
782
		} else {
783
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3002);
784
			return "";
785
		}
786
	}
787
788
	/**
789
	 * @generated
790
	 */
791
	private String getClass_3003Text(View view) {
792
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
793
794
			public Object getAdapter(Class adapter) {
795
				if (String.class.equals(adapter)) {
796
					return UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID);
797
				}
798
				if (IElementType.class.equals(adapter)) {
799
					return UMLElementTypes.Class_3003;
800
				}
801
				return null;
802
			}
803
		});
804
		if (parser != null) {
805
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
806
		} else {
807
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3003);
808
			return "";
809
		}
810
	}
811
812
	/**
813
	 * @generated
814
	 */
815
	private String getPort_3025Text(View view) {
816
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
817
818
			public Object getAdapter(Class adapter) {
819
				if (String.class.equals(adapter)) {
820
					return UMLVisualIDRegistry.getType(PortNameEditPart.VISUAL_ID);
821
				}
822
				if (IElementType.class.equals(adapter)) {
823
					return UMLElementTypes.Port_3025;
824
				}
825
				return null;
826
			}
827
		});
828
		if (parser != null) {
829
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
830
		} else {
831
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5013);
832
			return "";
833
		}
834
	}
835
836
	/**
837
	 * @generated
838
	 */
839
	private String getProperty_3019Text(View view) {
840
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
841
842
			public Object getAdapter(Class adapter) {
843
				if (String.class.equals(adapter)) {
844
					return UMLVisualIDRegistry.getType(Property2EditPart.VISUAL_ID);
845
				}
846
				if (IElementType.class.equals(adapter)) {
847
					return UMLElementTypes.Property_3019;
848
				}
849
				return null;
850
			}
851
		});
852
		if (parser != null) {
853
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
854
		} else {
855
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3019);
856
			return "";
857
		}
858
	}
859
860
	/**
861
	 * @generated
862
	 */
863
	private String getOperation_3020Text(View view) {
864
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
865
866
			public Object getAdapter(Class adapter) {
867
				if (String.class.equals(adapter)) {
868
					return UMLVisualIDRegistry.getType(Operation2EditPart.VISUAL_ID);
869
				}
870
				if (IElementType.class.equals(adapter)) {
871
					return UMLElementTypes.Operation_3020;
872
				}
873
				return null;
874
			}
875
		});
876
		if (parser != null) {
877
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
878
		} else {
879
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3020);
880
			return "";
881
		}
882
	}
883
884
	/**
885
	 * @generated
886
	 */
887
	private String getProperty_3014Text(View view) {
888
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
889
890
			public Object getAdapter(Class adapter) {
891
				if (String.class.equals(adapter)) {
892
					return UMLVisualIDRegistry.getType(Property3EditPart.VISUAL_ID);
893
				}
894
				if (IElementType.class.equals(adapter)) {
895
					return UMLElementTypes.Property_3014;
896
				}
897
				return null;
898
			}
899
		});
900
		if (parser != null) {
901
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
902
		} else {
903
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3014);
904
			return "";
905
		}
906
	}
907
908
	/**
909
	 * @generated
910
	 */
911
	private String getOperation_3015Text(View view) {
912
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
913
914
			public Object getAdapter(Class adapter) {
915
				if (String.class.equals(adapter)) {
916
					return UMLVisualIDRegistry.getType(Operation3EditPart.VISUAL_ID);
917
				}
918
				if (IElementType.class.equals(adapter)) {
919
					return UMLElementTypes.Operation_3015;
920
				}
921
				return null;
922
			}
923
		});
924
		if (parser != null) {
925
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
926
		} else {
927
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3015);
928
			return "";
929
		}
930
	}
931
932
	/**
933
	 * @generated
934
	 */
935
	private String getProperty_3021Text(View view) {
936
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
937
938
			public Object getAdapter(Class adapter) {
939
				if (String.class.equals(adapter)) {
940
					return UMLVisualIDRegistry.getType(Property4EditPart.VISUAL_ID);
941
				}
942
				if (IElementType.class.equals(adapter)) {
943
					return UMLElementTypes.Property_3021;
944
				}
945
				return null;
946
			}
947
		});
948
		if (parser != null) {
949
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
950
		} else {
951
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3021);
952
			return "";
953
		}
954
	}
955
956
	/**
957
	 * @generated
958
	 */
959
	private String getOperation_3022Text(View view) {
960
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
961
962
			public Object getAdapter(Class adapter) {
963
				if (String.class.equals(adapter)) {
964
					return UMLVisualIDRegistry.getType(Operation4EditPart.VISUAL_ID);
965
				}
966
				if (IElementType.class.equals(adapter)) {
967
					return UMLElementTypes.Operation_3022;
968
				}
969
				return null;
970
			}
971
		});
972
		if (parser != null) {
973
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
974
		} else {
975
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3022);
976
			return "";
977
		}
978
	}
979
980
	/**
981
	 * @generated
982
	 */
983
	private String getEnumerationLiteral_3016Text(View view) {
984
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
985
986
			public Object getAdapter(Class adapter) {
987
				if (String.class.equals(adapter)) {
988
					return UMLVisualIDRegistry.getType(EnumerationLiteralEditPart.VISUAL_ID);
989
				}
990
				if (IElementType.class.equals(adapter)) {
991
					return UMLElementTypes.EnumerationLiteral_3016;
992
				}
993
				return null;
994
			}
995
		});
996
		if (parser != null) {
997
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
998
		} else {
999
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3016);
1000
			return "";
1001
		}
1002
	}
1003
1004
	/**
1005
	 * @generated
1006
	 */
1007
	private String getProperty_3023Text(View view) {
1008
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
1009
1010
			public Object getAdapter(Class adapter) {
1011
				if (String.class.equals(adapter)) {
1012
					return UMLVisualIDRegistry.getType(Property5EditPart.VISUAL_ID);
1013
				}
1014
				if (IElementType.class.equals(adapter)) {
1015
					return UMLElementTypes.Property_3023;
1016
				}
1017
				return null;
1018
			}
1019
		});
1020
		if (parser != null) {
1021
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
1022
		} else {
1023
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3023);
1024
			return "";
1025
		}
1026
	}
1027
1028
	/**
1029
	 * @generated
1030
	 */
1031
	private String getOperation_3024Text(View view) {
1032
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
1033
1034
			public Object getAdapter(Class adapter) {
1035
				if (String.class.equals(adapter)) {
1036
					return UMLVisualIDRegistry.getType(Operation5EditPart.VISUAL_ID);
1037
				}
1038
				if (IElementType.class.equals(adapter)) {
1039
					return UMLElementTypes.Operation_3024;
1040
				}
1041
				return null;
1042
			}
1043
		});
1044
		if (parser != null) {
1045
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
1046
		} else {
1047
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3024);
1048
			return "";
1049
		}
1050
	}
1051
1052
	/**
1053
	 * @generated
1054
	 */
1055
	private String getLiteralString_3005Text(View view) {
1056
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
1057
1058
			public Object getAdapter(Class adapter) {
1059
				if (String.class.equals(adapter)) {
1060
					return UMLVisualIDRegistry.getType(LiteralStringEditPart.VISUAL_ID);
1061
				}
1062
				if (IElementType.class.equals(adapter)) {
1063
					return UMLElementTypes.LiteralString_3005;
1064
				}
1065
				return null;
1066
			}
1067
		});
1068
		if (parser != null) {
1069
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
1070
		} else {
1071
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3005);
1072
			return "";
1073
		}
1074
	}
1075
1076
	/**
1077
	 * @generated
1078
	 */
1079
	private String getSlot_3017Text(View view) {
1080
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
1081
1082
			public Object getAdapter(Class adapter) {
1083
				if (String.class.equals(adapter)) {
1084
					return UMLVisualIDRegistry.getType(SlotEditPart.VISUAL_ID);
1085
				}
1086
				if (IElementType.class.equals(adapter)) {
1087
					return UMLElementTypes.Slot_3017;
1088
				}
1089
				return null;
1090
			}
1091
		});
1092
		if (parser != null) {
1093
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
1094
		} else {
1095
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 3017);
1096
			return "";
1097
		}
1098
	}
1099
1100
	/**
1101
	 * @generated
1102
	 */
1103
	private String getPackage_1000Text(View view) {
1104
		EObject domainModelElement = view.getElement();
1105
		if (domainModelElement != null) {
1106
			return String.valueOf(((NamedElement) domainModelElement).getName());
1107
		} else {
1108
			UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 1000);
1109
			return "";
1110
		}
1111
	}
1112
1113
	/**
1114
	 * @generated
1115
	 */
1116
	private String getGeneralization_4001Text(View view) {
1117
		EObject domainModelElement = view.getElement();
1118
		if (domainModelElement != null) {
1119
			return String.valueOf(((Generalization) domainModelElement).isSubstitutable());
1120
		} else {
1121
			UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 4001);
1122
			return "";
1123
		}
1124
	}
1125
1126
	/**
1127
	 * @generated
1128
	 */
1129
	private String getDependency_4002Text(View view) {
1130
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
1131
1132
			public Object getAdapter(Class adapter) {
1133
				if (String.class.equals(adapter)) {
1134
					return UMLVisualIDRegistry.getType(DependencyName2EditPart.VISUAL_ID);
1135
				}
1136
				if (IElementType.class.equals(adapter)) {
1137
					return UMLElementTypes.Dependency_4002;
1138
				}
1139
				return null;
1140
			}
1141
		});
1142
		if (parser != null) {
1143
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
1144
		} else {
1145
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6001);
1146
			return "";
1147
		}
1148
	}
1149
1150
	/**
1151
	 * @generated
1152
	 */
1153
	private String getProperty_4003Text(View view) {
1154
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
1155
1156
			public Object getAdapter(Class adapter) {
1157
				if (String.class.equals(adapter)) {
1158
					return UMLVisualIDRegistry.getType(PropertyNameEditPart.VISUAL_ID);
1159
				}
1160
				if (IElementType.class.equals(adapter)) {
1161
					return UMLElementTypes.Property_4003;
1162
				}
1163
				return null;
1164
			}
1165
		});
1166
		if (parser != null) {
1167
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
1168
		} else {
1169
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6002);
1170
			return "";
1171
		}
1172
	}
1173
1174
	/**
1175
	 * @generated
1176
	 */
1177
	private String getConstraintConstrainedElement_4004Text(View view) {
1178
		return "";
1179
	}
1180
1181
	/**
1182
	 * @generated
1183
	 */
1184
	private String getAssociation_4005Text(View view) {
1185
		IParser parser = ParserService.getInstance().getParser(new IAdaptable() {
1186
1187
			public Object getAdapter(Class adapter) {
1188
				if (String.class.equals(adapter)) {
1189
					return UMLVisualIDRegistry.getType(AssociationNameEditPart.VISUAL_ID);
1190
				}
1191
				if (IElementType.class.equals(adapter)) {
1192
					return UMLElementTypes.Association_4005;
1193
				}
1194
				return null;
1195
			}
1196
		});
1197
		if (parser != null) {
1198
			return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
1199
		} else {
1200
			UMLDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6003);
1201
			return "";
1202
		}
1203
	}
1204
1205
	/**
1206
	 * @generated
1207
	 */
1208
	private String getDependencySupplier_4006Text(View view) {
1209
		return "";
1210
	}
1211
1212
	/**
1213
	 * @generated
1214
	 */
1215
	private String getDependencyClient_4007Text(View view) {
1216
		return "";
1217
	}
1218
1219
	/**
1220
	 * @generated
1221
	 */
1222
	private String getInterfaceRealization_4008Text(View view) {
1223
		EObject domainModelElement = view.getElement();
1224
		if (domainModelElement != null) {
1225
			return String.valueOf(((NamedElement) domainModelElement).getName());
1226
		} else {
1227
			UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 4008);
1228
			return "";
1229
		}
1230
	}
1231
1232
	/**
1233
	 * @generated
1234
	 */
1235
	private String getUsage_4009Text(View view) {
1236
		EObject domainModelElement = view.getElement();
1237
		if (domainModelElement != null) {
1238
			return String.valueOf(((NamedElement) domainModelElement).getName());
1239
		} else {
1240
			UMLDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 4009);
1241
			return "";
1242
		}
1243
	}
1244
1245
	/**
1246
	 * @generated
1247
	 */
1248
	private String getUnknownElementText(View view) {
1249
		return "<UnknownElement Visual_ID = " + view.getType() + ">";
1250
	}
1251
1252
	/**
1253
	 * @generated
1254
	 */
1255
	public void init(ICommonContentExtensionSite aConfig) {
1256
	}
1257
1258
	/**
1259
	 * @generated
1260
	 */
1261
	public void restoreState(IMemento aMemento) {
1262
	}
1263
1264
	/**
1265
	 * @generated
1266
	 */
1267
	public void saveState(IMemento aMemento) {
1268
	}
1269
1270
	/**
1271
	 * @generated
1272
	 */
1273
	public String getDescription(Object anElement) {
1274
		return null;
1275
	}
1276
1277
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/slot/slot.jj (+248 lines)
Added Link Here
1
options {
2
  JAVA_UNICODE_ESCAPE = true;
3
  STATIC=false;
4
}
5
6
PARSER_BEGIN(SlotParser)
7
8
/*
9
 * Copyright (c) 2006 Borland Software Corporation
10
 * 
11
 * All rights reserved. This program and the accompanying materials
12
 * are made available under the terms of the Eclipse Public License v1.0
13
 * which accompanies this distribution, and is available at
14
 * http://www.eclipse.org/legal/epl-v10.html
15
 *
16
 * Contributors:
17
 *    Michael Golubev (Borland) - initial API and implementation
18
 */
19
package org.eclipse.uml2.diagram.clazz.parser.slot;
20
21
import java.io.*;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EObject;
24
import org.eclipse.uml2.diagram.parser.*;
25
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
26
import org.eclipse.uml2.uml.*;
27
28
public class SlotParser extends ExternalParserBase {
29
	private Slot mySubject;
30
	private Type myOptionalType;
31
	
32
    public SlotParser(){
33
    	this(new StringReader(""));
34
    }
35
    
36
    public SlotParser(LookupSuite lookup){
37
    	this();
38
    	setLookupSuite(lookup);
39
    }
40
41
	public EClass getSubjectClass(){
42
		return UMLPackage.eINSTANCE.getSlot();
43
	}
44
	
45
	public void parse(EObject target, String text) throws ExternalParserException {
46
		checkContext();
47
		myOptionalType = null;
48
		ReInit(new StringReader(text));
49
		mySubject = (Slot)target;
50
		Declaration();
51
		mySubject = null;
52
		myOptionalType = null;
53
	}
54
	
55
	protected static int parseInt(Token t) throws ParseException {
56
		if (t.kind != SlotParserConstants.INTEGER_LITERAL){
57
			throw new IllegalStateException("Token: " + t + ", image: " + t.image);
58
		}
59
		try {
60
			return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
61
		} catch (NumberFormatException e){
62
			throw new ParseException("Not supported integer value:" + t.image);
63
		}
64
	}
65
	
66
}
67
68
PARSER_END(SlotParser)
69
70
/* WHITE SPACE */
71
72
SPECIAL_TOKEN :
73
{
74
  " "
75
| "\t"
76
}
77
78
/* SEPARATORS */
79
TOKEN :
80
{
81
	< SLASH: "/" >
82
|	< COLON: ":" >
83
|	< EQUALS: "=" >
84
|	< LBRACKET: "[" >
85
|	< RBRACKET: "]" >
86
|	< LCURLY: "{" >
87
|	< RCURLY: "}" >
88
|	< COMMA: "," >
89
}
90
91
/* SPECIAL_MEANING */
92
TOKEN :
93
{
94
	< PLUS: "+" >
95
|	< MINUS: "-" >
96
|	< NUMBER_SIGN: "#" >
97
|	< TILDE: "~" >
98
|	< DOT: "." >
99
|	< STAR: "*" >
100
}
101
102
/* MODIFIERS */
103
TOKEN :
104
{
105
	< READ_ONLY: "readOnly" >
106
|	< UNION: "union" >
107
|	< SUBSETS: "subsets" >
108
|	< REDEFINES: "redefines" >
109
|	< ORDERED: "ordered" >
110
|	< UNORDERED: "unordered" > 
111
|	< UNIQUE: "unique" >
112
|	< NON_UNIQUE: "nonunique" >
113
}
114
	
115
/* LITERALS */
116
TOKEN: 
117
{
118
	< INTEGER_LITERAL: ["0"-"9"] (["0"-"9"])* >
119
}
120
  
121
TOKEN :
122
{
123
  < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
124
|
125
  < #LETTER:
126
      [
127
       "\u0024",
128
       "\u0041"-"\u005a",
129
       "\u005f",
130
       "\u0061"-"\u007a",
131
       "\u00c0"-"\u00d6",
132
       "\u00d8"-"\u00f6",
133
       "\u00f8"-"\u00ff",
134
       "\u0100"-"\u1fff",
135
       "\u3040"-"\u318f",
136
       "\u3300"-"\u337f",
137
       "\u3400"-"\u3d2d",
138
       "\u4e00"-"\u9fff",
139
       "\uf900"-"\ufaff"
140
      ]
141
  >
142
|
143
  < #DIGIT:
144
      [
145
       "\u0030"-"\u0039",
146
       "\u0660"-"\u0669",
147
       "\u06f0"-"\u06f9",
148
       "\u0966"-"\u096f",
149
       "\u09e6"-"\u09ef",
150
       "\u0a66"-"\u0a6f",
151
       "\u0ae6"-"\u0aef",
152
       "\u0b66"-"\u0b6f",
153
       "\u0be7"-"\u0bef",
154
       "\u0c66"-"\u0c6f",
155
       "\u0ce6"-"\u0cef",
156
       "\u0d66"-"\u0d6f",
157
       "\u0e50"-"\u0e59",
158
       "\u0ed0"-"\u0ed9",
159
       "\u1040"-"\u1049"
160
      ]
161
  >
162
}
163
164
void Declaration() :
165
{}
166
{
167
	(
168
		[ SlotFeatureName() ]
169
		[ SlotFeatureType() ]
170
		[ SlotValue() ]
171
	) <EOF>
172
}
173
174
void SlotFeatureName() :
175
{
176
	String name;
177
}
178
{
179
	name = NameWithSpaces() 
180
	{
181
		StructuralFeature feature = lookup(StructuralFeature.class, name);
182
		if (feature != null){
183
			mySubject.setDefiningFeature(feature);
184
		}
185
	}
186
}
187
188
void SlotFeatureType() :
189
{
190
	//we do not want to modify feature type when slot type is changed
191
	//however, we do want to use provided type to construct correct value
192
	//Thus we are going to cache type here and use it in the SlotValue()
193
	String type;
194
}
195
{
196
	<COLON> type = NameWithSpaces() { myOptionalType = lookup(Type.class, type); }
197
}
198
199
200
String NameWithSpaces() :
201
{
202
	StringBuffer result = new StringBuffer();
203
	Token t;
204
}
205
{
206
	(
207
		t = <IDENTIFIER> { result.append(t.image); } 
208
		( t = <IDENTIFIER> { result.append(' '); result.append(t.image); } ) *
209
	)
210
	{
211
		return result.toString();
212
	}
213
}
214
215
/**
216
 * FIXME: Actually only integers and strings are supported. 
217
 * Expression will be used as escape if value is neither string nor integer literal
218
 */
219
void SlotValue() :
220
{
221
	Token t;
222
	String text;	
223
}
224
{
225
	(
226
		<EQUALS> 
227
		(
228
			"\"" text = NameWithSpaces() "\"" 
229
			{ 
230
				LiteralString literalString = (LiteralString)mySubject.createValue(null, myOptionalType, UMLPackage.eINSTANCE.getLiteralString());
231
				literalString.setValue(text);
232
			}
233
		|
234
			text = NameWithSpaces()
235
			{
236
				Expression expression = (Expression)mySubject.createValue(null, myOptionalType, UMLPackage.eINSTANCE.getExpression());
237
				expression.setSymbol(text);
238
			}
239
		| 
240
			t = <INTEGER_LITERAL> 
241
			{ 
242
				int value = parseInt(t);
243
				LiteralInteger literalInteger = (LiteralInteger)mySubject.createValue(null, myOptionalType, UMLPackage.eINSTANCE.getLiteralInteger());
244
				literalInteger.setValue(value);
245
			} 
246
		)
247
	)
248
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/operation/OperationParserConstants.java (+85 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. OperationParserConstants.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.operation;
14
15
public interface OperationParserConstants {
16
17
  int EOF = 0;
18
  int SLASH = 3;
19
  int COLON = 4;
20
  int EQUALS = 5;
21
  int LBRACKET = 6;
22
  int RBRACKET = 7;
23
  int LCURLY = 8;
24
  int RCURLY = 9;
25
  int LPAREN = 10;
26
  int RPAREN = 11;
27
  int COMMA = 12;
28
  int PLUS = 13;
29
  int MINUS = 14;
30
  int NUMBER_SIGN = 15;
31
  int TILDE = 16;
32
  int DOT = 17;
33
  int STAR = 18;
34
  int REDEFINES = 19;
35
  int ORDERED = 20;
36
  int UNORDERED = 21;
37
  int UNIQUE = 22;
38
  int NON_UNIQUE = 23;
39
  int QUERY = 24;
40
  int IN = 25;
41
  int OUT = 26;
42
  int IN_OUT = 27;
43
  int INTEGER_LITERAL = 28;
44
  int IDENTIFIER = 29;
45
  int LETTER = 30;
46
  int DIGIT = 31;
47
48
  int DEFAULT = 0;
49
50
  String[] tokenImage = {
51
    "<EOF>",
52
    "\" \"",
53
    "\"\\t\"",
54
    "\"/\"",
55
    "\":\"",
56
    "\"=\"",
57
    "\"[\"",
58
    "\"]\"",
59
    "\"{\"",
60
    "\"}\"",
61
    "\"(\"",
62
    "\")\"",
63
    "\",\"",
64
    "\"+\"",
65
    "\"-\"",
66
    "\"#\"",
67
    "\"~\"",
68
    "\".\"",
69
    "\"*\"",
70
    "\"redefines\"",
71
    "\"ordered\"",
72
    "\"unordered\"",
73
    "\"unique\"",
74
    "\"nonunique\"",
75
    "\"query\"",
76
    "\"in\"",
77
    "\"out\"",
78
    "\"inout\"",
79
    "<INTEGER_LITERAL>",
80
    "<IDENTIFIER>",
81
    "<LETTER>",
82
    "<DIGIT>",
83
  };
84
85
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/Operation4EditHelperAdvice.java (+9 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
4
5
/**
6
 * @generated
7
 */
8
public class Operation4EditHelperAdvice extends AbstractEditHelperAdvice {
9
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/LiteralStringEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class LiteralStringEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/AssociationName4ViewFactory.java (+39 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
8
import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
11
import org.eclipse.gmf.runtime.notation.Location;
12
import org.eclipse.gmf.runtime.notation.Node;
13
import org.eclipse.gmf.runtime.notation.View;
14
15
/**
16
 * @generated
17
 */
18
public class AssociationName4ViewFactory extends AbstractLabelViewFactory {
19
20
	/**
21
	 * @generated
22
	 */
23
	public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
24
		Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
25
		Location location = (Location) view.getLayoutConstraint();
26
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
27
		location.setX(mapMode.DPtoLP(0));
28
		location.setY(mapMode.DPtoLP(-30));
29
		return view;
30
	}
31
32
	/**
33
	 * @generated
34
	 */
35
	protected List createStyles(View view) {
36
		List styles = new ArrayList();
37
		return styles;
38
	}
39
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/name/JavaCharStream.java (+558 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 3.0 */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.name;
14
15
/**
16
 * An implementation of interface CharStream, where the stream is assumed to
17
 * contain only ASCII characters (with java-like unicode escape processing).
18
 */
19
20
public class JavaCharStream
21
{
22
  public static final boolean staticFlag = false;
23
  static final int hexval(char c) throws java.io.IOException {
24
    switch(c)
25
    {
26
       case '0' :
27
          return 0;
28
       case '1' :
29
          return 1;
30
       case '2' :
31
          return 2;
32
       case '3' :
33
          return 3;
34
       case '4' :
35
          return 4;
36
       case '5' :
37
          return 5;
38
       case '6' :
39
          return 6;
40
       case '7' :
41
          return 7;
42
       case '8' :
43
          return 8;
44
       case '9' :
45
          return 9;
46
47
       case 'a' :
48
       case 'A' :
49
          return 10;
50
       case 'b' :
51
       case 'B' :
52
          return 11;
53
       case 'c' :
54
       case 'C' :
55
          return 12;
56
       case 'd' :
57
       case 'D' :
58
          return 13;
59
       case 'e' :
60
       case 'E' :
61
          return 14;
62
       case 'f' :
63
       case 'F' :
64
          return 15;
65
    }
66
67
    throw new java.io.IOException(); // Should never come here
68
  }
69
70
  public int bufpos = -1;
71
  int bufsize;
72
  int available;
73
  int tokenBegin;
74
  protected int bufline[];
75
  protected int bufcolumn[];
76
77
  protected int column = 0;
78
  protected int line = 1;
79
80
  protected boolean prevCharIsCR = false;
81
  protected boolean prevCharIsLF = false;
82
83
  protected java.io.Reader inputStream;
84
85
  protected char[] nextCharBuf;
86
  protected char[] buffer;
87
  protected int maxNextCharInd = 0;
88
  protected int nextCharInd = -1;
89
  protected int inBuf = 0;
90
91
  protected void ExpandBuff(boolean wrapAround)
92
  {
93
     char[] newbuffer = new char[bufsize + 2048];
94
     int newbufline[] = new int[bufsize + 2048];
95
     int newbufcolumn[] = new int[bufsize + 2048];
96
97
     try
98
     {
99
        if (wrapAround)
100
        {
101
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
102
           System.arraycopy(buffer, 0, newbuffer,
103
                                             bufsize - tokenBegin, bufpos);
104
           buffer = newbuffer;
105
106
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
107
           System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
108
           bufline = newbufline;
109
110
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
111
           System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
112
           bufcolumn = newbufcolumn;
113
114
           bufpos += (bufsize - tokenBegin);
115
        }
116
        else
117
        {
118
           System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
119
           buffer = newbuffer;
120
121
           System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
122
           bufline = newbufline;
123
124
           System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
125
           bufcolumn = newbufcolumn;
126
127
           bufpos -= tokenBegin;
128
        }
129
     }
130
     catch (Throwable t)
131
     {
132
        throw new Error(t.getMessage());
133
     }
134
135
     available = (bufsize += 2048);
136
     tokenBegin = 0;
137
  }
138
139
  protected void FillBuff() throws java.io.IOException
140
  {
141
     int i;
142
     if (maxNextCharInd == 4096)
143
        maxNextCharInd = nextCharInd = 0;
144
145
     try {
146
        if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
147
                                            4096 - maxNextCharInd)) == -1)
148
        {
149
           inputStream.close();
150
           throw new java.io.IOException();
151
        }
152
        else
153
           maxNextCharInd += i;
154
        return;
155
     }
156
     catch(java.io.IOException e) {
157
        if (bufpos != 0)
158
        {
159
           --bufpos;
160
           backup(0);
161
        }
162
        else
163
        {
164
           bufline[bufpos] = line;
165
           bufcolumn[bufpos] = column;
166
        }
167
        throw e;
168
     }
169
  }
170
171
  protected char ReadByte() throws java.io.IOException
172
  {
173
     if (++nextCharInd >= maxNextCharInd)
174
        FillBuff();
175
176
     return nextCharBuf[nextCharInd];
177
  }
178
179
  public char BeginToken() throws java.io.IOException
180
  {     
181
     if (inBuf > 0)
182
     {
183
        --inBuf;
184
185
        if (++bufpos == bufsize)
186
           bufpos = 0;
187
188
        tokenBegin = bufpos;
189
        return buffer[bufpos];
190
     }
191
192
     tokenBegin = 0;
193
     bufpos = -1;
194
195
     return readChar();
196
  }     
197
198
  protected void AdjustBuffSize()
199
  {
200
     if (available == bufsize)
201
     {
202
        if (tokenBegin > 2048)
203
        {
204
           bufpos = 0;
205
           available = tokenBegin;
206
        }
207
        else
208
           ExpandBuff(false);
209
     }
210
     else if (available > tokenBegin)
211
        available = bufsize;
212
     else if ((tokenBegin - available) < 2048)
213
        ExpandBuff(true);
214
     else
215
        available = tokenBegin;
216
  }
217
218
  protected void UpdateLineColumn(char c)
219
  {
220
     column++;
221
222
     if (prevCharIsLF)
223
     {
224
        prevCharIsLF = false;
225
        line += (column = 1);
226
     }
227
     else if (prevCharIsCR)
228
     {
229
        prevCharIsCR = false;
230
        if (c == '\n')
231
        {
232
           prevCharIsLF = true;
233
        }
234
        else
235
           line += (column = 1);
236
     }
237
238
     switch (c)
239
     {
240
        case '\r' :
241
           prevCharIsCR = true;
242
           break;
243
        case '\n' :
244
           prevCharIsLF = true;
245
           break;
246
        case '\t' :
247
           column--;
248
           column += (8 - (column & 07));
249
           break;
250
        default :
251
           break;
252
     }
253
254
     bufline[bufpos] = line;
255
     bufcolumn[bufpos] = column;
256
  }
257
258
  public char readChar() throws java.io.IOException
259
  {
260
     if (inBuf > 0)
261
     {
262
        --inBuf;
263
264
        if (++bufpos == bufsize)
265
           bufpos = 0;
266
267
        return buffer[bufpos];
268
     }
269
270
     char c;
271
272
     if (++bufpos == available)
273
        AdjustBuffSize();
274
275
     if ((buffer[bufpos] = c = ReadByte()) == '\\')
276
     {
277
        UpdateLineColumn(c);
278
279
        int backSlashCnt = 1;
280
281
        for (;;) // Read all the backslashes
282
        {
283
           if (++bufpos == available)
284
              AdjustBuffSize();
285
286
           try
287
           {
288
              if ((buffer[bufpos] = c = ReadByte()) != '\\')
289
              {
290
                 UpdateLineColumn(c);
291
                 // found a non-backslash char.
292
                 if ((c == 'u') && ((backSlashCnt & 1) == 1))
293
                 {
294
                    if (--bufpos < 0)
295
                       bufpos = bufsize - 1;
296
297
                    break;
298
                 }
299
300
                 backup(backSlashCnt);
301
                 return '\\';
302
              }
303
           }
304
           catch(java.io.IOException e)
305
           {
306
              if (backSlashCnt > 1)
307
                 backup(backSlashCnt);
308
309
              return '\\';
310
           }
311
312
           UpdateLineColumn(c);
313
           backSlashCnt++;
314
        }
315
316
        // Here, we have seen an odd number of backslash's followed by a 'u'
317
        try
318
        {
319
           while ((c = ReadByte()) == 'u')
320
              ++column;
321
322
           buffer[bufpos] = c = (char)(hexval(c) << 12 |
323
                                       hexval(ReadByte()) << 8 |
324
                                       hexval(ReadByte()) << 4 |
325
                                       hexval(ReadByte()));
326
327
           column += 4;
328
        }
329
        catch(java.io.IOException e)
330
        {
331
           throw new Error("Invalid escape character at line " + line +
332
                                         " column " + column + ".");
333
        }
334
335
        if (backSlashCnt == 1)
336
           return c;
337
        else
338
        {
339
           backup(backSlashCnt - 1);
340
           return '\\';
341
        }
342
     }
343
     else
344
     {
345
        UpdateLineColumn(c);
346
        return (c);
347
     }
348
  }
349
350
  /**
351
   * @deprecated 
352
   * @see #getEndColumn
353
   */
354
355
  public int getColumn() {
356
     return bufcolumn[bufpos];
357
  }
358
359
  /**
360
   * @deprecated 
361
   * @see #getEndLine
362
   */
363
364
  public int getLine() {
365
     return bufline[bufpos];
366
  }
367
368
  public int getEndColumn() {
369
     return bufcolumn[bufpos];
370
  }
371
372
  public int getEndLine() {
373
     return bufline[bufpos];
374
  }
375
376
  public int getBeginColumn() {
377
     return bufcolumn[tokenBegin];
378
  }
379
380
  public int getBeginLine() {
381
     return bufline[tokenBegin];
382
  }
383
384
  public void backup(int amount) {
385
386
    inBuf += amount;
387
    if ((bufpos -= amount) < 0)
388
       bufpos += bufsize;
389
  }
390
391
  public JavaCharStream(java.io.Reader dstream,
392
                 int startline, int startcolumn, int buffersize)
393
  {
394
    inputStream = dstream;
395
    line = startline;
396
    column = startcolumn - 1;
397
398
    available = bufsize = buffersize;
399
    buffer = new char[buffersize];
400
    bufline = new int[buffersize];
401
    bufcolumn = new int[buffersize];
402
    nextCharBuf = new char[4096];
403
  }
404
405
  public JavaCharStream(java.io.Reader dstream,
406
                                        int startline, int startcolumn)
407
  {
408
     this(dstream, startline, startcolumn, 4096);
409
  }
410
411
  public JavaCharStream(java.io.Reader dstream)
412
  {
413
     this(dstream, 1, 1, 4096);
414
  }
415
  public void ReInit(java.io.Reader dstream,
416
                 int startline, int startcolumn, int buffersize)
417
  {
418
    inputStream = dstream;
419
    line = startline;
420
    column = startcolumn - 1;
421
422
    if (buffer == null || buffersize != buffer.length)
423
    {
424
      available = bufsize = buffersize;
425
      buffer = new char[buffersize];
426
      bufline = new int[buffersize];
427
      bufcolumn = new int[buffersize];
428
      nextCharBuf = new char[4096];
429
    }
430
    prevCharIsLF = prevCharIsCR = false;
431
    tokenBegin = inBuf = maxNextCharInd = 0;
432
    nextCharInd = bufpos = -1;
433
  }
434
435
  public void ReInit(java.io.Reader dstream,
436
                                        int startline, int startcolumn)
437
  {
438
     ReInit(dstream, startline, startcolumn, 4096);
439
  }
440
441
  public void ReInit(java.io.Reader dstream)
442
  {
443
     ReInit(dstream, 1, 1, 4096);
444
  }
445
  public JavaCharStream(java.io.InputStream dstream, int startline,
446
  int startcolumn, int buffersize)
447
  {
448
     this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
449
  }
450
451
  public JavaCharStream(java.io.InputStream dstream, int startline,
452
                                                           int startcolumn)
453
  {
454
     this(dstream, startline, startcolumn, 4096);
455
  }
456
457
  public JavaCharStream(java.io.InputStream dstream)
458
  {
459
     this(dstream, 1, 1, 4096);
460
  }
461
462
  public void ReInit(java.io.InputStream dstream, int startline,
463
  int startcolumn, int buffersize)
464
  {
465
     ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
466
  }
467
  public void ReInit(java.io.InputStream dstream, int startline,
468
                                                           int startcolumn)
469
  {
470
     ReInit(dstream, startline, startcolumn, 4096);
471
  }
472
  public void ReInit(java.io.InputStream dstream)
473
  {
474
     ReInit(dstream, 1, 1, 4096);
475
  }
476
477
  public String GetImage()
478
  {
479
     if (bufpos >= tokenBegin)
480
        return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
481
     else
482
        return new String(buffer, tokenBegin, bufsize - tokenBegin) +
483
                              new String(buffer, 0, bufpos + 1);
484
  }
485
486
  public char[] GetSuffix(int len)
487
  {
488
     char[] ret = new char[len];
489
490
     if ((bufpos + 1) >= len)
491
        System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
492
     else
493
     {
494
        System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
495
                                                          len - bufpos - 1);
496
        System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
497
     }
498
499
     return ret;
500
  }
501
502
  public void Done()
503
  {
504
     nextCharBuf = null;
505
     buffer = null;
506
     bufline = null;
507
     bufcolumn = null;
508
  }
509
510
  /**
511
   * Method to adjust line and column numbers for the start of a token.
512
   */
513
  public void adjustBeginLineColumn(int newLine, int newCol)
514
  {
515
     int start = tokenBegin;
516
     int len;
517
518
     if (bufpos >= tokenBegin)
519
     {
520
        len = bufpos - tokenBegin + inBuf + 1;
521
     }
522
     else
523
     {
524
        len = bufsize - tokenBegin + bufpos + 1 + inBuf;
525
     }
526
527
     int i = 0, j = 0, k = 0;
528
     int nextColDiff = 0, columnDiff = 0;
529
530
     while (i < len &&
531
            bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
532
     {
533
        bufline[j] = newLine;
534
        nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
535
        bufcolumn[j] = newCol + columnDiff;
536
        columnDiff = nextColDiff;
537
        i++;
538
     } 
539
540
     if (i < len)
541
     {
542
        bufline[j] = newLine++;
543
        bufcolumn[j] = newCol + columnDiff;
544
545
        while (i++ < len)
546
        {
547
           if (bufline[j = start % bufsize] != bufline[++start % bufsize])
548
              bufline[j] = newLine++;
549
           else
550
              bufline[j] = newLine;
551
        }
552
     }
553
554
     line = bufline[j];
555
     column = bufcolumn[j];
556
  }
557
558
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/association/end/AssociationEndParserTokenManager.java (+726 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. AssociationEndParserTokenManager.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.association.end;
14
import java.io.*;
15
import org.eclipse.emf.ecore.EClass;
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.uml2.diagram.parser.*;
18
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
19
import org.eclipse.uml2.uml.*;
20
21
public class AssociationEndParserTokenManager implements AssociationEndParserConstants
22
{
23
  public  java.io.PrintStream debugStream = System.out;
24
  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
25
private final int jjStopStringLiteralDfa_0(int pos, long active0)
26
{
27
   switch (pos)
28
   {
29
      case 0:
30
         if ((active0 & 0x1fe0000L) != 0L)
31
         {
32
            jjmatchedKind = 26;
33
            return 2;
34
         }
35
         return -1;
36
      case 1:
37
         if ((active0 & 0x1fe0000L) != 0L)
38
         {
39
            jjmatchedKind = 26;
40
            jjmatchedPos = 1;
41
            return 2;
42
         }
43
         return -1;
44
      case 2:
45
         if ((active0 & 0x1fe0000L) != 0L)
46
         {
47
            jjmatchedKind = 26;
48
            jjmatchedPos = 2;
49
            return 2;
50
         }
51
         return -1;
52
      case 3:
53
         if ((active0 & 0x1fe0000L) != 0L)
54
         {
55
            jjmatchedKind = 26;
56
            jjmatchedPos = 3;
57
            return 2;
58
         }
59
         return -1;
60
      case 4:
61
         if ((active0 & 0x40000L) != 0L)
62
            return 2;
63
         if ((active0 & 0x1fa0000L) != 0L)
64
         {
65
            jjmatchedKind = 26;
66
            jjmatchedPos = 4;
67
            return 2;
68
         }
69
         return -1;
70
      case 5:
71
         if ((active0 & 0x800000L) != 0L)
72
            return 2;
73
         if ((active0 & 0x17a0000L) != 0L)
74
         {
75
            jjmatchedKind = 26;
76
            jjmatchedPos = 5;
77
            return 2;
78
         }
79
         return -1;
80
      case 6:
81
         if ((active0 & 0x280000L) != 0L)
82
            return 2;
83
         if ((active0 & 0x1520000L) != 0L)
84
         {
85
            jjmatchedKind = 26;
86
            jjmatchedPos = 6;
87
            return 2;
88
         }
89
         return -1;
90
      case 7:
91
         if ((active0 & 0x20000L) != 0L)
92
            return 2;
93
         if ((active0 & 0x1500000L) != 0L)
94
         {
95
            jjmatchedKind = 26;
96
            jjmatchedPos = 7;
97
            return 2;
98
         }
99
         return -1;
100
      default :
101
         return -1;
102
   }
103
}
104
private final int jjStartNfa_0(int pos, long active0)
105
{
106
   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
107
}
108
private final int jjStopAtPos(int pos, int kind)
109
{
110
   jjmatchedKind = kind;
111
   jjmatchedPos = pos;
112
   return pos + 1;
113
}
114
private final int jjStartNfaWithStates_0(int pos, int kind, int state)
115
{
116
   jjmatchedKind = kind;
117
   jjmatchedPos = pos;
118
   try { curChar = input_stream.readChar(); }
119
   catch(java.io.IOException e) { return pos + 1; }
120
   return jjMoveNfa_0(state, pos + 1);
121
}
122
private final int jjMoveStringLiteralDfa0_0()
123
{
124
   switch(curChar)
125
   {
126
      case 9:
127
         return jjStopAtPos(0, 2);
128
      case 32:
129
         return jjStopAtPos(0, 1);
130
      case 35:
131
         return jjStopAtPos(0, 13);
132
      case 42:
133
         return jjStopAtPos(0, 16);
134
      case 43:
135
         return jjStopAtPos(0, 11);
136
      case 44:
137
         return jjStopAtPos(0, 10);
138
      case 45:
139
         return jjStopAtPos(0, 12);
140
      case 46:
141
         return jjStopAtPos(0, 15);
142
      case 47:
143
         return jjStopAtPos(0, 3);
144
      case 58:
145
         return jjStopAtPos(0, 4);
146
      case 61:
147
         return jjStopAtPos(0, 5);
148
      case 91:
149
         return jjStopAtPos(0, 6);
150
      case 93:
151
         return jjStopAtPos(0, 7);
152
      case 110:
153
         return jjMoveStringLiteralDfa1_0(0x1000000L);
154
      case 111:
155
         return jjMoveStringLiteralDfa1_0(0x200000L);
156
      case 114:
157
         return jjMoveStringLiteralDfa1_0(0x120000L);
158
      case 115:
159
         return jjMoveStringLiteralDfa1_0(0x80000L);
160
      case 117:
161
         return jjMoveStringLiteralDfa1_0(0xc40000L);
162
      case 123:
163
         return jjStopAtPos(0, 8);
164
      case 125:
165
         return jjStopAtPos(0, 9);
166
      case 126:
167
         return jjStopAtPos(0, 14);
168
      default :
169
         return jjMoveNfa_0(1, 0);
170
   }
171
}
172
private final int jjMoveStringLiteralDfa1_0(long active0)
173
{
174
   try { curChar = input_stream.readChar(); }
175
   catch(java.io.IOException e) {
176
      jjStopStringLiteralDfa_0(0, active0);
177
      return 1;
178
   }
179
   switch(curChar)
180
   {
181
      case 101:
182
         return jjMoveStringLiteralDfa2_0(active0, 0x120000L);
183
      case 110:
184
         return jjMoveStringLiteralDfa2_0(active0, 0xc40000L);
185
      case 111:
186
         return jjMoveStringLiteralDfa2_0(active0, 0x1000000L);
187
      case 114:
188
         return jjMoveStringLiteralDfa2_0(active0, 0x200000L);
189
      case 117:
190
         return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
191
      default :
192
         break;
193
   }
194
   return jjStartNfa_0(0, active0);
195
}
196
private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
197
{
198
   if (((active0 &= old0)) == 0L)
199
      return jjStartNfa_0(0, old0); 
200
   try { curChar = input_stream.readChar(); }
201
   catch(java.io.IOException e) {
202
      jjStopStringLiteralDfa_0(1, active0);
203
      return 2;
204
   }
205
   switch(curChar)
206
   {
207
      case 97:
208
         return jjMoveStringLiteralDfa3_0(active0, 0x20000L);
209
      case 98:
210
         return jjMoveStringLiteralDfa3_0(active0, 0x80000L);
211
      case 100:
212
         return jjMoveStringLiteralDfa3_0(active0, 0x300000L);
213
      case 105:
214
         return jjMoveStringLiteralDfa3_0(active0, 0x840000L);
215
      case 110:
216
         return jjMoveStringLiteralDfa3_0(active0, 0x1000000L);
217
      case 111:
218
         return jjMoveStringLiteralDfa3_0(active0, 0x400000L);
219
      default :
220
         break;
221
   }
222
   return jjStartNfa_0(1, active0);
223
}
224
private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
225
{
226
   if (((active0 &= old0)) == 0L)
227
      return jjStartNfa_0(1, old0); 
228
   try { curChar = input_stream.readChar(); }
229
   catch(java.io.IOException e) {
230
      jjStopStringLiteralDfa_0(2, active0);
231
      return 3;
232
   }
233
   switch(curChar)
234
   {
235
      case 100:
236
         return jjMoveStringLiteralDfa4_0(active0, 0x20000L);
237
      case 101:
238
         return jjMoveStringLiteralDfa4_0(active0, 0x300000L);
239
      case 111:
240
         return jjMoveStringLiteralDfa4_0(active0, 0x40000L);
241
      case 113:
242
         return jjMoveStringLiteralDfa4_0(active0, 0x800000L);
243
      case 114:
244
         return jjMoveStringLiteralDfa4_0(active0, 0x400000L);
245
      case 115:
246
         return jjMoveStringLiteralDfa4_0(active0, 0x80000L);
247
      case 117:
248
         return jjMoveStringLiteralDfa4_0(active0, 0x1000000L);
249
      default :
250
         break;
251
   }
252
   return jjStartNfa_0(2, active0);
253
}
254
private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
255
{
256
   if (((active0 &= old0)) == 0L)
257
      return jjStartNfa_0(2, old0); 
258
   try { curChar = input_stream.readChar(); }
259
   catch(java.io.IOException e) {
260
      jjStopStringLiteralDfa_0(3, active0);
261
      return 4;
262
   }
263
   switch(curChar)
264
   {
265
      case 79:
266
         return jjMoveStringLiteralDfa5_0(active0, 0x20000L);
267
      case 100:
268
         return jjMoveStringLiteralDfa5_0(active0, 0x400000L);
269
      case 101:
270
         return jjMoveStringLiteralDfa5_0(active0, 0x80000L);
271
      case 102:
272
         return jjMoveStringLiteralDfa5_0(active0, 0x100000L);
273
      case 110:
274
         if ((active0 & 0x40000L) != 0L)
275
            return jjStartNfaWithStates_0(4, 18, 2);
276
         return jjMoveStringLiteralDfa5_0(active0, 0x1000000L);
277
      case 114:
278
         return jjMoveStringLiteralDfa5_0(active0, 0x200000L);
279
      case 117:
280
         return jjMoveStringLiteralDfa5_0(active0, 0x800000L);
281
      default :
282
         break;
283
   }
284
   return jjStartNfa_0(3, active0);
285
}
286
private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
287
{
288
   if (((active0 &= old0)) == 0L)
289
      return jjStartNfa_0(3, old0); 
290
   try { curChar = input_stream.readChar(); }
291
   catch(java.io.IOException e) {
292
      jjStopStringLiteralDfa_0(4, active0);
293
      return 5;
294
   }
295
   switch(curChar)
296
   {
297
      case 101:
298
         if ((active0 & 0x800000L) != 0L)
299
            return jjStartNfaWithStates_0(5, 23, 2);
300
         return jjMoveStringLiteralDfa6_0(active0, 0x600000L);
301
      case 105:
302
         return jjMoveStringLiteralDfa6_0(active0, 0x1100000L);
303
      case 110:
304
         return jjMoveStringLiteralDfa6_0(active0, 0x20000L);
305
      case 116:
306
         return jjMoveStringLiteralDfa6_0(active0, 0x80000L);
307
      default :
308
         break;
309
   }
310
   return jjStartNfa_0(4, active0);
311
}
312
private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
313
{
314
   if (((active0 &= old0)) == 0L)
315
      return jjStartNfa_0(4, old0); 
316
   try { curChar = input_stream.readChar(); }
317
   catch(java.io.IOException e) {
318
      jjStopStringLiteralDfa_0(5, active0);
319
      return 6;
320
   }
321
   switch(curChar)
322
   {
323
      case 100:
324
         if ((active0 & 0x200000L) != 0L)
325
            return jjStartNfaWithStates_0(6, 21, 2);
326
         break;
327
      case 108:
328
         return jjMoveStringLiteralDfa7_0(active0, 0x20000L);
329
      case 110:
330
         return jjMoveStringLiteralDfa7_0(active0, 0x100000L);
331
      case 113:
332
         return jjMoveStringLiteralDfa7_0(active0, 0x1000000L);
333
      case 114:
334
         return jjMoveStringLiteralDfa7_0(active0, 0x400000L);
335
      case 115:
336
         if ((active0 & 0x80000L) != 0L)
337
            return jjStartNfaWithStates_0(6, 19, 2);
338
         break;
339
      default :
340
         break;
341
   }
342
   return jjStartNfa_0(5, active0);
343
}
344
private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
345
{
346
   if (((active0 &= old0)) == 0L)
347
      return jjStartNfa_0(5, old0); 
348
   try { curChar = input_stream.readChar(); }
349
   catch(java.io.IOException e) {
350
      jjStopStringLiteralDfa_0(6, active0);
351
      return 7;
352
   }
353
   switch(curChar)
354
   {
355
      case 101:
356
         return jjMoveStringLiteralDfa8_0(active0, 0x500000L);
357
      case 117:
358
         return jjMoveStringLiteralDfa8_0(active0, 0x1000000L);
359
      case 121:
360
         if ((active0 & 0x20000L) != 0L)
361
            return jjStartNfaWithStates_0(7, 17, 2);
362
         break;
363
      default :
364
         break;
365
   }
366
   return jjStartNfa_0(6, active0);
367
}
368
private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
369
{
370
   if (((active0 &= old0)) == 0L)
371
      return jjStartNfa_0(6, old0); 
372
   try { curChar = input_stream.readChar(); }
373
   catch(java.io.IOException e) {
374
      jjStopStringLiteralDfa_0(7, active0);
375
      return 8;
376
   }
377
   switch(curChar)
378
   {
379
      case 100:
380
         if ((active0 & 0x400000L) != 0L)
381
            return jjStartNfaWithStates_0(8, 22, 2);
382
         break;
383
      case 101:
384
         if ((active0 & 0x1000000L) != 0L)
385
            return jjStartNfaWithStates_0(8, 24, 2);
386
         break;
387
      case 115:
388
         if ((active0 & 0x100000L) != 0L)
389
            return jjStartNfaWithStates_0(8, 20, 2);
390
         break;
391
      default :
392
         break;
393
   }
394
   return jjStartNfa_0(7, active0);
395
}
396
private final void jjCheckNAdd(int state)
397
{
398
   if (jjrounds[state] != jjround)
399
   {
400
      jjstateSet[jjnewStateCnt++] = state;
401
      jjrounds[state] = jjround;
402
   }
403
}
404
private final void jjAddStates(int start, int end)
405
{
406
   do {
407
      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
408
   } while (start++ != end);
409
}
410
private final void jjCheckNAddTwoStates(int state1, int state2)
411
{
412
   jjCheckNAdd(state1);
413
   jjCheckNAdd(state2);
414
}
415
private final void jjCheckNAddStates(int start, int end)
416
{
417
   do {
418
      jjCheckNAdd(jjnextStates[start]);
419
   } while (start++ != end);
420
}
421
private final void jjCheckNAddStates(int start)
422
{
423
   jjCheckNAdd(jjnextStates[start]);
424
   jjCheckNAdd(jjnextStates[start + 1]);
425
}
426
static final long[] jjbitVec0 = {
427
   0x1ff00000fffffffeL, 0xffffffffffffc000L, 0xffffffffL, 0x600000000000000L
428
};
429
static final long[] jjbitVec2 = {
430
   0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
431
};
432
static final long[] jjbitVec3 = {
433
   0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
434
};
435
static final long[] jjbitVec4 = {
436
   0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
437
};
438
static final long[] jjbitVec5 = {
439
   0xffffffffffffffffL, 0xffffffffffffffffL, 0x0L, 0x0L
440
};
441
static final long[] jjbitVec6 = {
442
   0x3fffffffffffL, 0x0L, 0x0L, 0x0L
443
};
444
private final int jjMoveNfa_0(int startState, int curPos)
445
{
446
   int[] nextStates;
447
   int startsAt = 0;
448
   jjnewStateCnt = 3;
449
   int i = 1;
450
   jjstateSet[0] = startState;
451
   int j, kind = 0x7fffffff;
452
   for (;;)
453
   {
454
      if (++jjround == 0x7fffffff)
455
         ReInitRounds();
456
      if (curChar < 64)
457
      {
458
         long l = 1L << curChar;
459
         MatchLoop: do
460
         {
461
            switch(jjstateSet[--i])
462
            {
463
               case 1:
464
                  if ((0x3ff000000000000L & l) != 0L)
465
                  {
466
                     if (kind > 25)
467
                        kind = 25;
468
                     jjCheckNAdd(0);
469
                  }
470
                  else if (curChar == 36)
471
                  {
472
                     if (kind > 26)
473
                        kind = 26;
474
                     jjCheckNAdd(2);
475
                  }
476
                  break;
477
               case 0:
478
                  if ((0x3ff000000000000L & l) == 0L)
479
                     break;
480
                  if (kind > 25)
481
                     kind = 25;
482
                  jjCheckNAdd(0);
483
                  break;
484
               case 2:
485
                  if ((0x3ff001000000000L & l) == 0L)
486
                     break;
487
                  if (kind > 26)
488
                     kind = 26;
489
                  jjCheckNAdd(2);
490
                  break;
491
               default : break;
492
            }
493
         } while(i != startsAt);
494
      }
495
      else if (curChar < 128)
496
      {
497
         long l = 1L << (curChar & 077);
498
         MatchLoop: do
499
         {
500
            switch(jjstateSet[--i])
501
            {
502
               case 1:
503
               case 2:
504
                  if ((0x7fffffe87fffffeL & l) == 0L)
505
                     break;
506
                  if (kind > 26)
507
                     kind = 26;
508
                  jjCheckNAdd(2);
509
                  break;
510
               default : break;
511
            }
512
         } while(i != startsAt);
513
      }
514
      else
515
      {
516
         int hiByte = (int)(curChar >> 8);
517
         int i1 = hiByte >> 6;
518
         long l1 = 1L << (hiByte & 077);
519
         int i2 = (curChar & 0xff) >> 6;
520
         long l2 = 1L << (curChar & 077);
521
         MatchLoop: do
522
         {
523
            switch(jjstateSet[--i])
524
            {
525
               case 1:
526
               case 2:
527
                  if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
528
                     break;
529
                  if (kind > 26)
530
                     kind = 26;
531
                  jjCheckNAdd(2);
532
                  break;
533
               default : break;
534
            }
535
         } while(i != startsAt);
536
      }
537
      if (kind != 0x7fffffff)
538
      {
539
         jjmatchedKind = kind;
540
         jjmatchedPos = curPos;
541
         kind = 0x7fffffff;
542
      }
543
      ++curPos;
544
      if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
545
         return curPos;
546
      try { curChar = input_stream.readChar(); }
547
      catch(java.io.IOException e) { return curPos; }
548
   }
549
}
550
static final int[] jjnextStates = {
551
};
552
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
553
{
554
   switch(hiByte)
555
   {
556
      case 0:
557
         return ((jjbitVec2[i2] & l2) != 0L);
558
      case 48:
559
         return ((jjbitVec3[i2] & l2) != 0L);
560
      case 49:
561
         return ((jjbitVec4[i2] & l2) != 0L);
562
      case 51:
563
         return ((jjbitVec5[i2] & l2) != 0L);
564
      case 61:
565
         return ((jjbitVec6[i2] & l2) != 0L);
566
      default : 
567
         if ((jjbitVec0[i1] & l1) != 0L)
568
            return true;
569
         return false;
570
   }
571
}
572
public static final String[] jjstrLiteralImages = {
573
"", null, null, "\57", "\72", "\75", "\133", "\135", "\173", "\175", "\54", 
574
"\53", "\55", "\43", "\176", "\56", "\52", "\162\145\141\144\117\156\154\171", 
575
"\165\156\151\157\156", "\163\165\142\163\145\164\163", "\162\145\144\145\146\151\156\145\163", 
576
"\157\162\144\145\162\145\144", "\165\156\157\162\144\145\162\145\144", "\165\156\151\161\165\145", 
577
"\156\157\156\165\156\151\161\165\145", null, null, null, null, };
578
public static final String[] lexStateNames = {
579
   "DEFAULT", 
580
};
581
static final long[] jjtoToken = {
582
   0x7fffff9L, 
583
};
584
static final long[] jjtoSkip = {
585
   0x6L, 
586
};
587
static final long[] jjtoSpecial = {
588
   0x6L, 
589
};
590
protected JavaCharStream input_stream;
591
private final int[] jjrounds = new int[3];
592
private final int[] jjstateSet = new int[6];
593
protected char curChar;
594
public AssociationEndParserTokenManager(JavaCharStream stream)
595
{
596
   if (JavaCharStream.staticFlag)
597
      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
598
   input_stream = stream;
599
}
600
public AssociationEndParserTokenManager(JavaCharStream stream, int lexState)
601
{
602
   this(stream);
603
   SwitchTo(lexState);
604
}
605
public void ReInit(JavaCharStream stream)
606
{
607
   jjmatchedPos = jjnewStateCnt = 0;
608
   curLexState = defaultLexState;
609
   input_stream = stream;
610
   ReInitRounds();
611
}
612
private final void ReInitRounds()
613
{
614
   int i;
615
   jjround = 0x80000001;
616
   for (i = 3; i-- > 0;)
617
      jjrounds[i] = 0x80000000;
618
}
619
public void ReInit(JavaCharStream stream, int lexState)
620
{
621
   ReInit(stream);
622
   SwitchTo(lexState);
623
}
624
public void SwitchTo(int lexState)
625
{
626
   if (lexState >= 1 || lexState < 0)
627
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
628
   else
629
      curLexState = lexState;
630
}
631
632
protected Token jjFillToken()
633
{
634
   Token t = Token.newToken(jjmatchedKind);
635
   t.kind = jjmatchedKind;
636
   String im = jjstrLiteralImages[jjmatchedKind];
637
   t.image = (im == null) ? input_stream.GetImage() : im;
638
   t.beginLine = input_stream.getBeginLine();
639
   t.beginColumn = input_stream.getBeginColumn();
640
   t.endLine = input_stream.getEndLine();
641
   t.endColumn = input_stream.getEndColumn();
642
   return t;
643
}
644
645
int curLexState = 0;
646
int defaultLexState = 0;
647
int jjnewStateCnt;
648
int jjround;
649
int jjmatchedPos;
650
int jjmatchedKind;
651
652
public Token getNextToken() 
653
{
654
  int kind;
655
  Token specialToken = null;
656
  Token matchedToken;
657
  int curPos = 0;
658
659
  EOFLoop :
660
  for (;;)
661
  {   
662
   try   
663
   {     
664
      curChar = input_stream.BeginToken();
665
   }     
666
   catch(java.io.IOException e)
667
   {        
668
      jjmatchedKind = 0;
669
      matchedToken = jjFillToken();
670
      matchedToken.specialToken = specialToken;
671
      return matchedToken;
672
   }
673
674
   jjmatchedKind = 0x7fffffff;
675
   jjmatchedPos = 0;
676
   curPos = jjMoveStringLiteralDfa0_0();
677
   if (jjmatchedKind != 0x7fffffff)
678
   {
679
      if (jjmatchedPos + 1 < curPos)
680
         input_stream.backup(curPos - jjmatchedPos - 1);
681
      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
682
      {
683
         matchedToken = jjFillToken();
684
         matchedToken.specialToken = specialToken;
685
         return matchedToken;
686
      }
687
      else
688
      {
689
         if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
690
         {
691
            matchedToken = jjFillToken();
692
            if (specialToken == null)
693
               specialToken = matchedToken;
694
            else
695
            {
696
               matchedToken.specialToken = specialToken;
697
               specialToken = (specialToken.next = matchedToken);
698
            }
699
         }
700
         continue EOFLoop;
701
      }
702
   }
703
   int error_line = input_stream.getEndLine();
704
   int error_column = input_stream.getEndColumn();
705
   String error_after = null;
706
   boolean EOFSeen = false;
707
   try { input_stream.readChar(); input_stream.backup(1); }
708
   catch (java.io.IOException e1) {
709
      EOFSeen = true;
710
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
711
      if (curChar == '\n' || curChar == '\r') {
712
         error_line++;
713
         error_column = 0;
714
      }
715
      else
716
         error_column++;
717
   }
718
   if (!EOFSeen) {
719
      input_stream.backup(1);
720
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
721
   }
722
   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
723
  }
724
}
725
726
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/InterfaceRealizationEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class InterfaceRealizationEditHelper extends UMLBaseEditHelper {
7
}
(-)icons/linkSourceNavigatorGroup.gif (+5 lines)
Added Link Here
1
GIF89aÕÿÿ­r/‚GøØˆžf'øÐxøà˜øÐ€f>2èÆ”øè°èЈøðÈÿÿÿË6úöºøà øØ?Œ]Føè˜Ò«€üößãϹ´2àÀx­r+ðØ?¥l$yO@ž_­l$?R¼2ï߯¼…2Å6!ù,s@€pH,?È#âèh:‚¨T0ô4®
2
‹à‘?p©€Ñd¢Y`B‚¡‹p8G AØ%‚%HÁçW¶	_B†‰Š‹?’“’š??–B¥¦¥ B­®­©C³´µI·¸FA;Content-Type: image/gif
3
4
GIF89aÕÿÿ­r/‚GøØˆžf'øÐxøà˜øÐ€f>2èÆ”øè°èЈøðÈÿÿÿË6úöºøà øØ?Œ]Føè˜Ò«€üößãϹ´2àÀx­r+ðØ?¥l$yO@ž_­l$?R¼2ï߯¼…2Å6!ù,s@€pH,?È#âèh:‚¨T0ô4®
5
‹à‘?p©€Ñd¢Y`B‚¡‹p8G AØ%‚%HÁçW¶	_B†‰Š‹?’“’š??–B¥¦¥ B­®­©C³´µI·¸FA;
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/ClassNameViewFactory.java (+29 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory;
8
import org.eclipse.gmf.runtime.notation.View;
9
10
/**
11
 * @generated
12
 */
13
public class ClassNameViewFactory extends BasicNodeViewFactory {
14
15
	/**
16
	 * @generated
17
	 */
18
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
19
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
20
	}
21
22
	/**
23
	 * @generated
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		return styles;
28
	}
29
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/slot/SlotParser.java (+310 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. SlotParser.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.slot;
14
15
import java.io.*;
16
import org.eclipse.emf.ecore.EClass;
17
import org.eclipse.emf.ecore.EObject;
18
import org.eclipse.uml2.diagram.parser.*;
19
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
20
import org.eclipse.uml2.uml.*;
21
22
public class SlotParser extends ExternalParserBase implements SlotParserConstants {
23
        private Slot mySubject;
24
        private Type myOptionalType;
25
26
    public SlotParser(){
27
        this(new StringReader(""));
28
    }
29
30
    public SlotParser(LookupSuite lookup){
31
        this();
32
        setLookupSuite(lookup);
33
    }
34
35
        public EClass getSubjectClass(){
36
                return UMLPackage.eINSTANCE.getSlot();
37
        }
38
39
        public void parse(EObject target, String text) throws ExternalParserException {
40
                checkContext();
41
                myOptionalType = null;
42
                ReInit(new StringReader(text));
43
                mySubject = (Slot)target;
44
                Declaration();
45
                mySubject = null;
46
                myOptionalType = null;
47
        }
48
49
        protected static int parseInt(Token t) throws ParseException {
50
                if (t.kind != SlotParserConstants.INTEGER_LITERAL){
51
                        throw new IllegalStateException("Token: " + t + ", image: " + t.image);
52
                }
53
                try {
54
                        return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
55
                } catch (NumberFormatException e){
56
                        throw new ParseException("Not supported integer value:" + t.image);
57
                }
58
        }
59
60
  final public void Declaration() throws ParseException {
61
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
62
    case IDENTIFIER:
63
      SlotFeatureName();
64
      break;
65
    default:
66
      jj_la1[0] = jj_gen;
67
      ;
68
    }
69
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
70
    case COLON:
71
      SlotFeatureType();
72
      break;
73
    default:
74
      jj_la1[1] = jj_gen;
75
      ;
76
    }
77
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
78
    case EQUALS:
79
      SlotValue();
80
      break;
81
    default:
82
      jj_la1[2] = jj_gen;
83
      ;
84
    }
85
    jj_consume_token(0);
86
  }
87
88
  final public void SlotFeatureName() throws ParseException {
89
        String name;
90
    name = NameWithSpaces();
91
                StructuralFeature feature = lookup(StructuralFeature.class, name);
92
                if (feature != null){
93
                        mySubject.setDefiningFeature(feature);
94
                }
95
  }
96
97
  final public void SlotFeatureType() throws ParseException {
98
        //we do not want to modify feature type when slot type is changed
99
        //however, we do want to use provided type to construct correct value
100
        //Thus we are going to cache type here and use it in the SlotValue()
101
        String type;
102
    jj_consume_token(COLON);
103
    type = NameWithSpaces();
104
                                          myOptionalType = lookup(Type.class, type);
105
  }
106
107
  final public String NameWithSpaces() throws ParseException {
108
        StringBuffer result = new StringBuffer();
109
        Token t;
110
    t = jj_consume_token(IDENTIFIER);
111
                                   result.append(t.image);
112
    label_1:
113
    while (true) {
114
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
115
      case IDENTIFIER:
116
        ;
117
        break;
118
      default:
119
        jj_la1[3] = jj_gen;
120
        break label_1;
121
      }
122
      t = jj_consume_token(IDENTIFIER);
123
                                     result.append(' '); result.append(t.image);
124
    }
125
                {if (true) return result.toString();}
126
    throw new Error("Missing return statement in function");
127
  }
128
129
/**
130
 * FIXME: Actually only integers and strings are supported. 
131
 * Expression will be used as escape if value is neither string nor integer literal
132
 */
133
  final public void SlotValue() throws ParseException {
134
        Token t;
135
        String text;
136
    jj_consume_token(EQUALS);
137
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
138
    case 29:
139
      jj_consume_token(29);
140
      text = NameWithSpaces();
141
      jj_consume_token(29);
142
                                LiteralString literalString = (LiteralString)mySubject.createValue(null, myOptionalType, UMLPackage.eINSTANCE.getLiteralString());
143
                                literalString.setValue(text);
144
      break;
145
    case IDENTIFIER:
146
      text = NameWithSpaces();
147
                                Expression expression = (Expression)mySubject.createValue(null, myOptionalType, UMLPackage.eINSTANCE.getExpression());
148
                                expression.setSymbol(text);
149
      break;
150
    case INTEGER_LITERAL:
151
      t = jj_consume_token(INTEGER_LITERAL);
152
                                int value = parseInt(t);
153
                                LiteralInteger literalInteger = (LiteralInteger)mySubject.createValue(null, myOptionalType, UMLPackage.eINSTANCE.getLiteralInteger());
154
                                literalInteger.setValue(value);
155
      break;
156
    default:
157
      jj_la1[4] = jj_gen;
158
      jj_consume_token(-1);
159
      throw new ParseException();
160
    }
161
  }
162
163
  public SlotParserTokenManager token_source;
164
  JavaCharStream jj_input_stream;
165
  public Token token, jj_nt;
166
  private int jj_ntk;
167
  private int jj_gen;
168
  final private int[] jj_la1 = new int[5];
169
  static private int[] jj_la1_0;
170
  static {
171
      jj_la1_0();
172
   }
173
   private static void jj_la1_0() {
174
      jj_la1_0 = new int[] {0x4000000,0x10,0x20,0x4000000,0x26000000,};
175
   }
176
177
  public SlotParser(java.io.InputStream stream) {
178
    jj_input_stream = new JavaCharStream(stream, 1, 1);
179
    token_source = new SlotParserTokenManager(jj_input_stream);
180
    token = new Token();
181
    jj_ntk = -1;
182
    jj_gen = 0;
183
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
184
  }
185
186
  public void ReInit(java.io.InputStream stream) {
187
    jj_input_stream.ReInit(stream, 1, 1);
188
    token_source.ReInit(jj_input_stream);
189
    token = new Token();
190
    jj_ntk = -1;
191
    jj_gen = 0;
192
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
193
  }
194
195
  public SlotParser(java.io.Reader stream) {
196
    jj_input_stream = new JavaCharStream(stream, 1, 1);
197
    token_source = new SlotParserTokenManager(jj_input_stream);
198
    token = new Token();
199
    jj_ntk = -1;
200
    jj_gen = 0;
201
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
202
  }
203
204
  public void ReInit(java.io.Reader stream) {
205
    jj_input_stream.ReInit(stream, 1, 1);
206
    token_source.ReInit(jj_input_stream);
207
    token = new Token();
208
    jj_ntk = -1;
209
    jj_gen = 0;
210
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
211
  }
212
213
  public SlotParser(SlotParserTokenManager tm) {
214
    token_source = tm;
215
    token = new Token();
216
    jj_ntk = -1;
217
    jj_gen = 0;
218
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
219
  }
220
221
  public void ReInit(SlotParserTokenManager tm) {
222
    token_source = tm;
223
    token = new Token();
224
    jj_ntk = -1;
225
    jj_gen = 0;
226
    for (int i = 0; i < 5; i++) jj_la1[i] = -1;
227
  }
228
229
  final private Token jj_consume_token(int kind) throws ParseException {
230
    Token oldToken;
231
    if ((oldToken = token).next != null) token = token.next;
232
    else token = token.next = token_source.getNextToken();
233
    jj_ntk = -1;
234
    if (token.kind == kind) {
235
      jj_gen++;
236
      return token;
237
    }
238
    token = oldToken;
239
    jj_kind = kind;
240
    throw generateParseException();
241
  }
242
243
  final public Token getNextToken() {
244
    if (token.next != null) token = token.next;
245
    else token = token.next = token_source.getNextToken();
246
    jj_ntk = -1;
247
    jj_gen++;
248
    return token;
249
  }
250
251
  final public Token getToken(int index) {
252
    Token t = token;
253
    for (int i = 0; i < index; i++) {
254
      if (t.next != null) t = t.next;
255
      else t = t.next = token_source.getNextToken();
256
    }
257
    return t;
258
  }
259
260
  final private int jj_ntk() {
261
    if ((jj_nt=token.next) == null)
262
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
263
    else
264
      return (jj_ntk = jj_nt.kind);
265
  }
266
267
  private java.util.Vector jj_expentries = new java.util.Vector();
268
  private int[] jj_expentry;
269
  private int jj_kind = -1;
270
271
  public ParseException generateParseException() {
272
    jj_expentries.removeAllElements();
273
    boolean[] la1tokens = new boolean[30];
274
    for (int i = 0; i < 30; i++) {
275
      la1tokens[i] = false;
276
    }
277
    if (jj_kind >= 0) {
278
      la1tokens[jj_kind] = true;
279
      jj_kind = -1;
280
    }
281
    for (int i = 0; i < 5; i++) {
282
      if (jj_la1[i] == jj_gen) {
283
        for (int j = 0; j < 32; j++) {
284
          if ((jj_la1_0[i] & (1<<j)) != 0) {
285
            la1tokens[j] = true;
286
          }
287
        }
288
      }
289
    }
290
    for (int i = 0; i < 30; i++) {
291
      if (la1tokens[i]) {
292
        jj_expentry = new int[1];
293
        jj_expentry[0] = i;
294
        jj_expentries.addElement(jj_expentry);
295
      }
296
    }
297
    int[][] exptokseq = new int[jj_expentries.size()][];
298
    for (int i = 0; i < jj_expentries.size(); i++) {
299
      exptokseq[i] = (int[])jj_expentries.elementAt(i);
300
    }
301
    return new ParseException(token, exptokseq, tokenImage);
302
  }
303
304
  final public void enable_tracing() {
305
  }
306
307
  final public void disable_tracing() {
308
  }
309
310
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/UsageViewFactory.java (+48 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory;
10
import org.eclipse.gmf.runtime.notation.NotationFactory;
11
import org.eclipse.gmf.runtime.notation.View;
12
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
13
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
14
15
/**
16
 * @generated
17
 */
18
public class UsageViewFactory extends ConnectionViewFactory {
19
20
	/**
21
	 * @generated 
22
	 */
23
	protected List createStyles(View view) {
24
		List styles = new ArrayList();
25
		styles.add(NotationFactory.eINSTANCE.createRoutingStyle());
26
		styles.add(NotationFactory.eINSTANCE.createFontStyle());
27
		styles.add(NotationFactory.eINSTANCE.createLineStyle());
28
		return styles;
29
	}
30
31
	/**
32
	 * @generated
33
	 */
34
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
35
		if (semanticHint == null) {
36
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.UsageEditPart.VISUAL_ID);
37
			view.setType(semanticHint);
38
		}
39
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
40
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
41
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
42
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
43
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
44
			view.getEAnnotations().add(shortcutAnnotation);
45
		}
46
	}
47
48
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PackageClassifiersViewFactory.java (+74 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class PackageClassifiersViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
29
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
30
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
31
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
32
		return styles;
33
	}
34
35
	/**
36
	 * @generated
37
	 */
38
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
39
		if (semanticHint == null) {
40
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.PackageClassifiersEditPart.VISUAL_ID);
41
			view.setType(semanticHint);
42
		}
43
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
44
		setupCompartmentTitle(view);
45
		setupCompartmentCollapsed(view);
46
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
47
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
48
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
49
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
50
			view.getEAnnotations().add(shortcutAnnotation);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	protected void setupCompartmentTitle(View view) {
58
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
59
		if (titleStyle != null) {
60
			titleStyle.setShowTitle(true);
61
		}
62
	}
63
64
	/**
65
	 * @generated
66
	 */
67
	protected void setupCompartmentCollapsed(View view) {
68
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
69
		if (drawerStyle != null) {
70
			drawerStyle.setCollapsed(false);
71
		}
72
	}
73
74
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/InstanceSpecificationSlotsViewFactory.java (+73 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
10
import org.eclipse.gmf.runtime.notation.DrawerStyle;
11
import org.eclipse.gmf.runtime.notation.NotationFactory;
12
import org.eclipse.gmf.runtime.notation.NotationPackage;
13
import org.eclipse.gmf.runtime.notation.TitleStyle;
14
import org.eclipse.gmf.runtime.notation.View;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
17
18
/**
19
 * @generated
20
 */
21
public class InstanceSpecificationSlotsViewFactory extends ListCompartmentViewFactory {
22
23
	/**
24
	 * @generated 
25
	 */
26
	protected List createStyles(View view) {
27
		List styles = new ArrayList();
28
		styles.add(NotationFactory.eINSTANCE.createTitleStyle());
29
		styles.add(NotationFactory.eINSTANCE.createSortingStyle());
30
		styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
31
		return styles;
32
	}
33
34
	/**
35
	 * @generated
36
	 */
37
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
38
		if (semanticHint == null) {
39
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.InstanceSpecificationSlotsEditPart.VISUAL_ID);
40
			view.setType(semanticHint);
41
		}
42
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
43
		setupCompartmentTitle(view);
44
		setupCompartmentCollapsed(view);
45
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
46
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
47
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
48
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
49
			view.getEAnnotations().add(shortcutAnnotation);
50
		}
51
	}
52
53
	/**
54
	 * @generated
55
	 */
56
	protected void setupCompartmentTitle(View view) {
57
		TitleStyle titleStyle = (TitleStyle) view.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
58
		if (titleStyle != null) {
59
			titleStyle.setShowTitle(true);
60
		}
61
	}
62
63
	/**
64
	 * @generated
65
	 */
66
	protected void setupCompartmentCollapsed(View view) {
67
		DrawerStyle drawerStyle = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
68
		if (drawerStyle != null) {
69
			drawerStyle.setCollapsed(false);
70
		}
71
	}
72
73
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/OperationViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class OperationViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.OperationEditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/OperationEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class OperationEditHelper extends UMLBaseEditHelper {
7
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/property/PropertyParserConstants.java (+79 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. PropertyParserConstants.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.property;
14
15
public interface PropertyParserConstants {
16
17
  int EOF = 0;
18
  int SLASH = 3;
19
  int COLON = 4;
20
  int EQUALS = 5;
21
  int LBRACKET = 6;
22
  int RBRACKET = 7;
23
  int LCURLY = 8;
24
  int RCURLY = 9;
25
  int COMMA = 10;
26
  int PLUS = 11;
27
  int MINUS = 12;
28
  int NUMBER_SIGN = 13;
29
  int TILDE = 14;
30
  int DOT = 15;
31
  int STAR = 16;
32
  int READ_ONLY = 17;
33
  int UNION = 18;
34
  int SUBSETS = 19;
35
  int REDEFINES = 20;
36
  int ORDERED = 21;
37
  int UNORDERED = 22;
38
  int UNIQUE = 23;
39
  int NON_UNIQUE = 24;
40
  int INTEGER_LITERAL = 25;
41
  int IDENTIFIER = 26;
42
  int LETTER = 27;
43
  int DIGIT = 28;
44
45
  int DEFAULT = 0;
46
47
  String[] tokenImage = {
48
    "<EOF>",
49
    "\" \"",
50
    "\"\\t\"",
51
    "\"/\"",
52
    "\":\"",
53
    "\"=\"",
54
    "\"[\"",
55
    "\"]\"",
56
    "\"{\"",
57
    "\"}\"",
58
    "\",\"",
59
    "\"+\"",
60
    "\"-\"",
61
    "\"#\"",
62
    "\"~\"",
63
    "\".\"",
64
    "\"*\"",
65
    "\"readOnly\"",
66
    "\"union\"",
67
    "\"subsets\"",
68
    "\"redefines\"",
69
    "\"ordered\"",
70
    "\"unordered\"",
71
    "\"unique\"",
72
    "\"nonunique\"",
73
    "<INTEGER_LITERAL>",
74
    "<IDENTIFIER>",
75
    "<LETTER>",
76
    "<DIGIT>",
77
  };
78
79
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLDiagramActionBarContributor.java (+23 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor;
4
5
/**
6
 * @generated
7
 */
8
public class UMLDiagramActionBarContributor extends DiagramActionBarContributor {
9
10
	/**
11
	 * @generated
12
	 */
13
	protected Class getEditorClass() {
14
		return UMLDiagramEditor.class;
15
	}
16
17
	/**
18
	 * @generated
19
	 */
20
	protected String getEditorId() {
21
		return UMLDiagramEditor.ID;
22
	}
23
}
(-).cvsignore (+2 lines)
Added Link Here
1
bin
2
.settings
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLInitDiagramFileAction.java (+98 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import org.eclipse.core.resources.IFile;
4
import org.eclipse.emf.common.util.URI;
5
import org.eclipse.emf.common.util.WrappedException;
6
import org.eclipse.emf.ecore.EObject;
7
import org.eclipse.emf.ecore.resource.Resource;
8
import org.eclipse.emf.ecore.resource.ResourceSet;
9
import org.eclipse.emf.transaction.TransactionalEditingDomain;
10
import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
11
import org.eclipse.jface.action.IAction;
12
import org.eclipse.jface.dialogs.IDialogSettings;
13
import org.eclipse.jface.dialogs.MessageDialog;
14
import org.eclipse.jface.viewers.ISelection;
15
import org.eclipse.jface.viewers.IStructuredSelection;
16
import org.eclipse.jface.viewers.StructuredSelection;
17
import org.eclipse.jface.wizard.Wizard;
18
import org.eclipse.jface.wizard.WizardDialog;
19
import org.eclipse.ui.IObjectActionDelegate;
20
import org.eclipse.ui.IWorkbenchPart;
21
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
22
23
/**
24
 * @generated
25
 */
26
public class UMLInitDiagramFileAction implements IObjectActionDelegate {
27
28
	/**
29
	 * @generated
30
	 */
31
	private IWorkbenchPart myPart;
32
33
	/**
34
	 * @generated
35
	 */
36
	private IFile mySelectedModelFile;
37
38
	/**
39
	 * @generated
40
	 */
41
	private IStructuredSelection mySelection;
42
43
	/**
44
	 * @generated
45
	 */
46
	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
47
		myPart = targetPart;
48
	}
49
50
	/**
51
	 * @generated
52
	 */
53
	public void selectionChanged(IAction action, ISelection selection) {
54
		mySelectedModelFile = null;
55
		mySelection = StructuredSelection.EMPTY;
56
		action.setEnabled(false);
57
		if (selection instanceof IStructuredSelection == false || selection.isEmpty()) {
58
			return;
59
		}
60
		mySelection = (IStructuredSelection) selection;
61
		mySelectedModelFile = (IFile) ((IStructuredSelection) selection).getFirstElement();
62
		action.setEnabled(true);
63
	}
64
65
	/**
66
	 * @generated
67
	 */
68
	public void run(IAction action) {
69
		TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
70
		ResourceSet resourceSet = editingDomain.getResourceSet();
71
		EObject diagramRoot = null;
72
		try {
73
			Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(mySelectedModelFile.getFullPath().toString()), true);
74
			diagramRoot = (EObject) resource.getContents().get(0);
75
		} catch (WrappedException ex) {
76
			UMLDiagramEditorPlugin.getInstance().logError("Unable to load resource: " + mySelectedModelFile.getFullPath().toString(), ex); //$NON-NLS-1$
77
		}
78
		if (diagramRoot == null) {
79
			MessageDialog.openError(myPart.getSite().getShell(), "Error", "Model file loading failed");
80
			return;
81
		}
82
		Wizard wizard = new UMLNewDiagramFileWizard(mySelectedModelFile, myPart.getSite().getPage(), mySelection, diagramRoot, editingDomain);
83
		IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin.getInstance().getDialogSettings();
84
		IDialogSettings initDiagramFileSettings = pluginDialogSettings.getSection("InisDiagramFile"); //$NON-NLS-1$
85
		if (initDiagramFileSettings == null) {
86
			initDiagramFileSettings = pluginDialogSettings.addNewSection("InisDiagramFile"); //$NON-NLS-1$
87
		}
88
		wizard.setDialogSettings(initDiagramFileSettings);
89
		wizard.setForcePreviousAndNextButtons(false);
90
		wizard.setWindowTitle("Initialize new " + PackageEditPart.MODEL_ID + " diagram file");
91
92
		WizardDialog dialog = new WizardDialog(myPart.getSite().getShell(), wizard);
93
		dialog.create();
94
		dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), 500);
95
		dialog.open();
96
	}
97
98
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/EnumerationNameViewFactory.java (+29 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory;
8
import org.eclipse.gmf.runtime.notation.View;
9
10
/**
11
 * @generated
12
 */
13
public class EnumerationNameViewFactory extends BasicNodeViewFactory {
14
15
	/**
16
	 * @generated
17
	 */
18
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
19
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
20
	}
21
22
	/**
23
	 * @generated
24
	 */
25
	protected List createStyles(View view) {
26
		List styles = new ArrayList();
27
		return styles;
28
	}
29
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/operation/operation.jj (+523 lines)
Added Link Here
1
options {
2
  JAVA_UNICODE_ESCAPE = true;
3
  STATIC=false;
4
}
5
6
PARSER_BEGIN(OperationParser)
7
8
/*
9
 * Copyright (c) 2006 Borland Software Corporation
10
 * 
11
 * All rights reserved. This program and the accompanying materials
12
 * are made available under the terms of the Eclipse Public License v1.0
13
 * which accompanies this distribution, and is available at
14
 * http://www.eclipse.org/legal/epl-v10.html
15
 *
16
 * Contributors:
17
 *    Michael Golubev (Borland) - initial API and implementation
18
 */
19
package org.eclipse.uml2.diagram.clazz.parser.operation;
20
21
import java.io.*;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EObject;
24
import org.eclipse.uml2.diagram.parser.*;
25
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
26
import org.eclipse.uml2.uml.*;
27
28
/**
29
 * JavaCC does not support any "include" construct. 
30
 * This parser shares a lot of delcrations (mainly at the tokens level) 
31
 * with other parsers (see PropertyParser, etc)
32
 * but we do not yet know how to avoid duplication of the delarations. 
33
 */
34
public class OperationParser extends ExternalParserBase {
35
	private OperationAdapter myOperation;
36
	private ParameterAdapter myCurrentParameter;
37
	
38
	private static interface TypeGate {
39
		public void setType(Type type);
40
		public void setName(String name);
41
	}
42
	
43
	private static interface MultiplicityGate {
44
		public void setIsOrdered(boolean ordered);
45
		public void setIsUnique(boolean unique);
46
		public void setLower(int lower);
47
		public void setUpper(int upper);
48
	}
49
	
50
	private static class ParameterAdapter implements TypeGate, MultiplicityGate {
51
		private final Parameter myParameter;
52
		
53
		public ParameterAdapter(){
54
			myParameter = UMLFactory.eINSTANCE.createParameter();
55
		}
56
		
57
		public Parameter getParameter(){
58
			return myParameter;
59
		}
60
		
61
		public void setType(Type type){
62
			myParameter.setType(type);
63
		}
64
		
65
		public void setName(String name){
66
			myParameter.setName(name);
67
		}
68
69
		public void setIsOrdered(boolean value) {
70
			myParameter.setIsOrdered(value);
71
		}
72
73
		public void setIsUnique(boolean value) {
74
			myParameter.setIsUnique(value);
75
		}
76
77
		public void setLower(int value) {
78
			myParameter.setLower(value);
79
		}
80
81
		public void setUpper(int value) {
82
			myParameter.setUpper(value);
83
		}
84
	}
85
	
86
	private static class OperationAdapter implements TypeGate, MultiplicityGate {
87
		private final Operation myOperation;
88
89
		public OperationAdapter(Operation operation){
90
			myOperation = operation;
91
			if (myOperation.getReturnResult() == null){
92
				myOperation.createReturnResult(null, null);
93
			}
94
		}
95
		
96
		public Operation getOperation(){
97
			return myOperation;
98
		}
99
		
100
		public void setType(Type type) {
101
			myOperation.setType(type);
102
		}
103
		
104
		public void setName(String name){
105
			myOperation.setName(name);
106
		}
107
108
		public void setIsOrdered(boolean ordered) {
109
			myOperation.setIsOrdered(ordered);
110
		}
111
		
112
		public void setIsUnique(boolean value) {
113
			myOperation.setIsUnique(value);
114
		}
115
116
		public void setLower(int value) {
117
			myOperation.setLower(value);
118
		}
119
120
		public void setUpper(int value) {
121
			myOperation.setUpper(value);
122
		}
123
		
124
	}
125
	
126
    public OperationParser(){
127
    	this(new StringReader(""));
128
    }
129
    
130
    public OperationParser(LookupSuite lookup){
131
    	this();
132
    	setLookupSuite(lookup);
133
    }
134
135
	public EClass getSubjectClass(){
136
		return UMLPackage.eINSTANCE.getOperation();
137
	}
138
	
139
	public void parse(EObject target, String text) throws ExternalParserException {
140
		checkContext();	
141
		ReInit(new StringReader(text));
142
		myOperation = new OperationAdapter((Operation)target);
143
		myCurrentParameter = null;
144
		Declaration();
145
		myOperation = null;
146
	}
147
	
148
	protected static int parseInt(Token t) throws ParseException {
149
		if (t.kind != OperationParserConstants.INTEGER_LITERAL){
150
			throw new IllegalStateException("Token: " + t + ", image: " + t.image);
151
		}
152
		try {
153
			return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
154
		} catch (NumberFormatException e){
155
			throw new ParseException("Not supported integer value:" + t.image);
156
		}
157
	}
158
	
159
	private MultiplicityGate getCurrentMultiplicityElement(){
160
		return myCurrentParameter != null ? myCurrentParameter : (MultiplicityGate)myOperation;
161
	}
162
	
163
	private TypeGate getCurrentTypedElement(){
164
		return myCurrentParameter != null ? myCurrentParameter : (TypeGate)myOperation;
165
	}
166
	
167
	private Operation getOperation(){
168
		return myOperation.getOperation();
169
	}
170
	
171
	private Parameter getCurrentParameter(){
172
		if (myCurrentParameter == null){
173
			throw new IllegalStateException("We are not in the parameter list. Check BNF");
174
		}
175
		return myCurrentParameter.getParameter();
176
	}
177
	
178
	private void registerParameter() {
179
		getOperation().getOwnedParameters().add(getCurrentParameter());
180
		myCurrentParameter = null;
181
	}
182
	
183
	private void startParameter() {
184
		myCurrentParameter = new ParameterAdapter();
185
	}
186
	
187
}
188
189
PARSER_END(OperationParser)
190
191
/* WHITE SPACE */
192
193
SPECIAL_TOKEN :
194
{
195
  " "
196
| "\t"
197
}
198
199
/* SEPARATORS */
200
TOKEN :
201
{
202
	< SLASH: "/" >
203
|	< COLON: ":" >
204
|	< EQUALS: "=" >
205
|	< LBRACKET: "[" >
206
|	< RBRACKET: "]" >
207
|	< LCURLY: "{" >
208
|	< RCURLY: "}" >
209
|	< LPAREN: "(" >
210
|	< RPAREN: ")" >
211
|	< COMMA: "," >
212
}
213
214
/* SPECIAL_MEANING */
215
TOKEN :
216
{
217
	< PLUS: "+" >
218
|	< MINUS: "-" >
219
|	< NUMBER_SIGN: "#" >
220
|	< TILDE: "~" >
221
|	< DOT: "." >
222
|	< STAR: "*" >
223
}
224
225
/* MODIFIERS */
226
TOKEN :
227
{
228
	< REDEFINES: "redefines" >
229
|	< ORDERED: "ordered" >
230
|	< UNORDERED: "unordered" > 
231
|	< UNIQUE: "unique" >
232
|	< NON_UNIQUE: "nonunique" >
233
}
234
235
/* OPERATION SPECIFIC */
236
TOKEN : 
237
{
238
	< QUERY: "query" >
239
|	< IN: "in" >
240
|	< OUT: "out" >
241
|	< IN_OUT: "inout" >	
242
}
243
	
244
/* LITERALS */
245
TOKEN: 
246
{
247
	< INTEGER_LITERAL: ["0"-"9"] (["0"-"9"])* >
248
}
249
  
250
TOKEN :
251
{
252
  < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
253
|
254
  < #LETTER:
255
      [
256
       "\u0024",
257
       "\u0041"-"\u005a",
258
       "\u005f",
259
       "\u0061"-"\u007a",
260
       "\u00c0"-"\u00d6",
261
       "\u00d8"-"\u00f6",
262
       "\u00f8"-"\u00ff",
263
       "\u0100"-"\u1fff",
264
       "\u3040"-"\u318f",
265
       "\u3300"-"\u337f",
266
       "\u3400"-"\u3d2d",
267
       "\u4e00"-"\u9fff",
268
       "\uf900"-"\ufaff"
269
      ]
270
  >
271
|
272
  < #DIGIT:
273
      [
274
       "\u0030"-"\u0039",
275
       "\u0660"-"\u0669",
276
       "\u06f0"-"\u06f9",
277
       "\u0966"-"\u096f",
278
       "\u09e6"-"\u09ef",
279
       "\u0a66"-"\u0a6f",
280
       "\u0ae6"-"\u0aef",
281
       "\u0b66"-"\u0b6f",
282
       "\u0be7"-"\u0bef",
283
       "\u0c66"-"\u0c6f",
284
       "\u0ce6"-"\u0cef",
285
       "\u0d66"-"\u0d6f",
286
       "\u0e50"-"\u0e59",
287
       "\u0ed0"-"\u0ed9",
288
       "\u1040"-"\u1049"
289
      ]
290
  >
291
}
292
293
void Declaration() :
294
{}
295
{
296
	(
297
		[ Visibility() ]
298
		Name()
299
		<LPAREN>
300
		[ ParametersList() ]
301
		<RPAREN>
302
		[ Type() ]
303
		[ OperationModifiers() ]
304
	) <EOF>
305
}
306
307
void ParametersList() :
308
{}
309
{
310
	Parameter() 
311
	( <COMMA> Parameter() )*
312
}
313
314
void Parameter() :
315
{
316
	startParameter();
317
}
318
{
319
	(
320
		[ ParameterDirection() ]
321
		Name()
322
		[ Type() ]
323
		[ Multiplicity() ]
324
		[ DefaultValue() ]
325
		// XXX: what is this? [ ParamerPropertiesList() ]
326
	) 
327
	{
328
		registerParameter();
329
	}
330
}
331
332
void ParameterDirection() :
333
{
334
	ParameterDirectionKind kind;
335
}
336
{
337
	(
338
		<IN> { kind = ParameterDirectionKind.IN_LITERAL; }
339
	|
340
		<OUT> { kind = ParameterDirectionKind.OUT_LITERAL; }
341
	|
342
		<IN_OUT> { kind = ParameterDirectionKind.INOUT_LITERAL; }
343
	)	
344
	{
345
		getCurrentParameter().setDirection(kind);
346
	}
347
}
348
349
void Visibility() :
350
{ 
351
	VisibilityKind kind;
352
}
353
{
354
	(
355
		<PLUS> { kind = VisibilityKind.PUBLIC_LITERAL; }
356
	|
357
		<MINUS> { kind = VisibilityKind.PRIVATE_LITERAL; }
358
	|
359
		<NUMBER_SIGN> { kind = VisibilityKind.PROTECTED_LITERAL; }
360
	|
361
		<TILDE> { kind = VisibilityKind.PACKAGE_LITERAL; }
362
	)
363
	{
364
		getOperation().setVisibility(kind);
365
	}
366
}
367
368
void Name() :
369
{
370
	String name;
371
}
372
{
373
	name = NameWithSpaces() 
374
	{
375
		getCurrentTypedElement().setName(name);
376
	}
377
}
378
379
void Multiplicity() :
380
{}
381
{
382
	MultiplicityRange() 
383
	[ MultiplicityDesignator() ] 
384
}
385
386
void MultiplicityDesignator() :
387
{ }
388
{
389
	<LCURLY> 
390
	(
391
		( MultiplicityUnique() [ MultiplicityOrdered() ] ) 
392
		|
393
		( MultiplicityOrdered() [ MultiplicityUnique() ] ) 
394
	) 
395
	<RCURLY>
396
}
397
398
void MultiplicityUnique() :
399
{
400
	MultiplicityGate multiplicity = getCurrentMultiplicityElement();
401
}
402
{
403
		<UNIQUE> { multiplicity.setIsUnique(true); }
404
	|
405
		<NON_UNIQUE> { multiplicity.setIsUnique(false); }	
406
}
407
408
void MultiplicityOrdered() :
409
{
410
	MultiplicityGate multiplicity = getCurrentMultiplicityElement();
411
}
412
{
413
		<ORDERED> { multiplicity.setIsOrdered(true); }
414
	|
415
		<UNORDERED> { multiplicity.setIsOrdered(false); }
416
}
417
418
/* XXX: ValueSpecification -- how to parse */
419
void MultiplicityRange() :
420
{
421
	Token tLower = null;
422
	Token tUpper;
423
	MultiplicityGate multiplicity = getCurrentMultiplicityElement();
424
}
425
{
426
	<LBRACKET>
427
	(
428
		[ LOOKAHEAD(2) tLower = <INTEGER_LITERAL> <DOT> <DOT> { multiplicity.setLower(parseInt(tLower)); } ] 
429
		(
430
			tUpper = <STAR> 
431
			{ 
432
				if (tLower == null){
433
					multiplicity.setLower(0);
434
				}
435
				multiplicity.setUpper(LiteralUnlimitedNatural.UNLIMITED); 
436
			}
437
		| 
438
			tUpper = <INTEGER_LITERAL> 
439
			{ 
440
				if (tLower == null){
441
					multiplicity.setLower(parseInt(tUpper));
442
				}
443
				multiplicity.setUpper(parseInt(tUpper)); 
444
			}
445
		)
446
	)
447
	<RBRACKET>
448
}
449
450
void Type() :
451
{
452
	String type;
453
}
454
{
455
	<COLON> type = NameWithSpaces() { getCurrentTypedElement().setType(lookup(Type.class, type)); }
456
}
457
458
String NameWithSpaces() :
459
{
460
	StringBuffer result = new StringBuffer();
461
	Token t;
462
}
463
{
464
	(
465
		t = <IDENTIFIER> { result.append(t.image); } 
466
		( t = <IDENTIFIER> { result.append(' '); result.append(t.image); } ) *
467
	)
468
	{
469
		return result.toString();
470
	}
471
}
472
473
void DefaultValue() :
474
{
475
	Token t;	
476
}
477
{
478
	(
479
		<EQUALS> ( t = <IDENTIFIER> | t = <INTEGER_LITERAL> { /* XXX: Should be Expression */ } )
480
	)
481
	{
482
		getCurrentParameter().setDefault(t.image);
483
	}
484
}
485
486
void SimpleTokenPropertyModifier() :
487
{}
488
{
489
	(
490
		<QUERY> { getOperation().setIsQuery(true); }
491
	|
492
		<ORDERED> { getOperation().setIsOrdered(true); }
493
	|
494
		<UNORDERED> { getOperation().setIsOrdered(false); }
495
	|
496
		<UNIQUE> { getOperation().setIsUnique(true); }
497
	|
498
		<NON_UNIQUE> { getOperation().setIsUnique(false); }
499
	)
500
}
501
502
void ReferencingPropertyModifier() :
503
{
504
	String name;
505
}
506
{
507
	<REDEFINES> name = NameWithSpaces() 
508
	{ 
509
		RedefinableElement redefines = lookup(RedefinableElement.class, name); 
510
		if (redefines != null) {
511
			getOperation().getRedefinedElements().add(redefines);
512
		}
513
	}
514
}
515
516
void OperationModifiers() :
517
{}
518
{
519
	<LCURLY> 
520
	( SimpleTokenPropertyModifier() | ReferencingPropertyModifier() )
521
	( <COMMA> ( SimpleTokenPropertyModifier() | ReferencingPropertyModifier() ) ) *
522
	<RCURLY>
523
}
(-)src/org/eclipse/uml2/diagram/clazz/part/UMLLoadResourceAction.java (+63 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.part;
2
3
import org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog;
4
import org.eclipse.jface.action.IAction;
5
import org.eclipse.jface.viewers.ISelection;
6
import org.eclipse.jface.viewers.IStructuredSelection;
7
import org.eclipse.swt.widgets.Shell;
8
import org.eclipse.ui.IObjectActionDelegate;
9
import org.eclipse.ui.IWorkbenchPart;
10
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
11
12
/**
13
 * @generated
14
 */
15
public class UMLLoadResourceAction implements IObjectActionDelegate {
16
17
	/**
18
	 * @generated
19
	 */
20
	private PackageEditPart mySelectedElement;
21
22
	/**
23
	 * @generated
24
	 */
25
	private Shell myShell;
26
27
	/**
28
	 * @generated
29
	 */
30
	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
31
		myShell = targetPart.getSite().getShell();
32
	}
33
34
	/**
35
	 * @generated
36
	 */
37
	public void run(IAction action) {
38
		LoadResourceDialog loadResourceDialog = new LoadResourceDialog(myShell, mySelectedElement.getEditingDomain());
39
		loadResourceDialog.open();
40
	}
41
42
	/**
43
	 * @generated
44
	 */
45
	public void selectionChanged(IAction action, ISelection selection) {
46
		mySelectedElement = null;
47
		if (selection instanceof IStructuredSelection) {
48
			IStructuredSelection structuredSelection = (IStructuredSelection) selection;
49
			if (structuredSelection.size() == 1 && structuredSelection.getFirstElement() instanceof PackageEditPart) {
50
				mySelectedElement = (PackageEditPart) structuredSelection.getFirstElement();
51
			}
52
		}
53
		action.setEnabled(isEnabled());
54
	}
55
56
	/**
57
	 * @generated
58
	 */
59
	private boolean isEnabled() {
60
		return mySelectedElement != null;
61
	}
62
63
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/instance/instance.jj (+240 lines)
Added Link Here
1
options {
2
  JAVA_UNICODE_ESCAPE = true;
3
  STATIC=false;
4
}
5
6
PARSER_BEGIN(InstanceSpecificationParser)
7
8
/*
9
 * Copyright (c) 2006 Borland Software Corporation
10
 * 
11
 * All rights reserved. This program and the accompanying materials
12
 * are made available under the terms of the Eclipse Public License v1.0
13
 * which accompanies this distribution, and is available at
14
 * http://www.eclipse.org/legal/epl-v10.html
15
 *
16
 * Contributors:
17
 *    Michael Golubev (Borland) - initial API and implementation
18
 */
19
package org.eclipse.uml2.diagram.clazz.parser.instance;
20
21
import java.io.*;
22
import java.util.*;
23
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EObject;
25
import org.eclipse.uml2.diagram.parser.*;
26
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
27
import org.eclipse.uml2.diagram.parser.lookup.LookupResolver;
28
import org.eclipse.uml2.uml.*;
29
30
public class InstanceSpecificationParser extends ExternalParserBase {
31
	private InstanceSpecification mySubject;
32
	
33
    private static class ClassifierLookupCallback implements LookupResolver.Callback {
34
    	private final InstanceSpecification mySubject;
35
36
		public ClassifierLookupCallback(InstanceSpecification subject){
37
			mySubject = subject;
38
    	}
39
    	
40
    	public void lookupResolved(NamedElement resolution) {
41
    		if (resolution instanceof Classifier){
42
    			mySubject.getClassifiers().add(resolution);
43
    		}
44
    	}
45
    }
46
47
    public InstanceSpecificationParser(){
48
    	this(new StringReader(""));
49
    }
50
    
51
    public InstanceSpecificationParser(LookupSuite lookup){
52
    	this();
53
    	setLookupSuite(lookup);
54
    }
55
56
	public EClass getSubjectClass(){
57
		return UMLPackage.eINSTANCE.getInstanceSpecification();
58
	}
59
	
60
	public void parse(EObject target, String text) throws ExternalParserException {
61
		checkContext();	
62
		ReInit(new StringReader(text));
63
		mySubject = (InstanceSpecification)target;
64
		Declaration();
65
		mySubject = null;
66
	}
67
	
68
	public InstanceSpecification parseNew(String text) throws ExternalParserException {
69
		InstanceSpecification instance = UMLFactory.eINSTANCE.createInstanceSpecification();
70
		parse(instance, text);
71
		return instance;	
72
	}
73
	
74
	protected static int parseInt(Token t) throws ParseException {
75
		if (t.kind != InstanceSpecificationParserConstants.INTEGER_LITERAL){
76
			throw new IllegalStateException("Token: " + t + ", image: " + t.image);
77
		}
78
		try {
79
			return Integer.parseInt(t.image); //XXX: "0005", "99999999999999999999999"
80
		} catch (NumberFormatException e){
81
			throw new ParseException("Not supported integer value:" + t.image);
82
		}
83
	}
84
	
85
}
86
87
PARSER_END(InstanceSpecificationParser)
88
89
/* WHITE SPACE */
90
91
SPECIAL_TOKEN :
92
{
93
  " "
94
| "\t"
95
}
96
97
/* SEPARATORS */
98
TOKEN :
99
{
100
	< SLASH: "/" >
101
|	< COLON: ":" >
102
|	< EQUALS: "=" >
103
|	< LBRACKET: "[" >
104
|	< RBRACKET: "]" >
105
|	< LCURLY: "{" >
106
|	< RCURLY: "}" >
107
|	< COMMA: "," >
108
}
109
110
/* SPECIAL_MEANING */
111
TOKEN :
112
{
113
	< PLUS: "+" >
114
|	< MINUS: "-" >
115
|	< NUMBER_SIGN: "#" >
116
|	< TILDE: "~" >
117
|	< DOT: "." >
118
|	< STAR: "*" >
119
}
120
121
/* MODIFIERS */
122
TOKEN :
123
{
124
	< READ_ONLY: "readOnly" >
125
|	< UNION: "union" >
126
|	< SUBSETS: "subsets" >
127
|	< REDEFINES: "redefines" >
128
|	< ORDERED: "ordered" >
129
|	< UNORDERED: "unordered" > 
130
|	< UNIQUE: "unique" >
131
|	< NON_UNIQUE: "nonunique" >
132
}
133
	
134
/* LITERALS */
135
TOKEN: 
136
{
137
	< INTEGER_LITERAL: ["0"-"9"] (["0"-"9"])* >
138
}
139
  
140
TOKEN :
141
{
142
  < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
143
|
144
  < #LETTER:
145
      [
146
       "\u0024",
147
       "\u0041"-"\u005a",
148
       "\u005f",
149
       "\u0061"-"\u007a",
150
       "\u00c0"-"\u00d6",
151
       "\u00d8"-"\u00f6",
152
       "\u00f8"-"\u00ff",
153
       "\u0100"-"\u1fff",
154
       "\u3040"-"\u318f",
155
       "\u3300"-"\u337f",
156
       "\u3400"-"\u3d2d",
157
       "\u4e00"-"\u9fff",
158
       "\uf900"-"\ufaff"
159
      ]
160
  >
161
|
162
  < #DIGIT:
163
      [
164
       "\u0030"-"\u0039",
165
       "\u0660"-"\u0669",
166
       "\u06f0"-"\u06f9",
167
       "\u0966"-"\u096f",
168
       "\u09e6"-"\u09ef",
169
       "\u0a66"-"\u0a6f",
170
       "\u0ae6"-"\u0aef",
171
       "\u0b66"-"\u0b6f",
172
       "\u0be7"-"\u0bef",
173
       "\u0c66"-"\u0c6f",
174
       "\u0ce6"-"\u0cef",
175
       "\u0d66"-"\u0d6f",
176
       "\u0e50"-"\u0e59",
177
       "\u0ed0"-"\u0ed9",
178
       "\u1040"-"\u1049"
179
      ]
180
  >
181
}
182
183
void Declaration() :
184
{}
185
{
186
	LOOKAHEAD(2)
187
	(
188
		AnonymousUnnamed()
189
	)
190
	|
191
	(
192
		[ InstanceName() ]
193
		[ InstanceType() ]
194
	) <EOF>
195
}
196
197
void AnonymousUnnamed() :
198
{}
199
{
200
	<COLON> { mySubject.setName(null); mySubject.getClassifiers().clear(); }
201
}
202
203
void InstanceName() :
204
{
205
	String name;
206
}
207
{
208
	name = NameWithSpaces() 
209
	{
210
		mySubject.setName(name);
211
	}
212
}
213
214
void InstanceType() :
215
{
216
	String type;
217
}
218
{
219
	(
220
		<COLON> type = NameWithSpaces() { applyLookup(Type.class, type, new ClassifierLookupCallback(mySubject)); }
221
		(
222
			<COMMA> type = NameWithSpaces() { applyLookup(Type.class, type, new ClassifierLookupCallback(mySubject)); }
223
		)*
224
	)
225
}
226
227
String NameWithSpaces() :
228
{
229
	StringBuffer result = new StringBuffer();
230
	Token t;
231
}
232
{
233
	(
234
		t = <IDENTIFIER> { result.append(t.image); } 
235
		( t = <IDENTIFIER> { result.append(' '); result.append(t.image); } ) *
236
	)
237
	{
238
		return result.toString();
239
	}
240
}
(-)src/org/eclipse/uml2/diagram/clazz/navigator/UMLNavigatorLinkHelper.java (+84 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.navigator;
2
3
import org.eclipse.core.resources.IFile;
4
import org.eclipse.emf.ecore.EObject;
5
import org.eclipse.emf.ecore.resource.Resource;
6
import org.eclipse.gef.EditPart;
7
import org.eclipse.gmf.runtime.notation.View;
8
import org.eclipse.jface.viewers.IStructuredSelection;
9
import org.eclipse.jface.viewers.StructuredSelection;
10
import org.eclipse.ui.IEditorInput;
11
import org.eclipse.ui.IEditorPart;
12
import org.eclipse.ui.IWorkbenchPage;
13
import org.eclipse.ui.navigator.ILinkHelper;
14
import org.eclipse.ui.part.FileEditorInput;
15
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
16
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditor;
17
18
/**
19
 * @generated
20
 */
21
public class UMLNavigatorLinkHelper implements ILinkHelper {
22
23
	/**
24
	 * @generated
25
	 */
26
	public IStructuredSelection findSelection(IEditorInput anInput) {
27
		return StructuredSelection.EMPTY;
28
	}
29
30
	/**
31
	 * @generated
32
	 */
33
	public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
34
		if (aSelection == null || aSelection.isEmpty()) {
35
			return;
36
		}
37
		if (aSelection.getFirstElement() instanceof UMLAbstractNavigatorItem) {
38
			UMLAbstractNavigatorItem navigatorItem = (UMLAbstractNavigatorItem) aSelection.getFirstElement();
39
			if (!PackageEditPart.MODEL_ID.equals(navigatorItem.getModelID())) {
40
				return;
41
			}
42
			Object parentFile = navigatorItem.getParent();
43
			while (parentFile instanceof UMLAbstractNavigatorItem) {
44
				parentFile = ((UMLAbstractNavigatorItem) parentFile).getParent();
45
			}
46
			if (false == parentFile instanceof IFile) {
47
				return;
48
			}
49
			IEditorInput fileInput = new FileEditorInput((IFile) parentFile);
50
			IEditorPart editor = aPage.findEditor(fileInput);
51
			if (editor == null) {
52
				return;
53
			}
54
			aPage.bringToTop(editor);
55
			if (editor instanceof UMLDiagramEditor) {
56
				UMLDiagramEditor diagramEditor = (UMLDiagramEditor) editor;
57
				Resource diagramResource = diagramEditor.getDiagram().eResource();
58
59
				View navigatorView = null;
60
				if (navigatorItem instanceof UMLNavigatorItem) {
61
					navigatorView = ((UMLNavigatorItem) navigatorItem).getView();
62
				} else if (navigatorItem instanceof UMLNavigatorGroup) {
63
					UMLNavigatorGroup group = (UMLNavigatorGroup) navigatorItem;
64
					if (group.getParent() instanceof UMLNavigatorItem) {
65
						navigatorView = ((UMLNavigatorItem) group.getParent()).getView();
66
					}
67
				}
68
69
				if (navigatorView == null) {
70
					return;
71
				}
72
				EObject selectedView = diagramResource.getEObject(navigatorView.eResource().getURIFragment(navigatorView));
73
				if (selectedView == null) {
74
					return;
75
				}
76
				EditPart selectedEditPart = (EditPart) diagramEditor.getDiagramGraphicalViewer().getEditPartRegistry().get(selectedView);
77
				if (selectedEditPart != null) {
78
					diagramEditor.getDiagramGraphicalViewer().select(selectedEditPart);
79
				}
80
			}
81
		}
82
	}
83
84
}
(-)src/org/eclipse/uml2/diagram/clazz/edit/helpers/PortEditHelper.java (+7 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.edit.helpers;
2
3
/**
4
 * @generated
5
 */
6
public class PortEditHelper extends UMLBaseEditHelper {
7
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/Property5ViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class Property5ViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.Property5EditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)src/org/eclipse/uml2/diagram/clazz/view/factories/PrimitiveTypeViewFactory.java (+44 lines)
Added Link Here
1
package org.eclipse.uml2.diagram.clazz.view.factories;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
6
import org.eclipse.core.runtime.IAdaptable;
7
import org.eclipse.emf.ecore.EAnnotation;
8
import org.eclipse.emf.ecore.EcoreFactory;
9
import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
10
import org.eclipse.gmf.runtime.notation.View;
11
import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
12
import org.eclipse.uml2.diagram.clazz.part.UMLVisualIDRegistry;
13
14
/**
15
 * @generated
16
 */
17
public class PrimitiveTypeViewFactory extends AbstractLabelViewFactory {
18
19
	/**
20
	 * @generated 
21
	 */
22
	protected List createStyles(View view) {
23
		List styles = new ArrayList();
24
		return styles;
25
	}
26
27
	/**
28
	 * @generated
29
	 */
30
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
31
		if (semanticHint == null) {
32
			semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.clazz.edit.parts.PrimitiveTypeEditPart.VISUAL_ID);
33
			view.setType(semanticHint);
34
		}
35
		super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
36
		if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
37
			EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
38
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
39
			shortcutAnnotation.getDetails().put("modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$
40
			view.getEAnnotations().add(shortcutAnnotation);
41
		}
42
	}
43
44
}
(-)custom-src/org/eclipse/uml2/diagram/clazz/parser/operation/OperationParserTokenManager.java (+726 lines)
Added Link Here
1
/* Generated By:JavaCC: Do not edit this line. OperationParserTokenManager.java */
2
/*
3
 * Copyright (c) 2006 Borland Software Corporation
4
 * 
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *    Michael Golubev (Borland) - initial API and implementation
12
 */
13
package org.eclipse.uml2.diagram.clazz.parser.operation;
14
import java.io.*;
15
import org.eclipse.emf.ecore.EClass;
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.uml2.diagram.parser.*;
18
import org.eclipse.uml2.diagram.parser.lookup.LookupSuite;
19
import org.eclipse.uml2.uml.*;
20
21
public class OperationParserTokenManager implements OperationParserConstants
22
{
23
  public  java.io.PrintStream debugStream = System.out;
24
  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
25
private final int jjStopStringLiteralDfa_0(int pos, long active0)
26
{
27
   switch (pos)
28
   {
29
      case 0:
30
         if ((active0 & 0xff80000L) != 0L)
31
         {
32
            jjmatchedKind = 29;
33
            return 2;
34
         }
35
         return -1;
36
      case 1:
37
         if ((active0 & 0xa000000L) != 0L)
38
            return 2;
39
         if ((active0 & 0x5f80000L) != 0L)
40
         {
41
            if (jjmatchedPos != 1)
42
            {
43
               jjmatchedKind = 29;
44
               jjmatchedPos = 1;
45
            }
46
            return 2;
47
         }
48
         return -1;
49
      case 2:
50
         if ((active0 & 0x4000000L) != 0L)
51
            return 2;
52
         if ((active0 & 0x9f80000L) != 0L)
53
         {
54
            jjmatchedKind = 29;
55
            jjmatchedPos = 2;
56
            return 2;
57
         }
58
         return -1;
59
      case 3:
60
         if ((active0 & 0x9f80000L) != 0L)
61
         {
62
            jjmatchedKind = 29;
63
            jjmatchedPos = 3;
64
            return 2;
65
         }
66
         return -1;
67
      case 4:
68
         if ((active0 & 0x9000000L) != 0L)
69
            return 2;
70
         if ((active0 & 0xf80000L) != 0L)
71
         {
72
            jjmatchedKind = 29;
73
            jjmatchedPos = 4;
74
            return 2;
75
         }
76
         return -1;
77
      case 5:
78
         if ((active0 & 0x400000L) != 0L)
79
            return 2;
80
         if ((active0 & 0xb80000L) != 0L)
81
         {
82
            jjmatchedKind = 29;
83
            jjmatchedPos = 5;
84
            return 2;
85
         }
86
         return -1;
87
      case 6:
88
         if ((active0 & 0x100000L) != 0L)
89
            return 2;
90
         if ((active0 & 0xa80000L) != 0L)
91
         {
92
            jjmatchedKind = 29;
93
            jjmatchedPos = 6;
94
            return 2;
95
         }
96
         return -1;
97
      case 7:
98
         if ((active0 & 0xa80000L) != 0L)
99
         {
100
            jjmatchedKind = 29;
101
            jjmatchedPos = 7;
102
            return 2;
103
         }
104
         return -1;
105
      default :
106
         return -1;
107
   }
108
}
109
private final int jjStartNfa_0(int pos, long active0)
110
{
111
   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
112
}
113
private final int jjStopAtPos(int pos, int kind)
114
{
115
   jjmatchedKind = kind;
116
   jjmatchedPos = pos;
117
   return pos + 1;
118
}
119
private final int jjStartNfaWithStates_0(int pos, int kind, int state)
120
{
121
   jjmatchedKind = kind;
122
   jjmatchedPos = pos;
123
   try { curChar = input_stream.readChar(); }
124
   catch(java.io.IOException e) { return pos + 1; }
125
   return jjMoveNfa_0(state, pos + 1);
126
}
127
private final int jjMoveStringLiteralDfa0_0()
128
{
129
   switch(curChar)
130
   {
131
      case 9:
132
         return jjStopAtPos(0, 2);
133
      case 32:
134
         return jjStopAtPos(0, 1);
135
      case 35:
136
         return jjStopAtPos(0, 15);
137
      case 40:
138
         return jjStopAtPos(0, 10);
139
      case 41:
140
         return jjStopAtPos(0, 11);
141
      case 42:
142
         return jjStopAtPos(0, 18);
143
      case 43:
144
         return jjStopAtPos(0, 13);
145
      case 44:
146
         return jjStopAtPos(0, 12);
147
      case 45:
148
         return jjStopAtPos(0, 14);
149
      case 46:
150
         return jjStopAtPos(0, 17);
151
      case 47:
152
         return jjStopAtPos(0, 3);
153
      case 58:
154
         return jjStopAtPos(0, 4);
155
      case 61:
156
         return jjStopAtPos(0, 5);
157
      case 91:
158
         return jjStopAtPos(0, 6);
159
      case 93:
160
         return jjStopAtPos(0, 7);
161
      case 105:
162
         return jjMoveStringLiteralDfa1_0(0xa000000L);
163
      case 110:
164
         return jjMoveStringLiteralDfa1_0(0x800000L);
165
      case 111:
166
         return jjMoveStringLiteralDfa1_0(0x4100000L);
167
      case 113:
168
         return jjMoveStringLiteralDfa1_0(0x1000000L);
169
      case 114:
170
         return jjMoveStringLiteralDfa1_0(0x80000L);
171
      case 117:
172
         return jjMoveStringLiteralDfa1_0(0x600000L);
173
      case 123:
174
         return jjStopAtPos(0, 8);
175
      case 125:
176
         return jjStopAtPos(0, 9);
177
      case 126:
178
         return jjStopAtPos(0, 16);
179
      default :
180
         return jjMoveNfa_0(1, 0);
181
   }
182
}
183
private final int jjMoveStringLiteralDfa1_0(long active0)
184
{
185
   try { curChar = input_stream.readChar(); }
186
   catch(java.io.IOException e) {
187
      jjStopStringLiteralDfa_0(0, active0);
188
      return 1;
189
   }
190
   switch(curChar)
191
   {
192
      case 101:
193
         return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
194
      case 110:
195
         if ((active0 & 0x2000000L) != 0L)
196
         {
197
            jjmatchedKind = 25;
198
            jjmatchedPos = 1;
199
         }
200
         return jjMoveStringLiteralDfa2_0(active0, 0x8600000L);
201
      case 111:
202
         return jjMoveStringLiteralDfa2_0(active0, 0x800000L);
203
      case 114:
204
         return jjMoveStringLiteralDfa2_0(active0, 0x100000L);
205
      case 117:
206
         return jjMoveStringLiteralDfa2_0(active0, 0x5000000L);
207
      default :
208
         break;
209
   }
210
   return jjStartNfa_0(0, active0);
211
}
212
private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
213
{
214
   if (((active0 &= old0)) == 0L)
215
      return jjStartNfa_0(0, old0); 
216
   try { curChar = input_stream.readChar(); }
217
   catch(java.io.IOException e) {
218
      jjStopStringLiteralDfa_0(1, active0);
219
      return 2;
220
   }
221
   switch(curChar)
222
   {
223
      case 100:
224
         return jjMoveStringLiteralDfa3_0(active0, 0x180000L);
225
      case 101:
226
         return jjMoveStringLiteralDfa3_0(active0, 0x1000000L);
227
      case 105:
228
         return jjMoveStringLiteralDfa3_0(active0, 0x400000L);
229
      case 110:
230
         return jjMoveStringLiteralDfa3_0(active0, 0x800000L);
231
      case 111:
232
         return jjMoveStringLiteralDfa3_0(active0, 0x8200000L);
233
      case 116:
234
         if ((active0 & 0x4000000L) != 0L)
235
            return jjStartNfaWithStates_0(2, 26, 2);
236
         break;
237
      default :
238
         break;
239
   }
240
   return jjStartNfa_0(1, active0);
241
}
242
private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
243
{
244
   if (((active0 &= old0)) == 0L)
245
      return jjStartNfa_0(1, old0); 
246
   try { curChar = input_stream.readChar(); }
247
   catch(java.io.IOException e) {
248
      jjStopStringLiteralDfa_0(2, active0);
249
      return 3;
250
   }
251
   switch(curChar)
252
   {
253
      case 101:
254
         return jjMoveStringLiteralDfa4_0(active0, 0x180000L);
255
      case 113:
256
         return jjMoveStringLiteralDfa4_0(active0, 0x400000L);
257
      case 114:
258
         return jjMoveStringLiteralDfa4_0(active0, 0x1200000L);
259
      case 117:
260
         return jjMoveStringLiteralDfa4_0(active0, 0x8800000L);
261
      default :
262
         break;
263
   }
264
   return jjStartNfa_0(2, active0);
265
}
266
private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
267
{
268
   if (((active0 &= old0)) == 0L)
269
      return jjStartNfa_0(2, old0); 
270
   try { curChar = input_stream.readChar(); }
271
   catch(java.io.IOException e) {
272
      jjStopStringLiteralDfa_0(3, active0);
273
      return 4;
274
   }
275
   switch(curChar)
276
   {
277
      case 100:
278
         return jjMoveStringLiteralDfa5_0(active0, 0x200000L);
279
      case 102:
280
         return jjMoveStringLiteralDfa5_0(active0, 0x80000L);
281
      case 110:
282
         return jjMoveStringLiteralDfa5_0(active0, 0x800000L);
283
      case 114:
284
         return jjMoveStringLiteralDfa5_0(active0, 0x100000L);
285
      case 116:
286
         if ((active0 & 0x8000000L) != 0L)
287
            return jjStartNfaWithStates_0(4, 27, 2);
288
         break;
289
      case 117:
290
         return jjMoveStringLiteralDfa5_0(active0, 0x400000L);
291
      case 121:
292
         if ((active0 & 0x1000000L) != 0L)
293
            return jjStartNfaWithStates_0(4, 24, 2);
294
         break;
295
      default :
296
         break;
297
   }
298
   return jjStartNfa_0(3, active0);
299
}
300
private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
301
{
302
   if (((active0 &= old0)) == 0L)
303
      return jjStartNfa_0(3, old0); 
304
   try { curChar = input_stream.readChar(); }
305
   catch(java.io.IOException e) {
306
      jjStopStringLiteralDfa_0(4, active0);
307
      return 5;
308
   }
309
   switch(curChar)
310
   {
311
      case 101:
312
         if ((active0 & 0x400000L) != 0L)
313
            return jjStartNfaWithStates_0(5, 22, 2);
314
         return jjMoveStringLiteralDfa6_0(active0, 0x300000L);
315
      case 105:
316
         return jjMoveStringLiteralDfa6_0(active0, 0x880000L);
317
      default :
318
         break;
319
   }
320
   return jjStartNfa_0(4, active0);
321
}
322
private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
323
{
324
   if (((active0 &= old0)) == 0L)
325
      return jjStartNfa_0(4, old0); 
326
   try { curChar = input_stream.readChar(); }
327
   catch(java.io.IOException e) {
328
      jjStopStringLiteralDfa_0(5, active0);
329
      return 6;
330
   }
331
   switch(curChar)
332
   {
333
      case 100:
334
         if ((active0 & 0x100000L) != 0L)
335
            return jjStartNfaWithStates_0(6, 20, 2);
336
         break;
337
      case 110:
338
         return jjMoveStringLiteralDfa7_0(active0, 0x80000L);
339
      case 113:
340
         return jjMoveStringLiteralDfa7_0(active0, 0x800000L);
341
      case 114:
342
         return jjMoveStringLiteralDfa7_0(active0, 0x200000L);
343
      default :
344
         break;
345
   }
346
   return jjStartNfa_0(5, active0);
347
}
348
private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
349
{
350
   if (((active0 &= old0)) == 0L)
351
      return jjStartNfa_0(5, old0); 
352
   try { curChar = input_stream.readChar(); }
353
   catch(java.io.IOException e) {
354
      jjStopStringLiteralDfa_0(6, active0);
355
      return 7;
356
   }
357
   switch(curChar)
358
   {
359
      case 101:
360
         return jjMoveStringLiteralDfa8_0(active0, 0x280000L);
361
      case 117:
362
         return jjMoveStringLiteralDfa8_0(active0, 0x800000L);
363
      default :
364
         break;
365
   }
366
   return jjStartNfa_0(6, active0);
367
}
368
private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
369
{
370
   if (((active0 &= old0)) == 0L)
371
      return jjStartNfa_0(6, old0); 
372
   try { curChar = input_stream.readChar(); }
373
   catch(java.io.IOException e) {
374
      jjStopStringLiteralDfa_0(7, active0);
375
      return 8;
376
   }
377
   switch(curChar)
378
   {
379
      case 100:
380
         if ((active0 & 0x200000L) != 0L)
381
            return jjStartNfaWithStates_0(8, 21, 2);
382
         break;
383
      case 101:
384
         if ((active0 & 0x800000L) != 0L)
385
            return jjStartNfaWithStates_0(8, 23, 2);
386
         break;
387
      case 115:
388
         if ((active0 & 0x80000L) != 0L)
389
            return jjStartNfaWithStates_0(8, 19, 2);
390
         break;
391
      default :
392
         break;
393
   }
394
   return jjStartNfa_0(7, active0);
395
}
396
private final void jjCheckNAdd(int state)
397
{
398
   if (jjrounds[state] != jjround)
399
   {
400
      jjstateSet[jjnewStateCnt++] = state;
401
      jjrounds[state] = jjround;
402
   }
403
}
404
private final void jjAddStates(int start, int end)
405
{
406
   do {
407
      jjstateSet[jjnewStateCnt++] = jjnextStates[start];
408
   } while (start++ != end);
409
}
410
private final void jjCheckNAddTwoStates(int state1, int state2)
411
{
412
   jjCheckNAdd(state1);
413
   jjCheckNAdd(state2);
414
}
415
private final void jjCheckNAddStates(int start, int end)
416
{
417
   do {
418
      jjCheckNAdd(jjnextStates[start]);
419
   } while (start++ != end);
420
}
421
private final void jjCheckNAddStates(int start)
422
{
423
   jjCheckNAdd(jjnextStates[start]);
424
   jjCheckNAdd(jjnextStates[start + 1]);
425
}
426
static final long[] jjbitVec0 = {
427
   0x1ff00000fffffffeL, 0xffffffffffffc000L, 0xffffffffL, 0x600000000000000L
428
};
429
static final long[] jjbitVec2 = {
430
   0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
431
};
432
static final long[] jjbitVec3 = {
433
   0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
434
};
435
static final long[] jjbitVec4 = {
436
   0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
437
};
438
static final long[] jjbitVec5 = {
439
   0xffffffffffffffffL, 0xffffffffffffffffL, 0x0L, 0x0L
440
};
441
static final long[] jjbitVec6 = {
442
   0x3fffffffffffL, 0x0L, 0x0L, 0x0L
443
};
444
private final int jjMoveNfa_0(int startState, int curPos)
445
{
446
   int[] nextStates;
447
   int startsAt = 0;
448
   jjnewStateCnt = 3;
449
   int i = 1;
450
   jjstateSet[0] = startState;
451
   int j, kind = 0x7fffffff;
452
   for (;;)
453
   {
454
      if (++jjround == 0x7fffffff)
455
         ReInitRounds();
456
      if (curChar < 64)
457
      {
458
         long l = 1L << curChar;
459
         MatchLoop: do
460
         {
461
            switch(jjstateSet[--i])
462
            {
463
               case 1:
464
                  if ((0x3ff000000000000L & l) != 0L)
465
                  {
466
                     if (kind > 28)
467
                        kind = 28;
468
                     jjCheckNAdd(0);
469
                  }
470
                  else if (curChar == 36)
471
                  {
472
                     if (kind > 29)
473
                        kind = 29;
474
                     jjCheckNAdd(2);
475
                  }
476
                  break;
477
               case 0:
478
                  if ((0x3ff000000000000L & l) == 0L)
479
                     break;
480
                  if (kind > 28)
481
                     kind = 28;
482
                  jjCheckNAdd(0);
483
                  break;
484
               case 2:
485
                  if ((0x3ff001000000000L & l) == 0L)
486
                     break;
487
                  if (kind > 29)
488
                     kind = 29;
489
                  jjCheckNAdd(2);
490
                  break;
491
               default : break;
492
            }
493
         } while(i != startsAt);
494
      }
495
      else if (curChar < 128)
496
      {
497
         long l = 1L << (curChar & 077);
498
         MatchLoop: do
499
         {
500
            switch(jjstateSet[--i])
501
            {
502
               case 1:
503
               case 2:
504
                  if ((0x7fffffe87fffffeL & l) == 0L)
505
                     break;
506
                  if (kind > 29)
507
                     kind = 29;
508
                  jjCheckNAdd(2);
509
                  break;
510
               default : break;
511
            }
512
         } while(i != startsAt);
513
      }
514
      else
515
      {
516
         int hiByte = (int)(curChar >> 8);
517
         int i1 = hiByte >> 6;
518
         long l1 = 1L << (hiByte & 077);
519
         int i2 = (curChar & 0xff) >> 6;
520
         long l2 = 1L << (curChar & 077);
521
         MatchLoop: do
522
         {
523
            switch(jjstateSet[--i])
524
            {
525
               case 1:
526
               case 2:
527
                  if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
528
                     break;
529
                  if (kind > 29)
530
                     kind = 29;
531
                  jjCheckNAdd(2);
532
                  break;
533
               default : break;
534
            }
535
         } while(i != startsAt);
536
      }
537
      if (kind != 0x7fffffff)
538
      {
539
         jjmatchedKind = kind;
540
         jjmatchedPos = curPos;
541
         kind = 0x7fffffff;
542
      }
543
      ++curPos;
544
      if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
545
         return curPos;
546
      try { curChar = input_stream.readChar(); }
547
      catch(java.io.IOException e) { return curPos; }
548
   }
549
}
550
static final int[] jjnextStates = {
551
};
552
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
553
{
554
   switch(hiByte)
555
   {
556
      case 0:
557
         return ((jjbitVec2[i2] & l2) != 0L);
558
      case 48:
559
         return ((jjbitVec3[i2] & l2) != 0L);
560
      case 49:
561
         return ((jjbitVec4[i2] & l2) != 0L);
562
      case 51:
563
         return ((jjbitVec5[i2] & l2) != 0L);
564
      case 61:
565
         return ((jjbitVec6[i2] & l2) != 0L);
566
      default : 
567
         if ((jjbitVec0[i1] & l1) != 0L)
568
            return true;
569
         return false;
570
   }
571
}
572
public static final String[] jjstrLiteralImages = {
573
"", null, null, "\57", "\72", "\75", "\133", "\135", "\173", "\175", "\50", 
574
"\51", "\54", "\53", "\55", "\43", "\176", "\56", "\52", 
575
"\162\145\144\145\146\151\156\145\163", "\157\162\144\145\162\145\144", "\165\156\157\162\144\145\162\145\144", 
576
"\165\156\151\161\165\145", "\156\157\156\165\156\151\161\165\145", "\161\165\145\162\171", "\151\156", 
577
"\157\165\164", "\151\156\157\165\164", null, null, null, null, };
578
public static final String[] lexStateNames = {
579
   "DEFAULT", 
580
};
581
static final long[] jjtoToken = {
582
   0x3ffffff9L, 
583
};
584
static final long[] jjtoSkip = {
585
   0x6L, 
586
};
587
static final long[] jjtoSpecial = {
588
   0x6L, 
589
};
590
protected JavaCharStream input_stream;
591
private final int[] jjrounds = new int[3];
592
private final int[] jjstateSet = new int[6];
593
protected char curChar;
594
public OperationParserTokenManager(JavaCharStream stream)
595
{
596
   if (JavaCharStream.staticFlag)
597
      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
598
   input_stream = stream;
599
}
600
public OperationParserTokenManager(JavaCharStream stream, int lexState)
601
{
602
   this(stream);
603
   SwitchTo(lexState);
604
}
605
public void ReInit(JavaCharStream stream)
606
{
607
   jjmatchedPos = jjnewStateCnt = 0;
608
   curLexState = defaultLexState;
609
   input_stream = stream;
610
   ReInitRounds();
611
}
612
private final void ReInitRounds()
613
{
614
   int i;
615
   jjround = 0x80000001;
616
   for (i = 3; i-- > 0;)
617
      jjrounds[i] = 0x80000000;
618
}
619
public void ReInit(JavaCharStream stream, int lexState)
620
{
621
   ReInit(stream);
622
   SwitchTo(lexState);
623
}
624
public void SwitchTo(int lexState)
625
{
626
   if (lexState >= 1 || lexState < 0)
627
      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
628
   else
629
      curLexState = lexState;
630
}
631
632
protected Token jjFillToken()
633
{
634
   Token t = Token.newToken(jjmatchedKind);
635
   t.kind = jjmatchedKind;
636
   String im = jjstrLiteralImages[jjmatchedKind];
637
   t.image = (im == null) ? input_stream.GetImage() : im;
638
   t.beginLine = input_stream.getBeginLine();
639
   t.beginColumn = input_stream.getBeginColumn();
640
   t.endLine = input_stream.getEndLine();
641
   t.endColumn = input_stream.getEndColumn();
642
   return t;
643
}
644
645
int curLexState = 0;
646
int defaultLexState = 0;
647
int jjnewStateCnt;
648
int jjround;
649
int jjmatchedPos;
650
int jjmatchedKind;
651
652
public Token getNextToken() 
653
{
654
  int kind;
655
  Token specialToken = null;
656
  Token matchedToken;
657
  int curPos = 0;
658
659
  EOFLoop :
660
  for (;;)
661
  {   
662
   try   
663
   {     
664
      curChar = input_stream.BeginToken();
665
   }     
666
   catch(java.io.IOException e)
667
   {        
668
      jjmatchedKind = 0;
669
      matchedToken = jjFillToken();
670
      matchedToken.specialToken = specialToken;
671
      return matchedToken;
672
   }
673
674
   jjmatchedKind = 0x7fffffff;
675
   jjmatchedPos = 0;
676
   curPos = jjMoveStringLiteralDfa0_0();
677
   if (jjmatchedKind != 0x7fffffff)
678
   {
679
      if (jjmatchedPos + 1 < curPos)
680
         input_stream.backup(curPos - jjmatchedPos - 1);
681
      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
682
      {
683
         matchedToken = jjFillToken();
684
         matchedToken.specialToken = specialToken;
685
         return matchedToken;
686
      }
687
      else
688
      {
689
         if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
690
         {
691
            matchedToken = jjFillToken();
692
            if (specialToken == null)
693
               specialToken = matchedToken;
694
            else
695
            {
696
               matchedToken.specialToken = specialToken;
697
               specialToken = (specialToken.next = matchedToken);
698
            }
699
         }
700
         continue EOFLoop;
701
      }
702
   }
703
   int error_line = input_stream.getEndLine();
704
   int error_column = input_stream.getEndColumn();
705
   String error_after = null;
706
   boolean EOFSeen = false;
707
   try { input_stream.readChar(); input_stream.backup(1); }
708
   catch (java.io.IOException e1) {
709
      EOFSeen = true;
710
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
711
      if (curChar == '\n' || curChar == '\r') {
712
         error_line++;
713
         error_column = 0;
714
      }
715
      else
716
         error_column++;
717
   }
718
   if (!EOFSeen) {
719
      input_stream.backup(1);
720
      error_after = curPos <= 1 ? "" : input_stream.GetImage();
721
   }
722
   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
723
  }
724
}
725
726
}

Return to bug 80318