001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.console.config.v1;
009:
010: //base classes
011:
012: //project specific classes
013: import org.jfolder.common.UnexpectedSystemException;
014: import org.jfolder.common.tagging.AppraiseConceptTagContext;
015: import org.jfolder.common.tagging.CompoundConceptTagConstraintContext;
016: import org.jfolder.common.tagging.ConceptTag;
017: import org.jfolder.common.tagging.ConceptTagCharacteristic;
018: import org.jfolder.common.tagging.ConceptTagCharacteristicHolder;
019: import org.jfolder.common.tagging.ConceptTagConstraint;
020: import org.jfolder.common.tagging.ConceptTagConstraintHolder;
021: import org.jfolder.common.tagging.ConceptTagConstraintTemplate;
022: import org.jfolder.common.tagging.DynamicConceptTagConstraintContext;
023: import org.jfolder.common.tagging.InitializeConceptTagContext;
024: import org.jfolder.common.tagging.StaticConceptTagConstraintContext;
025: import org.jfolder.common.tagging.StudioConceptTagInstanceInfoContext;
026: import org.jfolder.common.tagging.StudioConceptTagTypeInfoContext;
027: import org.jfolder.common.utils.misc.MiscHelper;
028: import org.jfolder.console.config.ConsoleConfig;
029: import org.jfolder.console.config.ConsoleConfigTagPreferencesHelper;
030:
031: //other classes
032:
033: public class RootV1ConsoleConfigTag implements ConsoleConfig,
034: ConceptTag {
035:
036: //characteristics
037: //private ConceptTagCharacteristic conceptTagRegistryCtchar = null;
038: private ConceptTagCharacteristic sectionCtchar = null;
039: private ConceptTagCharacteristic propertyCtchar = null;
040:
041: //section details
042: private final static String SECTION_CTCON = "section";
043: private final static String SECTION_TITLE = "Section";
044: private final static String SECTION_SHORT_DESCRIPTION = "Section";
045:
046: //name details
047: private final static String SECTION_CTCON_NAME_CTCTEMP = "name";
048: private final static String SECTION_CTCON_NAME_TITLE = "Name";
049: private final static String SECTION_CTCON_NAME_SHORT_DESCRIPTION = "Name";
050: //
051: //pane details
052: private final static String SECTION_CTCON_PANE_CTCTEMP = "pane";
053: private final static String SECTION_CTCON_PANE_TITLE = "Pane";
054: private final static String SECTION_CTCON_PANE_SHORT_DESCRIPTION = "Pane";
055: //
056: private final static String SECTION_CTCON_PANE_CTCON_CONTEXT_CTCON = "context";
057: private final static String SECTION_CTCON_PANE_CTCON_CONTEXT_TITLE = "Context";
058: private final static String SECTION_CTCON_PANE_CTCON_CONTEXT_SHORT_DESCRIPTION = "Context";
059: //
060: private final static String SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON = "property";
061: private final static String SECTION_CTCON_PANE_CTCON_PROPERTY_TITLE = "Property";
062: private final static String SECTION_CTCON_PANE_CTCON_PROPERTY_SHORT_DESCRIPTION = "Property";
063: //
064: private final static String SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_NAME_CTCON = "name";
065: private final static String SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_NAME_TITLE = "Name";
066: private final static String SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_NAME_SHORT_DESCRIPTION = "Name";
067: //
068: private final static String SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_VALUE_CTCON = "value";
069: private final static String SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_VALUE_TITLE = "Value";
070: private final static String SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_VALUE_SHORT_DESCRIPTION = "Value";
071:
072: //property details
073: private final static String PROPERTY_CTCON = "property";
074: private final static String PROPERTY_TITLE = "Property";
075: private final static String PROPERTY_SHORT_DESCRIPTION = "Property";
076:
077: //name of property details
078: private final static String PROPERTY_CTCON_NAME_CTCTEMP = "name";
079: private final static String PROPERTY_CTCON_NAME_TITLE = "Name";
080: private final static String PROPERTY_CTCON_NAME_SHORT_DESCRIPTION = "Name";
081:
082: //value of property details
083: private final static String PROPERTY_CTCON_VALUE_CTCTEMP = "value";
084: private final static String PROPERTY_CTCON_VALUE_TITLE = "Value";
085: private final static String PROPERTY_CTCON_VALUE_SHORT_DESCRIPTION = "Value";
086:
087: ///////////////////////////////////
088:
089: public void initialize(InitializeConceptTagContext inIctc) {
090:
091: //
092: ConceptTagConstraintHolder rootCtconh = ConceptTagConstraintHolder
093: .newInstance(inIctc);
094:
095: //constrain "section"
096: ConceptTagConstraint sectionCtcon = ConceptTagConstraint
097: .newInstance(SECTION_CTCON, rootCtconh);
098: //
099: CompoundConceptTagConstraintContext sectionCctcc = CompoundConceptTagConstraintContext
100: .newInstance(sectionCtcon);
101: //
102: //constrain "name" of "section"
103: ConceptTagConstraintTemplate sectionCtconNameCtctemp = ConceptTagConstraintTemplate
104: .newInstance(SECTION_CTCON_NAME_CTCTEMP, sectionCctcc);
105: //
106: StaticConceptTagConstraintContext sectionCtconNameSctcc = StaticConceptTagConstraintContext
107: .newInstance(sectionCtconNameCtctemp);
108: //
109: //constrain "pane" of "section"
110: ConceptTagConstraintTemplate sectionCtconPaneCtctemp = ConceptTagConstraintTemplate
111: .newInstance(SECTION_CTCON_PANE_CTCTEMP, sectionCctcc);
112: //
113: CompoundConceptTagConstraintContext sectionCtconPaneCctcc = CompoundConceptTagConstraintContext
114: .newInstance(sectionCtconPaneCtctemp);
115: //
116: //constrain "context" of "pane" of "section"
117: ConceptTagConstraintTemplate sectionCtconPaneCtconContextCtctemp = ConceptTagConstraintTemplate
118: .newInstance(SECTION_CTCON_PANE_CTCON_CONTEXT_CTCON,
119: sectionCtconPaneCctcc);
120: //
121: StaticConceptTagConstraintContext sectionCtconPaneCtconSectionSctcc = StaticConceptTagConstraintContext
122: .newInstance(sectionCtconPaneCtconContextCtctemp);
123: //
124: //constrain "property" of "pane" of "section"
125: ConceptTagConstraintTemplate sectionCtconPaneCtconPropertyCtctemp = ConceptTagConstraintTemplate
126: .newInstance(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON,
127: sectionCtconPaneCctcc);
128: //
129: CompoundConceptTagConstraintContext sectionCtconPaneCtconPropertyCctcc = CompoundConceptTagConstraintContext
130: .newInstance(sectionCtconPaneCtconPropertyCtctemp);
131: //
132: //constrain "name" of "property" of "pane" of "section"
133: ConceptTagConstraintTemplate sectionCtconPaneCtconPropertyCtconNameCtctemp = ConceptTagConstraintTemplate
134: .newInstance(
135: SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_NAME_CTCON,
136: sectionCtconPaneCtconPropertyCctcc);
137: //
138: StaticConceptTagConstraintContext sectionCtconPaneCtconPropertyCtconNameSctcc = StaticConceptTagConstraintContext
139: .newInstance(sectionCtconPaneCtconPropertyCtconNameCtctemp);
140: //
141: //constrain "value" of "property" of "pane" of "section"
142: ConceptTagConstraintTemplate sectionCtconPaneCtconPropertyCtconValueCtctemp = ConceptTagConstraintTemplate
143: .newInstance(
144: SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_VALUE_CTCON,
145: sectionCtconPaneCtconPropertyCctcc);
146: //
147: StaticConceptTagConstraintContext sectionCtconPaneCtconPropertyCtconValueSctcc = StaticConceptTagConstraintContext
148: .newInstance(sectionCtconPaneCtconPropertyCtconValueCtctemp);
149:
150: ////constrain "pane"
151: //ConceptTagConstraint paneCtcon =
152: // ConceptTagConstraint.newInstance(PANE_CTCON, rootCtconh);
153: //paneCtcon.setTitle(PANE_TITLE);
154: //paneCtcon.setShortDescription(PANE_SHORT_DESCRIPTION);
155: ////
156: //DynamicConceptTagConstraintContext paneDctcc =
157: // DynamicConceptTagConstraintContext.newInstance(paneCtcon);
158: ////
159: //paneDctcc.addDefaultValue(UpDownConsoleConfigTag.class);
160:
161: //constrain "property"
162: ConceptTagConstraint propertyCtcon = ConceptTagConstraint
163: .newInstance(PROPERTY_CTCON, rootCtconh);
164: propertyCtcon.setTitle(PROPERTY_TITLE);
165: propertyCtcon.setShortDescription(PROPERTY_SHORT_DESCRIPTION);
166: //
167: CompoundConceptTagConstraintContext propertyCctcc = CompoundConceptTagConstraintContext
168: .newInstance(propertyCtcon);
169:
170: //constrain "name" of "property"
171: ConceptTagConstraintTemplate propertyCtconNameCtctemp = ConceptTagConstraintTemplate
172: .newInstance(PROPERTY_CTCON_NAME_CTCTEMP, propertyCctcc);
173: //
174: StaticConceptTagConstraintContext propertyCtconNameSctcc = StaticConceptTagConstraintContext
175: .newInstance(propertyCtconNameCtctemp);
176:
177: //constrain "value" of "property"
178: ConceptTagConstraintTemplate propertyCtconValueCtctemp = ConceptTagConstraintTemplate
179: .newInstance(PROPERTY_CTCON_VALUE_CTCTEMP,
180: propertyCctcc);
181: //
182: StaticConceptTagConstraintContext propertyCtconValueSctcc = StaticConceptTagConstraintContext
183: .newInstance(propertyCtconValueCtctemp);
184:
185: //
186: inIctc.initialize();
187:
188: //
189: //this.conceptTagRegistryCtchar =
190: // conceptTagRegistryCtcon.getCharacteristic();
191: this .sectionCtchar = sectionCtcon.getCharacteristic();
192: this .propertyCtchar = propertyCtcon.getCharacteristic();
193: MiscHelper
194: .println("RtV1ConConfTg AFTER INIT this.propertyCtchar = "
195: + this .propertyCtchar);
196:
197: }
198:
199: public void appraise(AppraiseConceptTagContext inCtic) {
200: if (inCtic instanceof StudioConceptTagInstanceInfoContext) {
201: StudioConceptTagInstanceInfoContext sctiic = (StudioConceptTagInstanceInfoContext) inCtic;
202: sctiic.setInstanceTitle("Console Config");
203: sctiic.setInstanceDescription("Console Config");
204: } else if (inCtic instanceof StudioConceptTagTypeInfoContext) {
205: StudioConceptTagTypeInfoContext scttic = (StudioConceptTagTypeInfoContext) inCtic;
206: scttic.setTypeTitle("Console Config");
207: scttic.setTypeDescription("Console Config");
208: }
209: }
210:
211: //
212: private final static int LEFT_SECTION = 0;
213: private final static int CENTER_SECTION = 1;
214: private final static int RIGHT_SECTION = 2;
215: //
216: private final static String LEFT_SECTION_NAME = "left";
217: private final static String CENTER_SECTION_NAME = "center";
218: private final static String RIGHT_SECTION_NAME = "right";
219:
220: //
221: private ConceptTagCharacteristicHolder getSection(int inIndex) {
222:
223: ConceptTagCharacteristicHolder outValue = null;
224:
225: if (inIndex < this .sectionCtchar.getValueLength()) {
226: outValue = this .sectionCtchar.getValueAsHolder(inIndex,
227: null);
228: } else {
229: if (inIndex > 0) {
230: getSection(inIndex - 1);
231: }
232: outValue = this .sectionCtchar.createRegisteredHolder(
233: inIndex, true);
234: //
235: ConceptTagCharacteristic nameCtchar = null;
236: if (outValue
237: .isCharacteristicPresent(SECTION_CTCON_NAME_CTCTEMP)) {
238: nameCtchar = outValue
239: .getCharacteristic(SECTION_CTCON_NAME_CTCTEMP);
240: } else {
241: nameCtchar = outValue
242: .registerCharacteristic(SECTION_CTCON_NAME_CTCTEMP);
243: }
244: //
245: if (nameCtchar.getValueLength() == 0) {
246: if (inIndex == LEFT_SECTION) {
247: nameCtchar.addValue(0, LEFT_SECTION_NAME);
248: } else if (inIndex == CENTER_SECTION) {
249: nameCtchar.addValue(0, CENTER_SECTION_NAME);
250: } else if (inIndex == RIGHT_SECTION) {
251: nameCtchar.addValue(0, RIGHT_SECTION_NAME);
252: } else {
253: throw UnexpectedSystemException.unknownState();
254: }
255: }
256: }
257:
258: return outValue;
259: }
260:
261: //
262: private ConceptTagCharacteristic getPaneCtchar(int inIndex) {
263:
264: ConceptTagCharacteristic outValue = null;
265:
266: ConceptTagCharacteristicHolder sectionCtcharh = getSection(inIndex);
267:
268: if (sectionCtcharh
269: .isCharacteristicPresent(SECTION_CTCON_PANE_CTCTEMP)) {
270: //
271: outValue = sectionCtcharh
272: .getCharacteristic(SECTION_CTCON_PANE_CTCTEMP);
273: } else {
274: outValue = sectionCtcharh
275: .registerCharacteristic(SECTION_CTCON_PANE_CTCTEMP);
276: }
277:
278: return outValue;
279: }
280:
281: private ConceptTagCharacteristicHolder getPaneHolder(int inIndex,
282: int inSubIndex) {
283:
284: ConceptTagCharacteristicHolder outValue = null;
285:
286: ConceptTagCharacteristic paneCtchar = getPaneCtchar(inIndex);
287: if (inSubIndex < paneCtchar.getValueLength()) {
288: outValue = paneCtchar.getValueAsHolder(inSubIndex, null);
289: } else {
290: throw new UnexpectedSystemException("Pane Holder at ("
291: + inIndex + ", " + inSubIndex + ") does not exist");
292: }
293:
294: return outValue;
295: }
296:
297: private ConceptTagCharacteristicHolder createPaneHolder(
298: int inIndex, int inSubIndex, String inContext) {
299: //
300: ConceptTagCharacteristicHolder outValue = null;
301:
302: ConceptTagCharacteristic paneCtchar = getPaneCtchar(inIndex);
303: outValue = paneCtchar.createRegisteredHolder(inSubIndex, true);
304:
305: ConceptTagCharacteristic contextCtchar = outValue
306: .registerCharacteristic(SECTION_CTCON_PANE_CTCON_CONTEXT_CTCON);
307: contextCtchar.addValue(0, inContext);
308:
309: return outValue;
310: }
311:
312: private ConceptTagCharacteristic getPanePropertyCtchar(int inIndex,
313: int inSubIndex) {
314: //
315: ConceptTagCharacteristic outValue = null;
316:
317: ConceptTagCharacteristicHolder paneCtcharh = getPaneHolder(
318: inIndex, inSubIndex);
319: //
320: if (paneCtcharh
321: .isCharacteristicPresent(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON)) {
322: //
323: outValue = paneCtcharh
324: .getCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON);
325: } else {
326: outValue = paneCtcharh
327: .registerCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON);
328: }
329:
330: return outValue;
331: }
332:
333: private ConceptTagCharacteristicHolder getPropertyHolder(int inIndex) {
334:
335: ConceptTagCharacteristicHolder outValue = null;
336:
337: outValue = this .propertyCtchar.getValueAsHolder(inIndex, null);
338:
339: return outValue;
340: }
341:
342: //////////
343: //
344: public int getLeftSectionPaneCount() {
345: return getPaneCtchar(LEFT_SECTION).getValueLength();
346: }
347:
348: public int getCenterSectionPaneCount() {
349: return getPaneCtchar(CENTER_SECTION).getValueLength();
350: }
351:
352: public int getRightSectionPaneCount() {
353: return getPaneCtchar(RIGHT_SECTION).getValueLength();
354: }
355:
356: //
357: public int getMainPropertyCount() {
358: return this .propertyCtchar.getValueLength();
359: }
360:
361: public String getMainPropertyName(int inIndex) {
362:
363: String outValue = null;
364:
365: ConceptTagCharacteristicHolder propCtcharh = getPropertyHolder(inIndex);
366: ConceptTagCharacteristic nameCtchar = propCtcharh
367: .getCharacteristic(PROPERTY_CTCON_NAME_CTCTEMP);
368:
369: outValue = nameCtchar.getValueAsString(0, null);
370:
371: return outValue;
372: }
373:
374: public String getMainPropertyValue(int inIndex) {
375:
376: String outValue = null;
377:
378: ConceptTagCharacteristicHolder propCtcharh = getPropertyHolder(inIndex);
379: ConceptTagCharacteristic valueCtchar = propCtcharh
380: .getCharacteristic(PROPERTY_CTCON_VALUE_CTCTEMP);
381:
382: outValue = valueCtchar.getValueAsString(0, null);
383:
384: return outValue;
385: }
386:
387: public void removeMainProperty(int inIndex) {
388: this .propertyCtchar.removeValueWithLocalFiles(inIndex);
389: }
390:
391: public void addMainProperty(int inIndex, String inName,
392: String inValue) {
393:
394: MiscHelper.println("RtV1ConConfTg this.propertyCtchar = "
395: + this .propertyCtchar);
396:
397: ConceptTagCharacteristicHolder propertyCtcharh = this .propertyCtchar
398: .createRegisteredHolder(inIndex, true);
399: //
400: ConceptTagCharacteristic nameCtchar = propertyCtcharh
401: .registerCharacteristic(PROPERTY_CTCON_NAME_CTCTEMP);
402: nameCtchar.addValue(0, inName);
403: //
404: ConceptTagCharacteristic valueCtchar = propertyCtcharh
405: .registerCharacteristic(PROPERTY_CTCON_VALUE_CTCTEMP);
406: valueCtchar.addValue(0, inValue);
407: }
408:
409: //
410: //
411: //
412: public String getLeftSectionPaneContext(int inIndex) {
413:
414: String outValue = null;
415:
416: ConceptTagCharacteristicHolder paneCtcharh = getPaneHolder(
417: LEFT_SECTION, inIndex);
418:
419: ConceptTagCharacteristic contextCtchar = paneCtcharh
420: .getCharacteristic(SECTION_CTCON_PANE_CTCON_CONTEXT_CTCON);
421:
422: outValue = contextCtchar.getValueAsString(0, null);
423:
424: return outValue;
425: }
426:
427: public void addLeftSectionPane(int inIndex, String inContext) {
428: createPaneHolder(LEFT_SECTION, inIndex, inContext);
429: }
430:
431: public void removeLeftSectionPane(int inIndex) {
432: getPaneCtchar(LEFT_SECTION).removeValueWithLocalFiles(inIndex);
433: }
434:
435: //
436: public int getLeftSectionPanePropertyCount(int inIndex) {
437: return getPanePropertyCtchar(LEFT_SECTION, inIndex)
438: .getValueLength();
439: }
440:
441: public String getLeftSectionPanePropertyName(int inIndex,
442: int inSubIndex) {
443:
444: String outValue = null;
445:
446: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
447: LEFT_SECTION, inIndex);
448: ConceptTagCharacteristicHolder propertyCtcharh = panePropertyCtchar
449: .getValueAsHolder(inSubIndex, null);
450: ConceptTagCharacteristic nameCtchar = propertyCtcharh
451: .getCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_NAME_CTCON);
452:
453: outValue = nameCtchar.getValueAsString(0, null);
454:
455: return outValue;
456: }
457:
458: public String getLeftSectionPanePropertyValue(int inIndex,
459: int inSubIndex) {
460:
461: String outValue = null;
462:
463: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
464: LEFT_SECTION, inIndex);
465: ConceptTagCharacteristicHolder propertyCtcharh = panePropertyCtchar
466: .getValueAsHolder(inSubIndex, null);
467: ConceptTagCharacteristic valueCtchar = propertyCtcharh
468: .getCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_VALUE_CTCON);
469:
470: outValue = valueCtchar.getValueAsString(0, null);
471:
472: return outValue;
473: }
474:
475: public void removeLeftSectionPaneProperty(int inIndex,
476: int inSubIndex) {
477: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
478: LEFT_SECTION, inIndex);
479: panePropertyCtchar.removeValueWithLocalFiles(inSubIndex);
480: }
481:
482: public void addLeftSectionPaneProperty(int inIndex, int inSubIndex,
483: String inName, String inValue) {
484: //
485: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
486: LEFT_SECTION, inIndex);
487: ConceptTagCharacteristicHolder propertyCtcharh = panePropertyCtchar
488: .createRegisteredHolder(inSubIndex, true);
489: //
490: ConceptTagCharacteristic nameCtchar = propertyCtcharh
491: .registerCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_NAME_CTCON);
492: nameCtchar.addValue(0, inName);
493: //
494: ConceptTagCharacteristic valueCtchar = propertyCtcharh
495: .registerCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_VALUE_CTCON);
496: valueCtchar.addValue(0, inValue);
497: }
498:
499: //
500: //
501: //
502: public String getCenterSectionPaneContext(int inIndex) {
503:
504: String outValue = null;
505:
506: ConceptTagCharacteristicHolder paneCtcharh = getPaneHolder(
507: CENTER_SECTION, inIndex);
508:
509: ConceptTagCharacteristic contextCtchar = paneCtcharh
510: .getCharacteristic(SECTION_CTCON_PANE_CTCON_CONTEXT_CTCON);
511:
512: outValue = contextCtchar.getValueAsString(0, null);
513:
514: return outValue;
515: }
516:
517: public void addCenterSectionPane(int inIndex, String inContext) {
518: createPaneHolder(CENTER_SECTION, inIndex, inContext);
519: }
520:
521: public void removeCenterSectionPane(int inIndex) {
522: getPaneCtchar(CENTER_SECTION)
523: .removeValueWithLocalFiles(inIndex);
524: }
525:
526: //
527: public int getCenterSectionPanePropertyCount(int inIndex) {
528: return getPanePropertyCtchar(CENTER_SECTION, inIndex)
529: .getValueLength();
530: }
531:
532: public String getCenterSectionPanePropertyName(int inIndex,
533: int inSubIndex) {
534: //
535:
536: String outValue = null;
537:
538: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
539: CENTER_SECTION, inIndex);
540: ConceptTagCharacteristicHolder propertyCtcharh = panePropertyCtchar
541: .getValueAsHolder(inSubIndex, null);
542: ConceptTagCharacteristic nameCtchar = propertyCtcharh
543: .getCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_NAME_CTCON);
544:
545: outValue = nameCtchar.getValueAsString(0, null);
546:
547: return outValue;
548: }
549:
550: public String getCenterSectionPanePropertyValue(int inIndex,
551: int inSubIndex) {
552: //
553:
554: String outValue = null;
555:
556: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
557: CENTER_SECTION, inIndex);
558: ConceptTagCharacteristicHolder propertyCtcharh = panePropertyCtchar
559: .getValueAsHolder(inSubIndex, null);
560: ConceptTagCharacteristic valueCtchar = propertyCtcharh
561: .getCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_VALUE_CTCON);
562:
563: outValue = valueCtchar.getValueAsString(0, null);
564:
565: return outValue;
566: }
567:
568: public void removeCenterSectionPaneProperty(int inIndex,
569: int inSubIndex) {
570: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
571: CENTER_SECTION, inIndex);
572: panePropertyCtchar.removeValueWithLocalFiles(inSubIndex);
573: }
574:
575: public void addCenterSectionPaneProperty(int inIndex,
576: int inSubIndex, String inName, String inValue) {
577: //
578: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
579: CENTER_SECTION, inIndex);
580: ConceptTagCharacteristicHolder propertyCtcharh = panePropertyCtchar
581: .createRegisteredHolder(inSubIndex, true);
582: //
583: ConceptTagCharacteristic nameCtchar = propertyCtcharh
584: .registerCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_NAME_CTCON);
585: nameCtchar.addValue(0, inName);
586: //
587: ConceptTagCharacteristic valueCtchar = propertyCtcharh
588: .registerCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_VALUE_CTCON);
589: valueCtchar.addValue(0, inValue);
590: }
591:
592: //
593: //
594: //
595: public String getRightSectionPaneContext(int inIndex) {
596:
597: String outValue = null;
598:
599: ConceptTagCharacteristicHolder paneCtcharh = getPaneHolder(
600: RIGHT_SECTION, inIndex);
601:
602: ConceptTagCharacteristic contextCtchar = paneCtcharh
603: .getCharacteristic(SECTION_CTCON_PANE_CTCON_CONTEXT_CTCON);
604:
605: outValue = contextCtchar.getValueAsString(0, null);
606:
607: return outValue;
608: }
609:
610: public void addRightSectionPane(int inIndex, String inContext) {
611: createPaneHolder(RIGHT_SECTION, inIndex, inContext);
612: }
613:
614: public void removeRightSectionPane(int inIndex) {
615: MiscHelper.println("RtV1ConConfTag inIndex = " + inIndex);
616: MiscHelper.println("RtV1ConConfTag size = "
617: + getPaneCtchar(RIGHT_SECTION).getValueLength());
618: getPaneCtchar(RIGHT_SECTION).removeValueWithLocalFiles(inIndex);
619: }
620:
621: //
622: public int getRightSectionPanePropertyCount(int inIndex) {
623: return getPanePropertyCtchar(RIGHT_SECTION, inIndex)
624: .getValueLength();
625: }
626:
627: public String getRightSectionPanePropertyName(int inIndex,
628: int inSubIndex) {
629:
630: String outValue = null;
631:
632: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
633: RIGHT_SECTION, inIndex);
634: ConceptTagCharacteristicHolder propertyCtcharh = panePropertyCtchar
635: .getValueAsHolder(inSubIndex, null);
636: ConceptTagCharacteristic nameCtchar = propertyCtcharh
637: .getCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_NAME_CTCON);
638:
639: outValue = nameCtchar.getValueAsString(0, null);
640:
641: return outValue;
642: }
643:
644: public String getRightSectionPanePropertyValue(int inIndex,
645: int inSubIndex) {
646: //
647:
648: String outValue = null;
649:
650: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
651: RIGHT_SECTION, inIndex);
652: ConceptTagCharacteristicHolder propertyCtcharh = panePropertyCtchar
653: .getValueAsHolder(inSubIndex, null);
654: ConceptTagCharacteristic valueCtchar = propertyCtcharh
655: .getCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_VALUE_CTCON);
656:
657: outValue = valueCtchar.getValueAsString(0, null);
658:
659: return outValue;
660: }
661:
662: public void removeRightSectionPaneProperty(int inIndex,
663: int inSubIndex) {
664: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
665: RIGHT_SECTION, inIndex);
666: panePropertyCtchar.removeValueWithLocalFiles(inSubIndex);
667: }
668:
669: public void addRightSectionPaneProperty(int inIndex,
670: int inSubIndex, String inName, String inValue) {
671: //
672: ConceptTagCharacteristic panePropertyCtchar = getPanePropertyCtchar(
673: RIGHT_SECTION, inIndex);
674: ConceptTagCharacteristicHolder propertyCtcharh = panePropertyCtchar
675: .createRegisteredHolder(inSubIndex, true);
676: //
677: ConceptTagCharacteristic nameCtchar = propertyCtcharh
678: .registerCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_NAME_CTCON);
679: nameCtchar.addValue(0, inName);
680: //
681: ConceptTagCharacteristic valueCtchar = propertyCtcharh
682: .registerCharacteristic(SECTION_CTCON_PANE_CTCON_PROPERTY_CTCON_VALUE_CTCON);
683: valueCtchar.addValue(0, inValue);
684: }
685:
686: //
687: //
688: //
689: //
690: //
691: //
692: //
693: //
694: //
695: //
696: //
697: public boolean isMainPropertyPresent(String inName) {
698:
699: boolean outValue = false;
700:
701: outValue = (getMainPropertyIndex(inName) != -1);
702:
703: return outValue;
704: }
705:
706: public String getMainProperty(String inName) {
707:
708: String outValue = null;
709:
710: int propIndex = getMainPropertyIndex(inName);
711:
712: if (propIndex != -1) {
713: outValue = getMainPropertyValue(propIndex);
714: } else {
715: throw new UnexpectedSystemException("Property '" + inName
716: + "' is not present");
717: }
718:
719: return outValue;
720: }
721:
722: public int getMainPropertyIndex(String inName) {
723:
724: int outValue = -1;
725:
726: for (int i = 0; i < getMainPropertyCount(); i++) {
727: String nextName = getMainPropertyName(i);
728: if (inName.equals(nextName)) {
729: outValue = i;
730: }
731: }
732:
733: return outValue;
734: }
735:
736: public int getMainWidth() {
737:
738: int outValue = 0;
739:
740: String s = getMainProperty(ConsoleConfigTagPreferencesHelper.PROP_NAME__WIDTH);
741:
742: outValue = Integer.parseInt(s);
743:
744: return outValue;
745: }
746:
747: //
748: public boolean isLeftSectionPanePropertyPresent(int inIndex,
749: String inName) {
750:
751: boolean outValue = false;
752:
753: outValue = (getLeftSectionPanePropertyIndex(inIndex, inName) != -1);
754:
755: return outValue;
756:
757: }
758:
759: public String getLeftSectionPaneProperty(int inIndex, String inName) {
760:
761: String outValue = null;
762:
763: int propIndex = getLeftSectionPanePropertyIndex(inIndex, inName);
764:
765: if (propIndex != -1) {
766: outValue = getLeftSectionPanePropertyValue(inIndex,
767: propIndex);
768: } else {
769: throw new UnexpectedSystemException("Property '" + inName
770: + "' is not present");
771: }
772:
773: return outValue;
774: }
775:
776: public int getLeftSectionPanePropertyIndex(int inIndex,
777: String inName) {
778:
779: int outValue = -1;
780:
781: for (int i = 0; i < getLeftSectionPanePropertyCount(inIndex); i++) {
782: //
783: String nextName = getLeftSectionPanePropertyName(inIndex, i);
784: if (inName.equals(nextName)) {
785: outValue = i;
786: }
787: }
788:
789: return outValue;
790: }
791:
792: //
793: public boolean isCenterSectionPanePropertyPresent(int inIndex,
794: String inName) {
795:
796: boolean outValue = false;
797:
798: outValue = (getCenterSectionPanePropertyIndex(inIndex, inName) != -1);
799:
800: return outValue;
801:
802: }
803:
804: public String getCenterSectionPaneProperty(int inIndex,
805: String inName) {
806:
807: String outValue = null;
808:
809: int propIndex = getCenterSectionPanePropertyIndex(inIndex,
810: inName);
811:
812: if (propIndex != -1) {
813: outValue = getCenterSectionPanePropertyValue(inIndex,
814: propIndex);
815: } else {
816: throw new UnexpectedSystemException("Property '" + inName
817: + "' is not present");
818: }
819:
820: return outValue;
821: }
822:
823: public int getCenterSectionPanePropertyIndex(int inIndex,
824: String inName) {
825:
826: int outValue = -1;
827:
828: for (int i = 0; i < getCenterSectionPanePropertyCount(inIndex); i++) {
829: //
830: String nextName = getCenterSectionPanePropertyName(inIndex,
831: i);
832: if (inName.equals(nextName)) {
833: outValue = i;
834: }
835: }
836:
837: return outValue;
838: }
839:
840: //
841: public boolean isRightSectionPanePropertyPresent(int inIndex,
842: String inName) {
843: //
844: boolean outValue = false;
845:
846: outValue = (getRightSectionPanePropertyIndex(inIndex, inName) != -1);
847:
848: return outValue;
849: }
850:
851: public String getRightSectionPaneProperty(int inIndex, String inName) {
852:
853: String outValue = null;
854:
855: int propIndex = getRightSectionPanePropertyIndex(inIndex,
856: inName);
857:
858: if (propIndex != -1) {
859: outValue = getRightSectionPanePropertyValue(inIndex,
860: propIndex);
861: } else {
862: throw new UnexpectedSystemException("Property '" + inName
863: + "' is not present");
864: }
865:
866: return outValue;
867: }
868:
869: public int getRightSectionPanePropertyIndex(int inIndex,
870: String inName) {
871:
872: int outValue = -1;
873:
874: for (int i = 0; i < getRightSectionPanePropertyCount(inIndex); i++) {
875: //
876: String nextName = getRightSectionPanePropertyName(inIndex,
877: i);
878: if (inName.equals(nextName)) {
879: outValue = i;
880: }
881: }
882:
883: return outValue;
884: }
885: }
|