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.macro.v1;
009:
010: //base classes
011: import java.util.HashMap;
012:
013: //project specific classes
014: import org.jfolder.common.tagging.AppraiseConceptTagContext;
015: import org.jfolder.common.tagging.CompoundConceptTagConstraintContext;
016: import org.jfolder.common.tagging.ConceptTagCharacteristic;
017: import org.jfolder.common.tagging.ConceptTagCharacteristicHolder;
018: import org.jfolder.common.tagging.ConceptTagConstraint;
019: import org.jfolder.common.tagging.ConceptTagConstraintHolder;
020: import org.jfolder.common.tagging.ConceptTagConstraintTemplate;
021: import org.jfolder.common.tagging.DynamicConceptTagConstraintContext;
022: import org.jfolder.common.tagging.InitializeConceptTagContext;
023: import org.jfolder.common.tagging.RootConceptTagHolder;
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.web.template.ConsoleTemplateSession;
028: import org.jfolder.common.web.template.PageSetupContext;
029: import org.jfolder.console.macro.ConsoleMacro;
030: import org.jfolder.console.macro.ConsoleMacroTag;
031:
032: //other classes
033:
034: public class CursorClickConsoleMacroTag implements ConsoleMacroTag {
035:
036: //id details
037: private final static String ID_CTCON = "id";
038: private final static String ID_TITLE = "ID";
039: private final static String ID_SHORT_DESCRIPTION = "ID";
040:
041: ////characteristics
042: ////private ConceptTagCharacteristic conceptTagRegistryCtchar = null;
043: //
044: ////pane details
045: //private final static String PANE_CTCON = "pane";
046: //private final static String PANE_TITLE = "Pane";
047: //private final static String PANE_SHORT_DESCRIPTION = "Pane";
048: //
049: ////property details
050: //private final static String PROPERTY_CTCON = "property";
051: //private final static String PROPERTY_TITLE = "Property";
052: //private final static String PROPERTY_SHORT_DESCRIPTION = "Property";
053: //
054: ////name of property details
055: //private final static String PROPERTY_CTCON_NAME_CTCTEMP = "name";
056: //private final static String PROPERTY_CTCON_NAME_TITLE = "Name";
057: //private final static String PROPERTY_CTCON_NAME_SHORT_DESCRIPTION =
058: //"Name";
059: //
060: ////value of property details
061: //private final static String PROPERTY_CTCON_VALUE_CTCTEMP = "value";
062: //private final static String PROPERTY_CTCON_VALUE_TITLE = "Value";
063: //private final static String PROPERTY_CTCON_VALUE_SHORT_DESCRIPTION =
064: // "Value";
065:
066: ///////////////////////////////////
067:
068: public void initialize(InitializeConceptTagContext inIctc) {
069:
070: //
071: ConceptTagConstraintHolder rootCtconh = ConceptTagConstraintHolder
072: .newInstance(inIctc);
073:
074: //constrain "id"
075: ConceptTagConstraint idCtcon = ConceptTagConstraint
076: .newInstance(ID_CTCON, rootCtconh);
077: idCtcon.setTitle(ID_TITLE);
078: idCtcon.setShortDescription(ID_SHORT_DESCRIPTION);
079: //
080: StaticConceptTagConstraintContext idSctcc = StaticConceptTagConstraintContext
081: .newInstance(idCtcon);
082:
083: ////constrain "pane"
084: //ConceptTagConstraint paneCtcon =
085: // ConceptTagConstraint.newInstance(PANE_CTCON, rootCtconh);
086: //paneCtcon.setTitle(PANE_TITLE);
087: //paneCtcon.setShortDescription(PANE_SHORT_DESCRIPTION);
088: ////
089: //DynamicConceptTagConstraintContext paneDctcc =
090: // DynamicConceptTagConstraintContext.newInstance(paneCtcon);
091: ////
092: //paneDctcc.addDefaultValue(UpDownConsoleConfigTag.class);
093: //
094: ////constrain "property"
095: //ConceptTagConstraint propertyCtcon =
096: // ConceptTagConstraint.newInstance(PROPERTY_CTCON, rootCtconh);
097: //propertyCtcon.setTitle(PROPERTY_TITLE);
098: //propertyCtcon.setShortDescription(PROPERTY_SHORT_DESCRIPTION);
099: ////
100: //CompoundConceptTagConstraintContext propertyCctcc =
101: // CompoundConceptTagConstraintContext.newInstance(propertyCtcon);
102: //
103: ////constrain "name" of "property"
104: //ConceptTagConstraintTemplate propertyCtconNameCtctemp =
105: // ConceptTagConstraintTemplate.newInstance(
106: // PROPERTY_CTCON_NAME_CTCTEMP, propertyCctcc);
107: ////
108: //StaticConceptTagConstraintContext propertyCtconNameSctcc =
109: // StaticConceptTagConstraintContext.newInstance(
110: // propertyCtconNameCtctemp);
111: //
112: ////constrain "value" of "property"
113: //ConceptTagConstraintTemplate propertyCtconValueCtctemp =
114: // ConceptTagConstraintTemplate.newInstance(
115: // PROPERTY_CTCON_VALUE_CTCTEMP, propertyCctcc);
116: ////
117: //StaticConceptTagConstraintContext propertyCtconValueSctcc =
118: // StaticConceptTagConstraintContext.newInstance(
119: // propertyCtconValueCtctemp);
120:
121: //
122: inIctc.initialize();
123:
124: //
125: //this.conceptTagRegistryCtchar =
126: // conceptTagRegistryCtcon.getCharacteristic();
127:
128: }
129:
130: //
131: public void appraise(AppraiseConceptTagContext inCtic) {
132: if (inCtic instanceof StudioConceptTagInstanceInfoContext) {
133: StudioConceptTagInstanceInfoContext sctiic = (StudioConceptTagInstanceInfoContext) inCtic;
134: sctiic.setInstanceTitle("Cursor Click");
135: sctiic.setInstanceDescription("Cursor Click");
136: } else if (inCtic instanceof StudioConceptTagTypeInfoContext) {
137: StudioConceptTagTypeInfoContext scttic = (StudioConceptTagTypeInfoContext) inCtic;
138: scttic.setTypeTitle("Cursor Click");
139: scttic.setTypeDescription("Cursor Click");
140: }
141: }
142:
143: //
144: public final static CursorClickConsoleMacroTag newInstance(
145: ConceptTagCharacteristic inCtchar, String inId) {
146: //
147: CursorClickConsoleMacroTag outValue = null;
148:
149: outValue = new CursorClickConsoleMacroTag();
150: //
151: ConceptTagCharacteristicHolder nextCtcharh = inCtchar.addValue(
152: inCtchar.getValueLength(), outValue, true);
153: //
154: ConceptTagCharacteristic nextIdCtchar = nextCtcharh
155: .registerCharacteristic(ID_CTCON);
156: nextIdCtchar.addValue(0, inId);
157:
158: return outValue;
159: }
160:
161: //
162: public void generateMacroCommands(PageSetupContext inPsc,
163: ConsoleTemplateSession inCts, RootConceptTagHolder inRcth,
164: HashMap inVars, String inFromHandle,
165: String inAliasFromHandle, String inSourcePage,
166: String inDestinationPage) {
167: //
168: //String id = this.idCtchar.getValueAsString(0);
169: //
170: //String value = this.valueCtchar.getValueAsString(0);
171: //
172: inPsc.addMacroCommand("macroAlert('CursorClick Not Impl')");
173: }
174: }
|