Contribution [2714423] - Workflow Activities Overview Table

Make table not editable
https://sourceforge.net/tracker/?func=detail&atid=883808&aid=2714423&group_id=176962
This commit is contained in:
Carlos Ruiz 2009-05-21 13:44:14 +00:00
parent ca5fda5868
commit 3b16b9cc97
1 changed files with 10 additions and 18 deletions

View File

@ -44,6 +44,7 @@ import org.compiere.apps.StatusBar;
import org.compiere.apps.form.FormFrame; import org.compiere.apps.form.FormFrame;
import org.compiere.apps.form.FormPanel; import org.compiere.apps.form.FormPanel;
import org.compiere.grid.ed.VLookup; import org.compiere.grid.ed.VLookup;
import org.compiere.minigrid.MiniTable;
import org.compiere.model.MColumn; import org.compiere.model.MColumn;
import org.compiere.model.MQuery; import org.compiere.model.MQuery;
import org.compiere.model.MRefList; import org.compiere.model.MRefList;
@ -53,7 +54,6 @@ import org.compiere.swing.CComboBox;
import org.compiere.swing.CLabel; import org.compiere.swing.CLabel;
import org.compiere.swing.CPanel; import org.compiere.swing.CPanel;
import org.compiere.swing.CScrollPane; import org.compiere.swing.CScrollPane;
import org.compiere.swing.CTable;
import org.compiere.swing.CTextArea; import org.compiere.swing.CTextArea;
import org.compiere.swing.CTextField; import org.compiere.swing.CTextField;
import org.compiere.swing.CTextPane; import org.compiere.swing.CTextPane;
@ -82,7 +82,7 @@ public class WFActivity extends CPanel
/** /**
* *
*/ */
private static final long serialVersionUID = 752377976007540423L; private static final long serialVersionUID = 6917300855914216420L;
private static final int MAX_ACTIVITIES_IN_LIST = MSysConfig.getIntValue("MAX_ACTIVITIES_IN_LIST", 200, Env.getAD_Client_ID(Env.getCtx())); private static final int MAX_ACTIVITIES_IN_LIST = MSysConfig.getIntValue("MAX_ACTIVITIES_IN_LIST", 200, Env.getAD_Client_ID(Env.getCtx()));
@ -126,8 +126,6 @@ public class WFActivity extends CPanel
private MWFActivity[] m_activities = null; private MWFActivity[] m_activities = null;
/** Current Activity */ /** Current Activity */
private MWFActivity m_activity = null; private MWFActivity m_activity = null;
/** Current Activity */
private int m_index = 0;
/** Set Column */ /** Set Column */
private MColumn m_column = null; private MColumn m_column = null;
/** Logger */ /** Logger */
@ -137,7 +135,7 @@ public class WFActivity extends CPanel
new String[]{Msg.translate(Env.getCtx(), "Priority"), new String[]{Msg.translate(Env.getCtx(), "Priority"),
Msg.translate(Env.getCtx(), "AD_WF_Node_ID"), Msg.translate(Env.getCtx(), "AD_WF_Node_ID"),
Msg.translate(Env.getCtx(), "Summary")}, 0); Msg.translate(Env.getCtx(), "Summary")}, 0);
private CTable selTable = new CTable(); private MiniTable selTable = new MiniTable();
private CScrollPane selPane = new CScrollPane(selTable); private CScrollPane selPane = new CScrollPane(selTable);
// //
private CPanel centerPanel = new CPanel(); private CPanel centerPanel = new CPanel();
@ -199,6 +197,9 @@ public class WFActivity extends CPanel
// bPrevious.addActionListener(this); // bPrevious.addActionListener(this);
// bNext.addActionListener(this); // bNext.addActionListener(this);
selTable.setModel(selTableModel); selTable.setModel(selTableModel);
selTable.setColumnClass(0, Integer.class, true); // 0-Priority
selTable.setColumnClass(1, String.class, true); // 1-AD_WF_Node_ID
selTable.setColumnClass(2, String.class, true); // 2-Summary
selTable.getSelectionModel().addListSelectionListener(this); selTable.getSelectionModel().addListSelectionListener(this);
bZoom.addActionListener(this); bZoom.addActionListener(this);
bOK.addActionListener(this); bOK.addActionListener(this);
@ -436,7 +437,6 @@ public class WFActivity extends CPanel
// //
log.fine("#" + m_activities.length log.fine("#" + m_activities.length
+ "(" + (System.currentTimeMillis()-start) + "ms)"); + "(" + (System.currentTimeMillis()-start) + "ms)");
m_index = 0;
return m_activities.length; return m_activities.length;
} // loadActivities } // loadActivities
@ -554,9 +554,9 @@ public class WFActivity extends CPanel
*/ */
public void valueChanged(ListSelectionEvent e) public void valueChanged(ListSelectionEvent e)
{ {
int m_index = selTable.getSelectedRow(); int index = selTable.getSelectedRow();
if (m_index >= 0) if (index >= 0)
display(m_index); display(index);
} // valueChanged } // valueChanged
@ -569,15 +569,7 @@ public class WFActivity extends CPanel
{ {
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
// //
/* if (e.getSource() == bNext || e.getSource() == bPrevious) if (e.getSource() == bZoom)
{
if (e.getSource() == bNext)
m_index++;
else
m_index--;
display();
}
else */ if (e.getSource() == bZoom)
cmd_zoom(); cmd_zoom();
else if (e.getSource() == bOK) else if (e.getSource() == bOK)
cmd_OK(); cmd_OK();