functiontable.java
来自「JGraph扩展应用。自定义Renderer,自定义视图View实现自定义工作流」· Java 代码 · 共 53 行
JAVA
53 行
/**
*
*/
package flow.graph.gui.graph.cell.ui.table;
import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import org.jgraph.graph.DefaultGraphCell;
import flow.graph.gui.graph.FlowGraphConstants;
import flow.graph.gui.graph.cell.bpel.Function;
import flow.graph.gui.graph.cell.bpel.Functions;
import flow.graph.gui.graph.cell.bpel.Message;
import flow.graph.gui.graph.cell.bpel.Messages;
/**
* @author Administrator
*
*/
public class FunctionTable extends JTable{
private DefaultGraphCell cell;
private FunctionTableModel tableModel;
public final static int DEFAULT_ROW_COUNT = 10;
public FunctionTable(DefaultGraphCell cell){
super(new FunctionTableModel());
tableModel = (FunctionTableModel)getModel();
this.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
//getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(new JComboBox(Message.MessageType)));
this.cell = cell;
Functions functions = (Functions)FlowGraphConstants.getBpelFunctions(cell.getAttributes());
if(functions != null){
for(int i=0;i<functions.getFunctions().size();i++){
Function function = (Function)(functions.getFunctions().get(i));
tableModel.addRow(function.getName(), function.getParameter(), function.getDiscription());
}
}
//initTable();
}
public void initTable(){
if(getRowCount() < DEFAULT_ROW_COUNT){
for(int i=getRowCount();i<DEFAULT_ROW_COUNT;i++){
tableModel.addRow("", "", "");
}
}
tableModel.fireTableDataChanged();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?