001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/wizard/tool/src/java/org/theospi/portfolio/wizard/tool/DecoratedCategoryChild.java $
003: * $Id: DecoratedCategoryChild.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.theospi.portfolio.wizard.tool;
021:
022: /**
023: * Created by IntelliJ IDEA.
024: * User: John Ellis
025: * Date: Jan 17, 2006
026: * Time: 4:18:11 PM
027: * To change this template use File | Settings | File Templates.
028: */
029: public abstract class DecoratedCategoryChild implements
030: DecoratedListInterface {
031:
032: private static final String INDENT_CHAR = " ";
033:
034: private String indentString;
035: private int indent;
036: private WizardTool parent;
037: private boolean moveTarget;
038:
039: public DecoratedCategoryChild(WizardTool parent, int indent) {
040: this .parent = parent;
041: this .indent = indent;
042: this .indentString = "";
043: for (int i = 0; i < indent - 1; i++) {
044: this .indentString += INDENT_CHAR;
045: }
046: }
047:
048: public String getIndentString() {
049: return indentString;
050: }
051:
052: public void setIndentString(String indentString) {
053: this .indentString = indentString;
054: }
055:
056: public int getIndent() {
057: return indent;
058: }
059:
060: public void setIndent(int indent) {
061: this .indent = indent;
062: }
063:
064: public abstract String getTitle();
065:
066: public abstract boolean isSelected();
067:
068: public abstract void setSelected(boolean selected);
069:
070: public abstract String processActionEdit();
071:
072: public abstract String processActionDelete();
073:
074: public abstract String moveUp();
075:
076: public abstract String moveDown();
077:
078: public abstract boolean isFirst();
079:
080: public abstract boolean isLast();
081:
082: public boolean isCategory() {
083: return false;
084: }
085:
086: public String processActionMove() {
087: setMoveTarget(true);
088: getParent().setMoveCategoryChild(this );
089: return null;
090: }
091:
092: public WizardTool getParent() {
093: return parent;
094: }
095:
096: public void setParent(WizardTool parent) {
097: this .parent = parent;
098: }
099:
100: public boolean isMoveTarget() {
101: return moveTarget;
102: }
103:
104: public void setMoveTarget(boolean moveTarget) {
105: this .moveTarget = moveTarget;
106: }
107:
108: public String processActionCancelMove() {
109: getParent().setMoveCategoryChild(null);
110: setMoveTarget(false);
111: return null;
112: }
113: }
|