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.base;
009:
010: //base classes
011:
012: //project specific classes
013: import org.jfolder.common.tagging.ConceptTagCharacteristic;
014:
015: //other classes
016:
017: public class BaseRcthStudioSettings {
018:
019: //
020: private final static Integer CHANGE_TYPE_CREATE = new Integer(1);
021: private final static Integer CHANGE_TYPE_UPDATE = new Integer(2);
022: private final static Integer CHANGE_TYPE_DELETE = new Integer(3);
023:
024: //
025: private String updatedHighlightHandle = null;
026: //
027: private Integer changeType = null;
028: private String changeParentHandle = null;
029: private String changeHandle = null;
030: private ConceptTagCharacteristic changeParent = null;
031: private int changeIndex = 0;
032: //
033: private String binaryOutputFileName = null;
034: private String binaryOutputMimeType = null;
035: private byte[] binaryOutputContent = null;
036:
037: private BaseRcthStudioSettings() {
038: }
039:
040: protected final static BaseRcthStudioSettings newInstance() {
041: return new BaseRcthStudioSettings();
042: }
043:
044: //
045: //
046: public boolean isUpdatedHighlightHandlePresent() {
047: return (this .updatedHighlightHandle != null);
048: }
049:
050: public String getUpdatedHighlightHandle() {
051: return this .updatedHighlightHandle;
052: }
053:
054: public void setUpdatedHighlightHandle(
055: String inUpdatedHighlightHandle) {
056: this .updatedHighlightHandle = inUpdatedHighlightHandle;
057: }
058:
059: //
060: public void registerRcthCreate(String inParentHandle,
061: String inHandle, ConceptTagCharacteristic inParent,
062: int inIndex) {
063: //
064: registerRcthChange(CHANGE_TYPE_CREATE, inParentHandle,
065: inHandle, inParent, inIndex);
066: }
067:
068: public void registerRcthUpdate(String inParentHandle,
069: String inHandle, ConceptTagCharacteristic inParent,
070: int inIndex) {
071: //
072: registerRcthChange(CHANGE_TYPE_UPDATE, inParentHandle,
073: inHandle, inParent, inIndex);
074: }
075:
076: public void registerRcthDelete(String inParentHandle,
077: String inHandle, ConceptTagCharacteristic inParent,
078: int inIndex) {
079: //
080: registerRcthChange(CHANGE_TYPE_DELETE, inParentHandle,
081: inHandle, inParent, inIndex);
082: }
083:
084: //
085: //
086: private void registerRcthChange(Integer inType,
087: String inParentHandle, String inHandle,
088: ConceptTagCharacteristic inParent, int inIndex) {
089: //
090: //
091: this .changeType = inType;
092: this .changeParentHandle = inParentHandle;
093: this .changeHandle = inHandle;
094: this .changeParent = inParent;
095: this .changeIndex = inIndex;
096: }
097:
098: //
099: //
100: //
101: public boolean isRcthChangePresent() {
102: return (this .changeType != null);
103: }
104:
105: public boolean isRcthChangeCreate() {
106: return (this .changeType.equals(CHANGE_TYPE_CREATE));
107: }
108:
109: public boolean isRcthChangeUpdate() {
110: return (this .changeType.equals(CHANGE_TYPE_UPDATE));
111: }
112:
113: public boolean isRcthChangeDelete() {
114: return (this .changeType.equals(CHANGE_TYPE_DELETE));
115: }
116:
117: //
118: public String getRcthChangeParentHandle() {
119: return this .changeParentHandle;
120: }
121:
122: public String getRcthChangeHandle() {
123: return this .changeHandle;
124: }
125:
126: public ConceptTagCharacteristic getRcthChangeParent() {
127: return this .changeParent;
128: }
129:
130: public int getRcthChangeIndex() {
131: return this .changeIndex;
132: }
133:
134: //
135: public void setRcthBinaryOutput(String inFileName,
136: String inMimeType, byte inContent[]) {
137: //
138: this .binaryOutputFileName = inFileName;
139: this .binaryOutputMimeType = inMimeType;
140: this .binaryOutputContent = inContent;
141: }
142:
143: public boolean isRcthBinaryOutputPresent() {
144: return (this .binaryOutputContent != null);
145: }
146:
147: public String getRcthBinaryOutputFileName() {
148: return this .binaryOutputFileName;
149: }
150:
151: public String getRcthBinaryOutputMimeType() {
152: return this .binaryOutputMimeType;
153: }
154:
155: public byte[] getRcthBinaryOutputContent() {
156: return this.binaryOutputContent;
157: }
158: }
|