Changeset 9395
- Timestamp:
- 07/25/07 11:08:55 (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
-
Jav_GE/com/scenari/m/ge/donnee/ScopeSaxHandler.java (added)
-
Jav_GE/com/scenari/m/ge/donnee/WDonneeNavOutline.java (modified) (9 diffs)
-
Jav_GE/com/scenari/m/ge/donnee/WDonneeOutline.java (modified) (7 diffs)
-
Wsp_Modeling/es/content/uiWidget/navUiWidget/xml.xed.xml (modified) (1 diff)
-
Wsp_Modeling/es/content/uiWidget/outlineUiWidget/xml.xed.xml (modified) (2 diffs)
-
Wsp_Modeling/spaces/gen/modelBuilder/bs.doss/sm_navUiWidget.xml (modified) (1 diff)
-
Wsp_Modeling/spaces/gen/modelBuilder/bs.doss/sm_navUiWidget/navOutlineDef.xsl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jav_GE/com/scenari/m/ge/donnee/WDonneeNavOutline.java
r9394 r9395 58 58 import com.scenari.m.co.donnee.IHContextDonnee; 59 59 import com.scenari.m.co.donnee.WDonnee; 60 import com.scenari.m.co.donnee.XSaxHandlerDonnees;61 60 import com.scenari.m.ge.agent.OutlineWalker; 62 61 import com.scenari.s.co.source.IHAliasResolver; … … 95 94 * <pre> 96 95 * [navOutlineDef dialog="/@@/@xx"] 96 * [scope] 97 * Voir ScopeSaxHandler 98 * [/scope] 99 * [steps] 97 100 * [ancestor dir='up|down' offset='1|X'] 98 101 * [allowCompType code=''/] … … 125 128 * ... 126 129 * [/ifNone] 130 * [/steps] 127 131 * [/navOutlineDef] 128 132 * </pre> … … 277 281 } 278 282 279 public class XSaxHandler extends XSaxHandlerDonnees{283 public class XSaxHandler extends ScopeSaxHandler { 280 284 281 285 public static final String TAG_ROOT_DONNEE = "navOutlineDef"; 286 287 public static final String TAG_STEPS = "steps"; 288 public static final String TAG_SCOPE = "scope"; 282 289 283 290 public static final String ATT_DIALOG = "dialog"; … … 313 320 protected List fCompTypeList = null; 314 321 protected boolean fCompTypAllowed = true; 315 316 public XSaxHandler(IHComposantType pCompType) { 317 super(pCompType); 322 323 protected boolean fIsInScope = false; 324 325 public XSaxHandler(IHComposantType pCompType, OutlineWalker pWalker) { 326 super(pCompType, pWalker); 318 327 } 319 328 … … 334 343 } 335 344 // 345 else if (pLocalName == TAG_SCOPE) { 346 fIsInScope = false; 347 } 348 // 336 349 else if (pLocalName == TAG_ANCESTOR || pLocalName == TAG_CHILD || pLocalName == TAG_DESCENDANT || pLocalName == TAG_NEXT || pLocalName == TAG_SIBLING ) { 337 350 if(fCompTypeList != null && fCompTypeList.size()>0) { … … 345 358 346 359 protected boolean xStartElement(String pUri, String pLocalName, String pQName, Attributes pAttributes) throws Exception { 347 if (pLocalName == TAG_ANCESTOR) { 360 361 if(fIsInScope) { 362 super.xStartElement(pUri, pLocalName, pQName, pAttributes); 363 } 364 // 365 else if (pLocalName == TAG_SCOPE) { 366 fIsInScope = true; 367 } 368 369 // 370 else if (pLocalName == TAG_ANCESTOR) { 348 371 AncestorStep vStep = new AncestorStep(); 349 372 initStep(vStep, pAttributes); … … 466 489 public boolean wSetValueParSaxHandler(IHComposantType pCompType, HExtraitSaxHandler pParentHandler, IHContextDonnee pContextDonnee) throws java.lang.Exception { 467 490 // Preparation du Handler 468 XSaxHandler vHandler = new XSaxHandler(pCompType );491 XSaxHandler vHandler = new XSaxHandler(pCompType, fWalker); 469 492 vHandler.hSetTagRoot(XSaxHandler.TAG_ROOT_DONNEE); 470 493 vHandler.hSetXmlReader(pParentHandler.hGetXMLReader(), false); … … 487 510 488 511 // Preparation du Handler 489 XSaxHandler vHandler = new XSaxHandler(pCompType );512 XSaxHandler vHandler = new XSaxHandler(pCompType, fWalker); 490 513 vHandler.hSetTagRoot(XSaxHandler.TAG_ROOT_DONNEE); 491 514 vHandler.hSetXmlReader(vXmlReader); -
trunk/Jav_GE/com/scenari/m/ge/donnee/WDonneeOutline.java
r8356 r9395 56 56 import com.scenari.m.co.donnee.IAgentData; 57 57 import com.scenari.m.co.donnee.WDonnee; 58 import com.scenari.m.co.donnee.XSaxHandlerDonnees;59 58 import com.scenari.m.ge.agent.OutlineWalker; 60 59 import com.scenari.s.co.source.IHAliasResolver; … … 74 73 * [outlineDef] 75 74 * [scope] 76 * [startingPoint dir='up|down' offset='0|X|max' include='y|n'] 77 * [stopCompType code='' include='y|n'/] 78 * ... 79 * [/startingPoint] 80 * [endingPoint depth='0|X|noLimit' depthFrom='startingPoint|current'] 81 * [stopCompType code='' include='y|n'/] 82 * ... 83 * [/endingPoint] 84 * [uncleFrom dir='up|down|none' offset='0|X|max'] 85 * [stopCompType code='' include='y/n'/] 86 * ... 87 * [/uncleFrom] 88 * [uncleTo dir='up|down|none' offset='0|X|max'] 89 * [stopCompType code='' include='y/n'/] 90 * ... 91 * [/uncleTo] 92 * [uncleDesc depth='0|X|noLimit' depthFrom='startingPoint|current'] 93 * [stopCompType code='' include='y/n'/] 94 * ... 95 * [/uncleDesc] 96 * [currentDesc depth='0|X|noLimit' depthFrom='startingPoint|current'] 97 * [stopCompType code='' include='y/n'/] 98 * ... 99 * [/currentDesc] 75 * Voir ScopeSaxHandler 100 76 * [/scope] 101 77 * [result] … … 116 92 117 93 protected String fResult = RESULT_TREECONTENT; 118 119 public class XSaxHandler extends XSaxHandlerDonnees { 94 95 96 public class XSaxHandler extends ScopeSaxHandler { 120 97 121 98 public static final String TAG_ROOT_DONNEE = "outlineDef"; 122 99 123 public static final String TAG_STARTINGPOINT = "startingPoint"; 124 125 public static final String TAG_ENDINGPOINT = "endingPoint"; 126 127 public static final String TAG_UNCLEFROM = "uncleFrom"; 128 129 public static final String TAG_UNCLETO = "uncleTo"; 130 131 public static final String TAG_UNCLEDESC = "uncleDesc"; 132 133 public static final String TAG_CURRENTDESC = "currentDesc"; 134 135 public static final String TAG_STOPCOMPTYPE = "stopCompType"; 136 137 String fCurrentBlock = null; 138 139 public XSaxHandler(IHComposantType pCompType) { 140 super(pCompType); 100 public XSaxHandler(IHComposantType pCompType, OutlineWalker pWalker) { 101 super(pCompType, pWalker); 141 102 } 142 103 … … 146 107 147 108 protected boolean xStartElement(String pUri, String pLocalName, String pQName, Attributes pAttributes) throws Exception { 148 if (pLocalName == TAG_STARTINGPOINT) {149 fCurrentBlock = pLocalName;150 fWalker.setStartingPoint(getDir(pAttributes, OutlineWalker.DIR_UP_DOWN), getOffset(pAttributes, 0), getInclude(pAttributes, true));151 }152 109 153 else if (pLocalName == TAG_ENDINGPOINT) { 154 fCurrentBlock = pLocalName; 155 fWalker.setEndingPoint(getDepth(pAttributes, OutlineWalker.NO_LIMIT), getDepthFrom(pAttributes, OutlineWalker.FROM_STARTINGPOINT)); 156 } 157 158 else if (pLocalName == TAG_UNCLEFROM) { 159 fCurrentBlock = pLocalName; 160 fWalker.setUncleFrom(getDir(pAttributes, OutlineWalker.DIR_NONE), getOffset(pAttributes, 0)); 161 } 162 163 else if (pLocalName == TAG_UNCLETO) { 164 fCurrentBlock = pLocalName; 165 fWalker.setUncleTo(getDir(pAttributes, OutlineWalker.DIR_NONE), getOffset(pAttributes, 0)); 166 } 167 168 else if (pLocalName == TAG_UNCLEDESC) { 169 fCurrentBlock = pLocalName; 170 fWalker.setUncleDesc(getDepth(pAttributes, OutlineWalker.NO_LIMIT), getDepthFrom(pAttributes, OutlineWalker.FROM_STARTINGPOINT)); 171 } 172 173 else if (pLocalName == TAG_CURRENTDESC) { 174 fCurrentBlock = pLocalName; 175 fWalker.setCurrDesc(getDepth(pAttributes, OutlineWalker.NO_LIMIT), getDepthFrom(pAttributes, OutlineWalker.FROM_CURRENT)); 176 } 177 178 else if (pLocalName == TAG_STOPCOMPTYPE) { 179 if (fCurrentBlock == TAG_STARTINGPOINT) { 180 fWalker.addStartingPointStopOnCompType(pAttributes.getValue("code"), getInclude(pAttributes, true)); 181 } else if (fCurrentBlock == TAG_ENDINGPOINT) { 182 fWalker.addEndingPointStopOnCompType(pAttributes.getValue("code"), getInclude(pAttributes, true)); 183 }else if (fCurrentBlock == TAG_UNCLEFROM) { 184 fWalker.addUncleFromStopOnCompType(pAttributes.getValue("code"), getInclude(pAttributes, true)); 185 } else if (fCurrentBlock == TAG_UNCLETO) { 186 fWalker.addUncleToStopOnCompType(pAttributes.getValue("code"), getInclude(pAttributes, true)); 187 } else if (fCurrentBlock == TAG_UNCLEDESC) { 188 fWalker.addUncleDescStopOnCompType(pAttributes.getValue("code"), getInclude(pAttributes, true)); 189 } else if (fCurrentBlock == TAG_CURRENTDESC) { 190 fWalker.addCurrDescStopOnCompType(pAttributes.getValue("code"), getInclude(pAttributes, true)); 191 } 192 } 193 194 else if (pLocalName == RESULT_TREECONTENT) { 195 fResult = RESULT_TREECONTENT; 196 } 197 198 else if (pLocalName == RESULT_PROGRESSSTATUS) { 199 fResult = RESULT_PROGRESSSTATUS; 110 if( ! super.xStartElement(pUri, pLocalName, pQName, pAttributes)) { 111 if (pLocalName == RESULT_TREECONTENT) { 112 fResult = RESULT_TREECONTENT; 113 } 114 115 else if (pLocalName == RESULT_PROGRESSSTATUS) { 116 fResult = RESULT_PROGRESSSTATUS; 117 } 200 118 } 201 119 … … 203 121 } 204 122 205 protected short getDir(Attributes pAttributes, short pDefault) {206 String vDir = pAttributes.getValue("dir");207 if (vDir == null) return pDefault;208 if (vDir.equals("none")) return OutlineWalker.DIR_NONE;209 return vDir.equals("up") ? OutlineWalker.DIR_DOWN_UP : OutlineWalker.DIR_UP_DOWN;210 }211 212 protected int getOffset(Attributes pAttributes, int pDefault) {213 String vOffset = pAttributes.getValue("offset");214 if (vOffset == null) return pDefault;215 if (vOffset.equals("max")) return OutlineWalker.NO_LIMIT;216 return Integer.parseInt(vOffset);217 }218 219 protected int getDepth(Attributes pAttributes, int pDefault) {220 String vOffset = pAttributes.getValue("depth");221 if (vOffset == null) return pDefault;222 if (vOffset.equals("noLimit")) return OutlineWalker.NO_LIMIT;223 return Integer.parseInt(vOffset);224 }225 226 protected boolean getInclude(Attributes pAttributes, boolean pDefault) {227 String vInclude = pAttributes.getValue("include");228 if (vInclude == null) return pDefault;229 return vInclude.equals("y");230 }231 232 protected short getDepthFrom(Attributes pAttributes, short pDefault) {233 String vDir = pAttributes.getValue("depthFrom");234 if (vDir == null) return pDefault;235 return vDir.equals("current") ? OutlineWalker.FROM_CURRENT : OutlineWalker.FROM_STARTINGPOINT;236 }237 123 } 238 124 … … 297 183 public boolean wSetValueParSaxHandler(IHComposantType pCompType, HExtraitSaxHandler pParentHandler, IHContextDonnee pContextDonnee) throws java.lang.Exception { 298 184 // Preparation du Handler 299 XSaxHandler vHandler = new XSaxHandler(pCompType );185 XSaxHandler vHandler = new XSaxHandler(pCompType, fWalker); 300 186 vHandler.hSetTagRoot(XSaxHandler.TAG_ROOT_DONNEE); 301 187 vHandler.hSetXmlReader(pParentHandler.hGetXMLReader(), false); … … 318 204 319 205 // Preparation du Handler 320 XSaxHandler vHandler = new XSaxHandler(pCompType );206 XSaxHandler vHandler = new XSaxHandler(pCompType, fWalker); 321 207 vHandler.hSetTagRoot(XSaxHandler.TAG_ROOT_DONNEE); 322 208 vHandler.hSetXmlReader(vXmlReader); -
trunk/Wsp_Modeling/es/content/uiWidget/navUiWidget/xml.xed.xml
r9394 r9395 99 99 </xul:atts> 100 100 <xul:childs> 101 <se:ref se:refid="sm:scope" se:refurl="chrome://sm_modeling/content/uiWidget/outlineUiWidget/xml.xed.xml"/> 101 102 <xul:element se:id="sm:selectPage" se:name="sm:selectPage" se:bind="element"> 102 103 <xul:childs> -
trunk/Wsp_Modeling/es/content/uiWidget/outlineUiWidget/xml.xed.xml
r9332 r9395 176 176 </xul:atts> 177 177 <xul:childs> 178 <xul:element se: name="sm:scope" se:bind="element" tooltipTag="Paramétrage de l'envergure de la outline">178 <xul:element se:id="sm:scope" se:name="sm:scope" se:bind="element" tooltipTag="Paramétrage de l'envergure de la outline"> 179 179 <xul:childs> 180 180 <xul:alternativeAlone se:bind="choice"> 181 <se:ref se:name="sm:all" se:refid="sm:minimalist" helpSrc="chrome://sm_modeling/content/uiWidget/outlineUiWidget/hlp/hlpScopeAll.xul" tooltipTag="Entire outline"/> 181 182 <xul:element se:name="sm:minimalist" se:id="sm:minimalist" se:bind="element" helpSrc="chrome://sm_modeling/content/uiWidget/outlineUiWidget/hlp/hlpScopeMinimalist.xul" tooltipTag="Ancestors, siblings & direct children"> 182 183 <xul:atts> … … 186 187 </xul:atts> 187 188 </xul:element> 188 <se:ref se:name="sm:all" se:refid="sm:minimalist" helpSrc="chrome://sm_modeling/content/uiWidget/outlineUiWidget/hlp/hlpScopeAll.xul" tooltipTag="Entire outline"/>189 189 <xul:element se:name="sm:directChildren" helpSrc="chrome://sm_modeling/content/uiWidget/outlineUiWidget/hlp/hlpScopeDirectChildren.xul" se:bind="element"/> 190 190 <xul:element se:name="sm:stack" helpSrc="chrome://sm_modeling/content/uiWidget/outlineUiWidget/hlp/hlpScopeStack.xul" se:bind="element" tooltipTag="Ascendancy only"/> -
trunk/Wsp_Modeling/spaces/gen/modelBuilder/bs.doss/sm_navUiWidget.xml
r9394 r9395 80 80 </affichage> 81 81 <valeur code="navOutlineDef"> 82 <source type="xsl -statique" href="bs:navOutlineDef.xsl"/>82 <source type="xslOnSrc-dynamique" href="bs:navOutlineDef.xsl"/> 83 83 </valeur> 84 84 -
trunk/Wsp_Modeling/spaces/gen/modelBuilder/bs.doss/sm_navUiWidget/navOutlineDef.xsl
r9394 r9395 46 46 exclude-result-prefixes="sm sc" 47 47 version="1.0"> 48 49 <!-- <xsl:import href="bs:../sm_outlineUiWidget/outlineDef.xsl"/> --> 50 48 51 <xsl:output method="xml" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/> 49 52 50 <xsl:param name="vComp"/> 53 <xsl:param name="vDialog"/> 54 <xsl:param name="vAgent"/> 51 55 52 56 <xsl:template match="sm:navUiWidget"> 53 57 <navOutlineDef> 54 <xsl:apply-templates select="sm:selectPage/*"/> 58 <scope> 59 <xsl:apply-templates select="sm:scope/*"/> 60 </scope> 61 <steps> 62 <xsl:apply-templates select="sm:selectPage/*"/> 63 </steps> 55 64 </navOutlineDef> 56 65 </xsl:template> … … 111 120 <excludeCompType code="{getIdFromPath(@sc:refUri)}{getAxisSuffix(@axis)}"/> 112 121 </xsl:template> 122 123 <!-- ########## SCOPE ###########"" --> 124 <xsl:template match="sm:all"> 125 <startingPoint dir="down" offset="{si(not(@startAtLevel), '0', @startAtLevel)}" include="{si(not(@startAtLevel) or @startAtLevel='0', 'y', 'n')}"/> 126 <uncleFrom dir="down" offset="0"/> 127 <uncleTo dir="up" offset="0"/> 128 <uncleDesc depth="noLimit"/> 129 <currentDesc depth="noLimit"/> 130 </xsl:template> 131 132 <xsl:template match="sm:directChildren"> 133 <startingPoint dir="up" offset="0" include="n"/> 134 <currentDesc depth="1" depthFrom="current"/> 135 </xsl:template> 136 137 <xsl:template match="sm:minimalist"> 138 <startingPoint dir="down" offset="{si(not(@startAtLevel), '0', @startAtLevel)}" include="{si(not(@startAtLevel) or @startAtLevel='0', 'y', 'n')}"/> 139 <uncleFrom dir="down" offset="0"/> 140 <uncleTo dir="up" offset="0"/> 141 <currentDesc depth="1" depthFrom="current"/> 142 </xsl:template> 143 144 <xsl:template match="sm:stack"> 145 <startingPoint dir="down" offset="0"/> 146 </xsl:template> 147 148 <xsl:template match="sm:onlyOneLevel"> 149 <startingPoint dir="down" offset="{si(not(@level), '0', @level)}" include="n"/> 150 <endingPoint depth="1" depthFrom="startingPoint"/> 151 <uncleFrom dir="down" offset="0"/> 152 <uncleTo dir="down" offset="1"/> 153 <currentDesc depth="1" depthFrom="startingPoint"/> 154 </xsl:template> 155 156 <!-- customized scope --> 157 <xsl:template match="sm:customized"> 158 <xsl:apply-templates/> 159 </xsl:template> 160 <xsl:template match="sm:scopeStartingPoint"> 161 <xsl:apply-templates/> 162 </xsl:template> 163 <xsl:template match="sm:fromAbsoluteTop"> 164 <startingPoint dir="down" offset="{si(not(@descendantOffset), 'max', @descendantOffset)}" include="{si(@includeInScope='no', 'n', 'y')}"> 165 <xsl:apply-templates/> 166 </startingPoint> 167 </xsl:template> 168 <xsl:template match="sm:fromCurrent"> 169 <startingPoint dir="up" offset="{si(not(@ancestorOffset), 'max', @ancestorOffset)}" include="{si(@includeInScope='no', 'n', 'y')}"> 170 <xsl:apply-templates/> 171 </startingPoint> 172 </xsl:template> 173 174 <xsl:template match="sm:stopAtModel"> 175 <stopCompType code="{resultatAgent(concat('@', getIdFromPath(@sc:refUri), '/codeModel'))}{getAxisSuffix(@axis)}" include="{si(@includeInScope='no', 'n', 'y')}"/> 176 </xsl:template> 177 178 179 <xsl:template match="sm:ancestorEndingPoint"> 180 <endingPoint depth="{si(sm:depthLimit/@depth, sm:depthLimit/@depth, 'noLimit')}" depthFrom="{si(sm:depthLimit/@from='current', 'current', 'startingPoint')}"> 181 <xsl:apply-templates/> 182 </endingPoint> 183 </xsl:template> 184 185 <xsl:template match="sm:currentAndAncestorSiblings"> 186 <xsl:apply-templates/> 187 </xsl:template> 188 <xsl:template match="sm:siblingsStartingPoint"> 189 <uncleFrom dir="{si(@direction='currentToScopeStartingPoint', 'up', 'down')}" offset="{si(not(@offset), 'max', @offset)}"> 190 <xsl:apply-templates/> 191 </uncleFrom> 192 </xsl:template> 193 <xsl:template match="sm:siblingsEndingPoint"> 194 <uncleTo dir="{si(@direction='currentToScopeStartingPoint', 'up', 'down')}" offset="{si(not(@offset), 'max', @offset)}"> 195 <xsl:apply-templates/> 196 </uncleTo> 197 </xsl:template> 198 <xsl:template match="sm:siblingDescendants"> 199 <uncleDesc depth="{si(sm:depthLimit/@depth, sm:depthLimit/@depth, 'noLimit')}" depthFrom="{si(sm:depthLimit/@from='current', 'current', 'startingPoint')}"> 200 <xsl:apply-templates/> 201 </uncleDesc> 202 </xsl:template> 203 <xsl:template match="sm:currentDescendants"> 204 <currentDesc depth="{si(sm:depthLimit/@depth, sm:depthLimit/@depth, 'noLimit')}" depthFrom="{si(sm:depthLimit/@from='current', 'current', 'startingPoint')}"> 205 <xsl:apply-templates/> 206 </currentDesc> 207 </xsl:template> 208 <xsl:template match="sm:depthLimit"/> 209 210 113 211 <xsl:template match="*|text()|@*"/> 114 212 </xsl:stylesheet>
Note: See TracChangeset
for help on using the changeset viewer.