home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 5.0 KB | 142 lines |
- /*
- * Copyright (c) 1997 Krumel & Associates, Inc. All Rights Reserved.
- *
- * www.krumel.com - controls@krumel.com
- *
- * Permission is given to the buyer of this package for one software
- * developer to use this software on one CPU (one workstation) and to make
- * one backup copy. You may uitilize and/or modify this class for use in your
- * projects. You may distribute or sell any executable which results from
- * using this code in yur application, except a utility or class of similar
- * nature to this product. You may distribute this product in compiled
- * form only, but soley to be used with your cmpiled executable product
- * for the puposes of dynamic loading. You may NOT redistribute the source
- * code in any form or make it accessible through a network or other
- * distribution media to others. Please refer to the file "copyright.html"
- * for further important copyright and licensing information.
- *
- * The source code is the confidential and proprietary information
- * of Krumel & Associates, Inc. ("Confidential Information"). You shall
- * not disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Krumel & Associates, Inc..
-
- * KRUMEL & ASSOCIATES MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
- * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
- * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. KRUMEL & ASSOCIATES SHALL NOT
- * BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
- * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
- */
-
- package symantec.itools.db.awt;
-
-
- import java.awt.Image;
-
- /**
- * This interface serves as the basis for transferring information from a DataSource
- * to a TableCell. Methods are defined for a cell to use obtain and set string and image
- * data.
- */
- public interface Data extends java.io.Serializable {
- /**
- * Type flag to indicate the data is string information.
- */
- public static final int STRING = 1;
- /**
- * Type flag to indicate the data is image information.
- */
- public static final int IMAGE = 2;
- /**
- * Type flag to indicate the data is string and image information.
- */
- public static final int IMAGE_STRING = 3;
-
- /**
- * Based type value for subclasses to define their own types of data.
- */
- public static final int USER_TYPE = 100;
-
- /**
- * Gets the value of the type flag to indicate the type of information
- * held by the data object.
- */
- public int type();
- /**
- * Gets whether the data can be modified.
- */
- public boolean isEditable(int row, int col);
- /**
- * Gets whether the data has been changed since last committed.
- */
- public boolean changed();
- /**
- * Requests the value of the data be returned to the last save point.
- */
- public void rollback();
- /**
- * Commits the current data as the current value. This method is normally called
- * by the data source when a commit request was issued.
- * @exception TypeNotSupported if the data source does not support the type of
- * action requested or is not successful
- */
- public void commit() throws TypeNotSupported;
- /**
- * Gets whether the data supports multiple predefined choice data.
- */
- public boolean supportsChoice();
- /**
- * Gets an array of Data objects that define the predefined values associated
- * with a field.
- * @exception TypeNotSupported if the data source does not support the type of
- * action requested or is not successful
- */
- public Data[] getChoices() throws TypeNotSupported;
- /**
- * Sets the string value for the data.
- */
- public void setText(String t);
-
- /**
- * Inserts a character into the string data.
- * @param pos The position in the string to insert the character. Follows the
- * same rules as the StringBuffer class.
- * @param c The character to insert.
- */
- public void insertChar(int pos, char c);
- /**
- * Sets the string value for the field using a character.
- */
- public void setText(char c);
- /**
- * Appends a character to the end of the string data.
- */
- public void appendChar(char c);
- /**
- * Sets the string value to the empty string.
- */
- public void clearText();
- /**
- * Removes a character from the string data for the field.
- */
- public void deleteChar(int pos);
- /**
- * Gets a substring from the string data for the field.
- */
- public String subString(int spos, int epos);
- /**
- * Sets a new image for the field.
- */
- public void setImage(Image i);
- /**
- * Gets the current string value for the field.
- */
- public String toString();
- /**
- * Gets teh current image value for the field.
- */
- public Image toImage();
- }
-
-