Initial commit from SVN.

This commit is contained in:
wcrisman
2014-05-30 10:31:51 -07:00
commit b45e56b890
1968 changed files with 370949 additions and 0 deletions

View File

@@ -0,0 +1,246 @@
/*
* Copyright (c) 2005,2007 Declarative Engineering LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Declarative Engineering LLC
* verson 1 which accompanies this distribution, and is available at
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
*/
package com.foundation.tcv.swt;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
public interface ITreeComponent extends ICollectionComponent {
/** Binds node data into the tree for a specific parent. This is separate from the add node since a node can have multiple parents. This message passes two ints in an array (new int[] {parentId, childId}) */
public static final int MESSAGE_ADD_NODE_LINK = ICollectionComponent.LAST_MESSAGE_NUMBER + 1;
/** Unbinds node data from the tree for a specific parent. This is separate from the remove node since a node can have multiple parents. This message passes two ints in an array (new int[] {parentId, childId}) */
public static final int MESSAGE_REMOVE_NODE_LINK = ICollectionComponent.LAST_MESSAGE_NUMBER + 2;
/** Sets the selection by passing an array of selected object identifiers. */
public static final int MESSAGE_SET_SELECTION = ICollectionComponent.LAST_MESSAGE_NUMBER + 3;
public static final int MESSAGE_ADD_SELECTIONS = ICollectionComponent.LAST_MESSAGE_NUMBER + 4;
public static final int MESSAGE_REMOVE_SELECTIONS = ICollectionComponent.LAST_MESSAGE_NUMBER + 5;
public static final int MESSAGE_ADD_SELECTION = ICollectionComponent.LAST_MESSAGE_NUMBER + 6;
public static final int MESSAGE_REMOVE_SELECTION = ICollectionComponent.LAST_MESSAGE_NUMBER + 7;
public static final int MESSAGE_REMOVE_ALL_SELECTIONS = ICollectionComponent.LAST_MESSAGE_NUMBER + 8;
public static final int MESSAGE_VIEW_SYNCHRONIZE_SELECTION = ICollectionComponent.LAST_MESSAGE_NUMBER + 9;
public static final int MESSAGE_ADD_COLUMN = ICollectionComponent.LAST_MESSAGE_NUMBER + 10;
public static final int MESSAGE_REMOVE_COLUMN = ICollectionComponent.LAST_MESSAGE_NUMBER + 11;
public static final int MESSAGE_SET_COLUMN_HEADER_TEXT = ICollectionComponent.LAST_MESSAGE_NUMBER + 12;
public static final int MESSAGE_SET_COLUMN_HEADER_IMAGE = ICollectionComponent.LAST_MESSAGE_NUMBER + 13;
public static final int MESSAGE_SET_CELL_TEXT = ICollectionComponent.LAST_MESSAGE_NUMBER + 14;
public static final int MESSAGE_SET_CELL_IMAGE = ICollectionComponent.LAST_MESSAGE_NUMBER + 15;
public static final int MESSAGE_SET_CELL_BACKGROUND_COLOR = ICollectionComponent.LAST_MESSAGE_NUMBER + 16;
public static final int MESSAGE_SET_CELL_FOREGROUND_COLOR = ICollectionComponent.LAST_MESSAGE_NUMBER + 17;
public static final int MESSAGE_SET_CELL_FONT = ICollectionComponent.LAST_MESSAGE_NUMBER + 18;
public static final int MESSAGE_SET_ROW_BACKGROUND_COLOR = ICollectionComponent.LAST_MESSAGE_NUMBER + 19;
public static final int MESSAGE_SET_ROW_FOREGROUND_COLOR = ICollectionComponent.LAST_MESSAGE_NUMBER + 20;
public static final int MESSAGE_SET_ROW_FONT = ICollectionComponent.LAST_MESSAGE_NUMBER + 21;
public static final int MESSAGE_OPEN_NODE = ICollectionComponent.LAST_MESSAGE_NUMBER + 22;
public static final int MESSAGE_NODE_OPENED = ICollectionComponent.LAST_MESSAGE_NUMBER + 23;
/** Stores some basic information about the state of the view, such as the open nodes, in order to re-apply the state after rebuilding the view. */
public static final int MESSAGE_SAVE_VIEW_STATE = ICollectionComponent.LAST_MESSAGE_NUMBER + 24;
/** Restores the view state such that previously opened nodes will be re-opened where possible. */
public static final int MESSAGE_RESTORE_VIEW_STATE = ICollectionComponent.LAST_MESSAGE_NUMBER + 25;
public static final int LAST_MESSAGE_NUMBER = ICollectionComponent.LAST_MESSAGE_NUMBER + 25;
/**
* Encapsulates one cell of data for the purpose of updating selected cells.
* <p>This can be used to transmit header cell data as well by passing an objectId of -1.</p>
*/
public static class TreeCellData implements java.io.Externalizable {
/** The identifier that will determine which row(s) are affected. */
private int objectId;
/** The zero based index of the column whose data is being modified. */
private int columnIndex;
/** The new cell data. */
private Object data;
/**
* TreeCellData constructor.
*/
public TreeCellData() {
}//TreeCellData()//
/**
* TreeCellData constructor.
* @param objectId The identifier that will determine which row(s) are affected.
* @param columnIndex The zero based index of the column whose data is being modified.
* @param data The new cell data.
*/
public TreeCellData(int objectId, int columnIndex, Object data) {
this.objectId = objectId;
this.columnIndex = columnIndex;
this.data = data;
}//TreeCellData()//
/**
* Gets the object identifier which is tied to one or more rows in the table.
* @return The identifier of the object whose rows need updating.
*/
public int getObjectId() {
return objectId;
}//getObjectId()//
/**
* Gets the index of the column whose data is being updated.
* @return The zero based column index.
*/
public int getColumnIndex() {
return columnIndex;
}//getColumnIndex()//
/**
* Gets the data for the cell.
* @return The new cell data.
*/
public Object getData() {
return data;
}//getData()//
/* (non-Javadoc)
* @see java.io.Externalizable#readExternal(java.io.ObjectInput)
*/
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
/*byte version = */in.readByte();
objectId = in.readInt();
columnIndex = in.readInt();
data = in.readObject();
}//readExternal()//
/* (non-Javadoc)
* @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
*/
public void writeExternal(ObjectOutput out) throws IOException {
out.writeByte(0);
out.writeInt(objectId);
out.writeInt(columnIndex);
out.writeObject(data);
}//writeExternal()//
}//TreeCellData//
/**
* Encapsulates one node of data which is associated with an object in the table.
*/
public static class TreeNodeData implements java.io.Externalizable {
/** The object identifier for the row being added. */
private int objectId;
/** The data for the node columns. */
private Object[] columnData;
/** The data elements for the hidden 'columns'. */
private Object[] hiddenData;
/** Whether the node could possibly have children. */
private boolean canHaveChildren = false;
/**
* TreeNodeData constructor.
*/
public TreeNodeData() {
}//TreeNodeData()//
/**
* TreeNodeData constructor.
* @param objectId The object identifier for the row being added.
* @param columnData The data for the node columns.
* @param hiddenData The data elements for the hidden 'columns'.
* @param canHaveChildren Whether the node could possibly have children.
*/
public TreeNodeData(int objectId, Object[] columnData, Object[] hiddenData, boolean canHaveChildren) {
this.objectId = objectId;
this.columnData = columnData;
this.canHaveChildren = canHaveChildren;
}//TreeNodeData()//
/**
* Gets the object identifier for the row.
* @return The object identifier which identifies the object that is associated with the row of data. Note that there can be more than one row per object id.
*/
public int getObjectId() {
return objectId;
}//getObjectId()//
/**
* Determines whether the node could possibly have children.
* @return Whether the node might have children.
*/
public boolean canHaveChildren() {
return canHaveChildren;
}//canHaveChildren()//
/**
* Gets the data used to display the node.
* @return The data for the node.
*/
public Object getColumnData() {
return columnData;
}//getColumnData()//
/**
* Gets the hidden data elements for the hidden columns.
* @return The hidden data for all the hidden columns.
*/
public Object[] getHiddenData() {
return hiddenData;
}//getHiddenData()//
/* (non-Javadoc)
* @see java.io.Externalizable#readExternal(java.io.ObjectInput)
*/
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
int length;
/*byte version = */in.readByte();
objectId = in.readInt();
length = in.readInt();
if(length > 0) {
columnData = new Object[length];
for(int index = 0; index < length; index++) {
columnData[index] = in.readObject();
}//for//
}//if//
else {
columnData = null;
}//else//
length = in.readInt();
if(length > 0) {
hiddenData = new Object[length];
for(int index = 0; index < length; index++) {
hiddenData[index] = in.readObject();
}//for//
}//if//
else {
hiddenData = null;
}//else//
canHaveChildren = in.readBoolean();
}//readExternal()//
/* (non-Javadoc)
* @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
*/
public void writeExternal(ObjectOutput out) throws IOException {
out.writeByte(0);
out.writeInt(objectId);
if(columnData != null) {
out.writeInt(columnData.length);
for(int index = 0; index < columnData.length; index++) {
out.writeObject(columnData[index]);
}//for//
}//if//
else {
out.writeInt(0);
}//else//
if(hiddenData != null) {
out.writeInt(hiddenData.length);
for(int index = 0; index < hiddenData.length; index++) {
out.writeObject(hiddenData[index]);
}//for//
}//if//
else {
out.writeInt(0);
}//else//
out.writeBoolean(canHaveChildren);
}//writeExternal()//
}//TreeNodeData//
}//ITreeComponent//