Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
This software and documentation is the confidential and proprietary
information of ViaOA, 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 ViaOA, Inc..
ViaOA, Inc. 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. ViaOA, Inc. SHALL NOT BE LIABLE FOR ANY DAMAGES
SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
THIS SOFTWARE OR ITS DERIVATIVES.
Copyright (c) 2001 ViaOA, Inc.
All rights reserved.
*/
/******
bottom row ....
*/
public class OATable extends OAHtmlComponent {
private static final long serialVersionUID = 1L;
protected Vector columns = new Vector(3,3);
int scrollAmount = 0;
int topRow = 0;
boolean bSelect; // should the row of the activeObject be highlighted
public Hashtable hashRowCommand = new Hashtable(11);
protected Vector vecRowCommand = new Vector(3,3);
public Hashtable hashRowLink = new Hashtable(7);
public Hashtable hashCommand = new Hashtable(11);
protected Object lastMasterObject;
protected Object lastActiveObject;
protected int lastChangeCount, newListCount;
// these are used to know when objects in hub change
protected Object activeObject;
String colorEven = "#dddddd"; // even lines
String colorOdd = "#eeeeee"; // odd lines
String colorSelected = "#FFFF40";// "#ffffcc"; selected line
public OATable(Hub hub) {
setHub(hub);
}
/** add a command button to table
@param name is not case sensitive
*/
public void addCommand(String name, OACommand cmd) {
if (name == null || cmd == null) return;
hashCommand.put(name.toUpperCase(), cmd);
cmd.name = name;
}
/** Calls the commands setHub() and setTable().
if command type is TABLENEXT or TABLEPREVIOUS, then cmd.setVisible() will be set.
@param name is not case sensitive
*/
public OACommand getCommand(String name) {
return getCommand(name, true);
}
protected OACommand getCommand(String name, boolean bFlag) {
initialize();
OACommand cmd = null;
if (name != null) cmd = (OACommand) hashCommand.get(name.toUpperCase());
if (cmd == null) {
if (!bFlag) return null;
throw new RuntimeException("OATable.getCommand() Command \""+name+"\" not found");
}
cmd.table = this;
cmd.form = this.form;
cmd.setHub(hub);
if (cmd.command == OACommand.TABLENEXT) {
boolean b = false;
if (hub != null) {
if (hub.elementAt(topRow + scrollAmount) != null) b = true;
}
cmd.setVisible(b);
}
else if (cmd.command == OACommand.TABLEPREVIOUS) {
if (topRow > 0) cmd.setVisible(true);
else cmd.setVisible(false);
}
return cmd;
}
/** returns built in command "cmdNext" with built in settings:
cmd = new OACommand(OACommand.NEXT);
cmd.setImageName("tableNext.gif");
cmd.setInvisibleImageName("invisible.gif");
this.addCommand("cmdNext", cmd);
*/
public OACommand getNextCommand() {
String name = "cmdNext".toUpperCase();
OACommand cmd;
if (hashCommand.get(name) == null) {
cmd = new OACommand(OACommand.NEXT);
cmd.setImageName("tableNext.gif");
cmd.setInvisibleImageName("invisible.gif");
this.addCommand(name, cmd);
}
cmd = getCommand(name);
return cmd;
}
/** returns built in command "cmdPrevious" with built in settings:
cmd = new OACommand(OACommand.PREVIOUS);
cmd.setImageName("tablePrevious.gif");
cmd.setInvisibleImageName("invisible.gif");
this.addCommand("cmdPrevious", cmd);
*/
public OACommand getPreviousCommand() {
String name = "cmdPrevious".toUpperCase();
OACommand cmd;
if (hashCommand.get(name) == null) {
cmd = new OACommand(OACommand.PREVIOUS);
cmd.setImageName("tablePrevious.gif");
cmd.setInvisibleImageName("invisible.gif");
this.addCommand(name, cmd);
}
cmd = getCommand(name);
return cmd;
}
/**
@param name is not case sensitive
*/
public void addRowCommand(String name, OACommand cmd) {
if (cmd != null && name != null) {
hashRowCommand.put(name.toUpperCase(),cmd);
vecRowCommand.add(name);
cmd.name = name;
}
}
/**
@param name is not case sensitive
*/
public void addRowLink(String name, OALink lnk) {
if (name != null && lnk != null) {
hashRowLink.put(name.toUpperCase(),lnk);
lnk.name = name;
}
}
/** add a command button to every row in table.
The following will be automatically done for the command: