IDEMPIERE-2544:to more warning compiler hidden good warning

generic type warning
This commit is contained in:
hieplq 2015-03-29 14:45:41 +07:00
parent bbebc1ba45
commit 71e60b3f41
67 changed files with 281 additions and 279 deletions

View File

@ -37,8 +37,8 @@ import org.compiere.util.ValueNamePair;
* @author Jorg Janke
* @version $Id: Lookup.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $
*/
public abstract class Lookup extends AbstractListModel
implements MutableComboBoxModel, Serializable
public abstract class Lookup extends AbstractListModel<Object>
implements MutableComboBoxModel<Object>, Serializable
{
/**
*

View File

@ -1180,7 +1180,7 @@ public class ConfigurationData
if (p_panel != null)
{
String[] databases = m_databaseConfig[index].discoverDatabases(selected);
DefaultComboBoxModel model = new DefaultComboBoxModel(databases);
DefaultComboBoxModel<Object> model = new DefaultComboBoxModel<Object>(databases);
p_panel.fDatabaseDiscovered.setModel(model);
p_panel.fDatabaseDiscovered.setEnabled(databases.length != 0);
if (databases.length > 0)

View File

@ -126,7 +126,7 @@ public class ConfigurationPanel extends JPanel implements ActionListener, IDBCon
JCheckBox okSSLPort = new JCheckBox();
// Database
private JLabel lDatabaseType = new JLabel();
JComboBox fDatabaseType = new JComboBox(ConfigurationData.DBTYPE);
JComboBox<Object> fDatabaseType = new JComboBox<Object>(ConfigurationData.DBTYPE);
//
JLabel lDatabaseServer = new JLabel();
JLabel ldbExists = new JLabel();
@ -134,7 +134,7 @@ public class ConfigurationPanel extends JPanel implements ActionListener, IDBCon
private JLabel lDatabaseName = new JLabel();
JTextField fDatabaseName = new JTextField(FIELDLENGTH);
private JLabel lDatabaseDiscovered = new JLabel();
JComboBox fDatabaseDiscovered = new JComboBox();
JComboBox<Object> fDatabaseDiscovered = new JComboBox<Object>();
private JLabel lDatabasePort = new JLabel();
JTextField fDatabasePort = new JTextField(FIELDLENGTH);
private JLabel lSystemPassword = new JLabel();

View File

@ -42,7 +42,7 @@ public class JasperReportViewer extends JRViewer {
@SuppressWarnings("unused")
private JasperViewer jasperViewer;
private JasperPrint jasperPrint;
private JComboBox comboBox;
private JComboBox<Object> comboBox;
public JasperReportViewer(final JasperViewer jasperViewer, final JasperPrint jasperPrint) throws JRException {
super( jasperPrint);
@ -69,7 +69,7 @@ public class JasperReportViewer extends JRViewer {
btnExport.addActionListener( new ExportListener( this));
tlbToolBar.add(btnExport);
comboBox = new JComboBox( new String[] {"PDF","HTML", "XLS"});
comboBox = new JComboBox<Object>( new String[] {"PDF","HTML", "XLS"});
comboBox.setPreferredSize(new java.awt.Dimension(80, 23));
comboBox.setMaximumSize(new java.awt.Dimension(80, 23));
comboBox.setMinimumSize(new java.awt.Dimension(80, 23));

View File

@ -708,7 +708,7 @@ public class ReportStarter implements ProcessCall, ClientProcess
LocalJasperReportsContext ljrContext = new LocalJasperReportsContext(jrContext);
ljrContext.setClassLoader(this.getClass().getClassLoader());
JRExporter exporter = null;
JRExporter<?, ?, ?, ?> exporter = null;
if (ext.equals("pdf"))
exporter = new JRPdfExporter(ljrContext);
else if (ext.equals("ps"))

View File

@ -69,9 +69,9 @@ public class PDFViewerBean extends JPanel {
private final JScrollPane center = new JScrollPane(decoder);
private final JTextField pageField = new JTextField(2);
private final JLabel pageCountLabel = new JLabel("00");
private final JComboBox rotationSelect = new JComboBox(new String[] {
private final JComboBox<Object> rotationSelect = new JComboBox<Object>(new String[] {
"0", "90", "180", "270"});
private final JComboBox zoomSelect;
private final JComboBox<Object> zoomSelect;
private final float[] zoomFactors = new float[] {
0.25f, 0.33f, 0.50f, 0.75f, 1.00f, 1.50f, 2.00f, 4.00f, 8.00f};
@ -197,7 +197,7 @@ public class PDFViewerBean extends JPanel {
for (int i = 0; i < zoomFactors.length; i++) {
zoomLabels[i] = Integer.toString((int) (zoomFactors[i] * 100));
}
zoomSelect = new JComboBox(zoomLabels);
zoomSelect = new JComboBox<Object>(zoomLabels);
zoomSelect.addActionListener(new ActionListener() {
private boolean isAdjusting = false;

View File

@ -40,7 +40,7 @@ public class AdempiereComboPopup extends BasicComboPopup
* Constructor
* @param combo
*/
public AdempiereComboPopup(JComboBox combo)
public AdempiereComboPopup(JComboBox<?> combo)
{
super(combo);
} // AdempiereComboPopup
@ -55,7 +55,7 @@ public class AdempiereComboPopup extends BasicComboPopup
public void show()
{
// Check ComboBox if popup should be displayed
if (comboBox instanceof CComboBox && !((CComboBox)comboBox).displayPopup())
if (comboBox instanceof CComboBox && !((CComboBox<?>)comboBox).displayPopup())
return;
// Check Field if popup should be displayed
if (comboBox instanceof CField && !((CField)comboBox).displayPopup())
@ -65,7 +65,7 @@ public class AdempiereComboPopup extends BasicComboPopup
/**
* Inform CComboBox and CField that Popup was hidden
* Inform CComboBox<Object> and CField that Popup was hidden
* @see CComboBox.hidingPopup
* @see CField.hidingPopup
*
@ -74,9 +74,9 @@ public class AdempiereComboPopup extends BasicComboPopup
super.hide();
// Inform ComboBox that popup was hidden
if (comboBox instanceof CComboBox)
(CComboBox)comboBox).hidingPopup();
(CComboBox<Object>)comboBox).hidingPopup();
else if (comboBox instanceof CComboBox)
(CComboBox)comboBox).hidingPopup();
(CComboBox<Object>)comboBox).hidingPopup();
} // hided
/**/

View File

@ -1295,7 +1295,7 @@ public final class AdempiereTabbedPaneUI extends MetalTabbedPaneUI {
}
private boolean requestFocusForVisibleComponent() {
private boolean requestFocusForVisibleComponentX() {
Component visibleComponent = getVisibleComponent();
if (visibleComponent.isFocusable()) {
visibleComponent.requestFocus();
@ -1580,7 +1580,7 @@ public final class AdempiereTabbedPaneUI extends MetalTabbedPaneUI {
}
}
if (shouldChangeFocus) {
if (!requestFocusForVisibleComponent()) {
if (!requestFocusForVisibleComponentX()) {
tabPane.requestFocus();
}
}

View File

@ -185,12 +185,12 @@ public class PLAFEditor extends JDialog
private CButton bHelp = new CButton(); /** @todo Help Button */
private GridBagLayout northLayout = new GridBagLayout();
private CLabel lfLabel = new CLabel();
private CComboBox lfField = new CComboBox(AdempierePLAF.getPLAFs());
private CComboBox<Object>lfField = new CComboBox<Object>(AdempierePLAF.getPLAFs());
private CLabel themeLabel = new CLabel();
private CComboBox themeField = new CComboBox(AdempierePLAF.getThemes());
private CComboBox<Object>themeField = new CComboBox<Object>(AdempierePLAF.getThemes());
private FlowLayout southLayout = new FlowLayout();
private CButton rButton = new CButton();
private CComboBox blindField = new CComboBox(ColorBlind.COLORBLIND_TYPE);
private CComboBox<Object>blindField = new CComboBox<Object>(ColorBlind.COLORBLIND_TYPE);
private CLabel blindLabel = new CLabel();
private BorderLayout mainLayout = new BorderLayout();
//
@ -204,12 +204,12 @@ public class PLAFEditor extends JDialog
private JRadioButton jRadioButton1 = new JRadioButton();
private CButton jButton1 = new CButton();
private CToggleButton jToggleButton1 = new CToggleButton();
private CComboBox jComboBox1 = new CComboBox(s_columns);
private CComboBox<Object>jComboBox1 = new CComboBox<Object>(s_columns);
private JTextArea jTextArea1 = new JTextArea();
private JTextPane jTextPane1 = new JTextPane();
private JEditorPane jEditorPane1 = new JEditorPane();
private JPasswordField jPasswordField1 = new JPasswordField();
private JList jList1 = new JList(s_columns);
private JList<Object> jList1 = new JList<Object>(s_columns);
private JSplitPane jSplitPane1 = new JSplitPane();
private BorderLayout borderLayout1 = new BorderLayout();
private JScrollPane jScrollPane1 = new JScrollPane();
@ -225,16 +225,16 @@ public class PLAFEditor extends JDialog
private CButton jButtonGardient = new CButton();
private JButton jButtonTexture = new JButton();
private CButton jButtonLines = new CButton();
private JComboBox jComboBoxFlat = new JComboBox(s_pos);
private JComboBox<Object> jComboBoxFlat = new JComboBox<Object>(s_pos);
private JTextField jTextFieldFlat = new JTextField();
private JLabel jLabelFlat = new JLabel();
private CComboBox jComboBoxGradient = new CComboBox(s_pos);
private CComboBox<Object>jComboBoxGradient = new CComboBox<Object>(s_pos);
private CTextField jTextFieldGradient = new CTextField();
private CLabel jLabelGradient = new CLabel();
private JComboBox jComboBoxTexture = new JComboBox(s_pos);
private JComboBox<Object> jComboBoxTexture = new JComboBox<Object>(s_pos);
private JTextField jTextFieldTexture = new JTextField();
private JLabel jLabelTexture = new JLabel();
private CComboBox jComboBoxLines = new CComboBox(s_pos);
private CComboBox<Object>jComboBoxLines = new CComboBox<Object>(s_pos);
private CTextField jTextFieldLines = new CTextField();
private CLabel jLabelLines = new CLabel();
private CCheckBox jCheckBoxLines = new CCheckBox();
@ -443,7 +443,7 @@ public class PLAFEditor extends JDialog
MetalTheme metalTheme = null;
ValueNamePair theme = null;
boolean metal = UIManager.getLookAndFeel() instanceof MetalLookAndFeel;
themeField.setModel(new DefaultComboBoxModel(AdempierePLAF.getThemes()));
themeField.setModel(new DefaultComboBoxModel<Object>(AdempierePLAF.getThemes()));
if (metal)
{
theme = null;
@ -552,7 +552,7 @@ public class PLAFEditor extends JDialog
if (!m_setting)
{
m_setting = true;
int index = ((JComboBox)e.getSource()).getSelectedIndex();
int index = ((JComboBox<?>)e.getSource()).getSelectedIndex();
example.setTabPlacement(index+1);
jComboBoxFlat.setSelectedIndex(index);
jComboBoxGradient.setSelectedIndex(index);

View File

@ -85,8 +85,8 @@ public class PLAFEditorPanel extends CPanel {
{"-l0-", "-l1-"}};
private PreviewPanel previewPanel = new PreviewPanel();
private JList lookList = new JList(AdempierePLAF.getPLAFs());
private JList themeList = new JList();
private JList<Object> lookList = new JList<Object>(AdempierePLAF.getPLAFs());
private JList<Object> themeList = new JList<Object>();
/**
* Instance variable to disable list event handling when updating list with value
@ -271,12 +271,12 @@ public class PLAFEditorPanel extends CPanel {
CTabbedPane tab = new CTabbedPane();
column3.add(tab, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5,2,2,5),0,0));
CComboBox editable = new CComboBox(new Object[]{"Editable"});
CComboBox<Object> editable = new CComboBox<Object>(new Object[]{"Editable"});
editable.setEditable(true);
editable.setFocusable(false);
column3.add(editable, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,2,5,2),0,0));
CComboBox choice = new CComboBox(new Object[]{"Choice"});
CComboBox<Object> choice = new CComboBox<Object>(new Object[]{"Choice"});
choice.setEditable(false);
choice.setFocusable(false);
column3.add(choice, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
@ -332,7 +332,7 @@ public class PLAFEditorPanel extends CPanel {
MetalTheme metalTheme = null;
ValueNamePair theme = null;
boolean metal = UIManager.getLookAndFeel() instanceof MetalLookAndFeel;
themeList.setModel(new DefaultComboBoxModel(AdempierePLAF.getThemes()));
themeList.setModel(new DefaultComboBoxModel<Object>(AdempierePLAF.getThemes()));
if (metal)
{
theme = null;

View File

@ -154,21 +154,21 @@ public class AcctViewer extends CFrame
// private CPanel graphPanel = new CPanel();
private CCheckBox displayDocumentInfo = new CCheckBox();
private CLabel lSort = new CLabel();
private CComboBox sortBy1 = new CComboBox();
private CComboBox sortBy2 = new CComboBox();
private CComboBox sortBy3 = new CComboBox();
private CComboBox<Object> sortBy1 = new CComboBox<Object>();
private CComboBox<Object> sortBy2 = new CComboBox<Object>();
private CComboBox<Object> sortBy3 = new CComboBox<Object>();
private CCheckBox group1 = new CCheckBox();
private CCheckBox group2 = new CCheckBox();
private CCheckBox group3 = new CCheckBox();
private CLabel lGroup = new CLabel();
private GridBagLayout selectionLayout = new GridBagLayout();
private CComboBox selAcctSchema = new CComboBox();
private CComboBox selPostingType = new CComboBox();
private CComboBox<Object> selAcctSchema = new CComboBox<Object>();
private CComboBox<Object> selPostingType = new CComboBox<Object>();
private CCheckBox selDocument = new CCheckBox();
private CComboBox selTable = new CComboBox();
private CComboBox<Object> selTable = new CComboBox<Object>();
private CButton selRecord = new CButton();
private CLabel lOrg = new CLabel();
private CComboBox selOrg = new CComboBox();
private CComboBox<Object> selOrg = new CComboBox<Object>();
private CLabel lAcct = new CLabel();
private CButton selAcct = new CButton();
private CLabel lDate = new CLabel();
@ -195,7 +195,7 @@ public class AcctViewer extends CFrame
//
private CButton bRePost = new CButton();
private CCheckBox forcePost = new CCheckBox();
private CComboBox sortBy4 = new CComboBox();
private CComboBox<Object> sortBy4 = new CComboBox<Object>();
private CCheckBox group4 = new CCheckBox();
/**

View File

@ -158,9 +158,9 @@ class AcctViewerData
/**************************************************************************
* Fill Accounting Schema
* @param cb JComboBox to be filled
* @param cb JComboBox<Object> to be filled
*/
protected void fillAcctSchema (JComboBox cb)
protected void fillAcctSchema (JComboBox<Object> cb)
{
for (int i = 0; i < ASchemas.length; i++)
cb.addItem(new KeyNamePair(ASchemas[i].getC_AcctSchema_ID(),
@ -169,9 +169,9 @@ class AcctViewerData
/**
* Fill Posting Type
* @param cb JComboBox to be filled
* @param cb JComboBox<Object> to be filled
*/
protected void fillPostingType (JComboBox cb)
protected void fillPostingType (JComboBox<Object> cb)
{
int AD_Reference_ID = REFERENCE_POSTING_TYPE;
ValueNamePair[] pt = MRefList.getList(Env.getCtx(), AD_Reference_ID, true);
@ -185,9 +185,9 @@ class AcctViewerData
* and tableInfo with (TableName, AD_Table_ID)
* and select the entry for AD_Table_ID
*
* @param cb JComboBox to be filled
* @param cb JComboBox<Object> to be filled
*/
protected void fillTable (JComboBox cb)
protected void fillTable (JComboBox<Object> cb)
{
ValueNamePair select = null;
//
@ -231,9 +231,9 @@ class AcctViewerData
/**
* Fill Org
*
* @param cb JComboBox to be filled
* @param cb JComboBox<Object> to be filled
*/
protected void fillOrg (JComboBox cb)
protected void fillOrg (JComboBox<Object> cb)
{
KeyNamePair pp = new KeyNamePair(0, "");
cb.addItem(pp);

View File

@ -136,7 +136,7 @@ public final class Attachment extends CDialog
private CPanel toolBar = new CPanel(new FlowLayout(FlowLayout.LEADING, 5,5));
private CButton bDelete = new CButton();
private CButton bDeleteAll = null;
private CComboBox cbContent = new CComboBox();
private CComboBox<Object> cbContent = new CComboBox<Object>();
private JSplitPane centerPane = new JSplitPane();
//
private CPanel graphPanel = new CPanel(new BorderLayout());

View File

@ -140,7 +140,7 @@ public final class Preference extends CDialog
private CPanel southPanel = new CPanel();
private BorderLayout southLayout = new BorderLayout();
private BorderLayout icontextLayout = new BorderLayout();
private JList infoList = new JList();
private JList<Object> infoList = new JList<Object>();
private JScrollPane contextListScrollPane = new JScrollPane(infoList);
private CPanel contextSouthPanel = new CPanel();
private CTextArea contextHeader = new CTextArea(4,15);
@ -149,7 +149,7 @@ public final class Preference extends CDialog
private BorderLayout contextSouthLayout = new BorderLayout();
private StatusBar statusBar = new StatusBar();
private ConfirmPanel confirm = new ConfirmPanel(true);
private CComboBox traceLevel = new CComboBox(CLogMgt.LEVELS);
private CComboBox<Object>traceLevel = new CComboBox<Object>(CLogMgt.LEVELS);
private CLabel traceLabel = new CLabel();
private CCheckBox traceFile = new CCheckBox();
private CCheckBox autoLogin = new CCheckBox();
@ -175,7 +175,7 @@ public final class Preference extends CDialog
private CButton bRoleInfo = new CButton(Msg.translate(Env.getCtx(), "AD_Role_ID"));
// Charset:
private CLabel lCharset = new CLabel();
private CComboBox fCharset = new CComboBox(Ini.getAvailableCharsets());
private CComboBox<Object>fCharset = new CComboBox<Object>(Ini.getAvailableCharsets());
private CPanel configPanel = new CPanel();

View File

@ -206,7 +206,7 @@ public class ProcessDialog extends CFrame
private ProcessParameterPanel parameterPanel = null;
private JSeparator separator = new JSeparator();
private ProcessInfo m_pi = null;
private CComboBox fSavedName = new CComboBox();
private CComboBox<Object>fSavedName = new CComboBox<Object>();
private CButton bSave = new CButton();
private CButton bDelete = new CButton();
private List<MPInstance> savedParams;
@ -388,7 +388,7 @@ public class ProcessDialog extends CFrame
{
queries[i++] = instance.getName();
}
fSavedName.setModel(new DefaultComboBoxModel(queries));
fSavedName.setModel(new DefaultComboBoxModel<Object>(queries));
fSavedName.setValue("");
}

View File

@ -99,9 +99,9 @@ public class ArchiveViewer extends Archive
private CPanel queryPanel = new CPanel(new GridBagLayout());
private CCheckBox reportField = new CCheckBox(Msg.translate(Env.getCtx(), "IsReport"));
private CLabel processLabel = new CLabel(Msg.translate(Env.getCtx(), "AD_Process_ID"));
private CComboBox processField = null;
private CComboBox<Object> processField = null;
private CLabel tableLabel = new CLabel(Msg.translate(Env.getCtx(), "AD_Table_ID"));
private CComboBox tableField = null;
private CComboBox<Object> tableField = null;
private CLabel bPartnerLabel = new CLabel(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
private VLookup bPartnerField = null;
private CLabel nameQLabel = new CLabel(Msg.translate(Env.getCtx(), "Name"));
@ -111,7 +111,7 @@ public class ArchiveViewer extends Archive
private CLabel helpQLabel = new CLabel(Msg.translate(Env.getCtx(), "Help"));
private CTextField helpQField = new CTextField(15);
private CLabel createdByQLabel = new CLabel(Msg.translate(Env.getCtx(), "CreatedBy"));
private CComboBox createdByQField = null;
private CComboBox<Object> createdByQField = null;
private CLabel createdQLabel = new CLabel(Msg.translate(Env.getCtx(), "Created"));
private VDate createdQFrom = new VDate();
private VDate createdQTo = new VDate();
@ -143,9 +143,9 @@ public class ArchiveViewer extends Archive
*/
private void dynInit()
{
processField = new CComboBox(getProcessData());
tableField = new CComboBox(getTableData());
createdByQField = new CComboBox(getUserData());
processField = new CComboBox<Object>(getProcessData());
tableField = new CComboBox<Object>(getTableData());
createdByQField = new CComboBox<Object>(getUserData());
//
bPartnerField = VLookup.createBPartner(m_WindowNo);
} // dynInit

View File

@ -103,10 +103,10 @@ public class VAttributeGrid extends CPanel
vector.add(new KeyNamePair(0,""));
for (int i = 0; i < m_attributes.length; i++)
vector.add(m_attributes[i].getKeyNamePair());
attributeCombo1 = new CComboBox(vector);
attributeCombo1 = new CComboBox<KeyNamePair>(vector);
selectPanel.add(attributeCombo1, null);
selectPanel.add(attributeLabel2, new ALayoutConstraint(1,0));
attributeCombo2 = new CComboBox(vector);
attributeCombo2 = new CComboBox<KeyNamePair>(vector);
selectPanel.add(attributeCombo2, null);
//
fillPicks();
@ -157,9 +157,9 @@ public class VAttributeGrid extends CPanel
private CTabbedPane tabbedPane = new CTabbedPane();
private CPanel selectPanel = new CPanel(new ALayout());
private CLabel attributeLabel1 = new CLabel(Msg.getElement(Env.getCtx(), "M_Attribute_ID") + " 1");
private CComboBox attributeCombo1 = null;
private CComboBox<KeyNamePair> attributeCombo1 = null;
private CLabel attributeLabel2 = new CLabel(Msg.getElement(Env.getCtx(), "M_Attribute_ID") + " 2");
private CComboBox attributeCombo2 = null;
private CComboBox<KeyNamePair> attributeCombo2 = null;
private CLabel labelPriceList = new CLabel(Msg.getElement(Env.getCtx(), "M_PriceList_ID"));
private VComboBox pickPriceList = new VComboBox();
private CLabel labelWarehouse = new CLabel(Msg.getElement(Env.getCtx(), "M_Warehouse_ID"));
@ -169,7 +169,7 @@ public class VAttributeGrid extends CPanel
private CPanel gridPanel = new CPanel(new BorderLayout());
private CPanel modePanel = new CPanel();
private CLabel modeLabel = new CLabel(Msg.getMsg(Env.getCtx(), "Mode"));
private CComboBox modeCombo = new CComboBox(MODES);
private CComboBox<Object> modeCombo = new CComboBox<Object>(MODES);
/**
* Dispose

View File

@ -169,11 +169,11 @@ public class VBOMDrop extends CPanel
//
private ConfirmPanel confirmPanel = new ConfirmPanel (true);
private CPanel selectionPanel = new CPanel(new ALayout());
private CComboBox productField;
private CComboBox<Object>productField;
private VNumber productQty = new VNumber("Qty", true, false, true, DisplayType.Quantity, Msg.translate(Env.getCtx(), "Qty"));
private CComboBox orderField;
private CComboBox invoiceField;
private CComboBox projectField;
private CComboBox<Object>orderField;
private CComboBox<Object>invoiceField;
private CComboBox<Object>projectField;
/**************************************************************************
@ -186,7 +186,7 @@ public class VBOMDrop extends CPanel
{
int row = 0;
selectionPanel.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "Selection")));
productField = new CComboBox(getProducts());
productField = new CComboBox<Object>(getProducts());
CLabel label = new CLabel(Msg.translate(Env.getCtx(), "M_Product_ID"));
label.setLabelFor(productField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
@ -202,7 +202,7 @@ public class VBOMDrop extends CPanel
if (order)
{
orderField = new CComboBox(getOrders());
orderField = new CComboBox<Object>(getOrders());
label = new CLabel (Msg.translate(Env.getCtx(), "C_Order_ID"));
label.setLabelFor(orderField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
@ -211,7 +211,7 @@ public class VBOMDrop extends CPanel
}
if (invoice)
{
invoiceField = new CComboBox(getInvoices());
invoiceField = new CComboBox<Object>(getInvoices());
label = new CLabel (Msg.translate(Env.getCtx(), "C_Invoice_ID"));
label.setLabelFor(invoiceField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
@ -220,7 +220,7 @@ public class VBOMDrop extends CPanel
}
if (project)
{
projectField = new CComboBox(getProjects());
projectField = new CComboBox<Object>(getProjects());
label = new CLabel (Msg.translate(Env.getCtx(), "C_Project_ID"));
label.setLabelFor(projectField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));

View File

@ -127,7 +127,7 @@ public class VFileImport extends CPanel
//
private CPanel northPanel = new CPanel();
private JButton bFile = new JButton();
private JComboBox pickFormat = new JComboBox();
private JComboBox<Object> pickFormat = new JComboBox<Object>();
private CPanel centerPanel = new CPanel();
private BorderLayout centerLayout = new BorderLayout();
private JScrollPane rawDataPane = new JScrollPane();
@ -141,7 +141,7 @@ public class VFileImport extends CPanel
private JButton bNext = new JButton();
private JButton bPrevious = new JButton();
private JLabel record = new JLabel();
private CComboBox fCharset = new CComboBox(Ini.getAvailableCharsets());
private CComboBox<Object>fCharset = new CComboBox<Object>(Ini.getAvailableCharsets());
/**
* Static Init

View File

@ -143,11 +143,11 @@ public class VMatch extends Match
private CPanel northPanel = new CPanel();
private GridBagLayout northLayout = new GridBagLayout();
private CLabel matchFromLabel = new CLabel();
private CComboBox matchFrom = new CComboBox(m_matchOptions);
private CComboBox<Object>matchFrom = new CComboBox<Object>(m_matchOptions);
private CLabel matchToLabel = new CLabel();
private CComboBox matchTo = new CComboBox();
private CComboBox<String>matchTo = new CComboBox<String>();
private CLabel matchModeLabel = new CLabel();
private CComboBox matchMode = new CComboBox(m_matchMode);
private CComboBox<Object>matchMode = new CComboBox<Object>(m_matchMode);
private VLookup onlyVendor = null;
private VLookup onlyProduct = null;
private CLabel onlyVendorLabel = new CLabel();
@ -314,7 +314,7 @@ public class VMatch extends Match
sameProduct.addActionListener(this);
sameQty.addActionListener(this);
// Init
matchTo.setModel(new DefaultComboBoxModel(cmd_matchFrom((String)matchFrom.getSelectedItem())));
matchTo.setModel(new DefaultComboBoxModel<String>(cmd_matchFrom((String)matchFrom.getSelectedItem())));
// Set Title
xMatchedBorder.setTitle((String)matchFrom.getSelectedItem());
xMatchedScrollPane.repaint();
@ -350,7 +350,7 @@ public class VMatch extends Match
Timestamp to = dateTo.getValue()!=null?(Timestamp)dateTo.getValue():null;
if (e.getSource() == matchFrom) {
String selection = (String)matchFrom.getSelectedItem();
matchTo.setModel(new DefaultComboBoxModel(cmd_matchFrom(selection)));
matchTo.setModel(new DefaultComboBoxModel<String>(cmd_matchFrom(selection)));
// Set Title
xMatchedBorder.setTitle(selection);
xMatchedScrollPane.repaint();

View File

@ -111,7 +111,7 @@ public class VPayPrint extends PayPrint implements FormPanel, ActionListener, Ve
private CLabel lBank = new CLabel();
private CLabel fBank = new CLabel();
private CLabel lPaymentRule = new CLabel();
private CComboBox fPaymentRule = new CComboBox();
private CComboBox<Object>fPaymentRule = new CComboBox<Object>();
private CLabel lDocumentNo = new CLabel();
private VNumber fDocumentNo = new VNumber();
private CLabel lNoPayments = new CLabel();

View File

@ -111,7 +111,7 @@ public class VSetup extends CPanel
private JTextField fOrgName = new JTextField();
private JTextField fOrgValue = new JTextField();
private JLabel lCurrency = new JLabel();
private JComboBox fCurrency = new JComboBox();
private JComboBox<Object> fCurrency = new JComboBox<Object>();
private JLabel lUserClient = new JLabel();
private JTextField fUserClient = new JTextField();
private JLabel lUserOrg = new JLabel();
@ -125,10 +125,10 @@ public class VSetup extends CPanel
private JButton buttonLoadAcct = new JButton();
private JLabel lCountry = new JLabel();
private JLabel lCity = new JLabel();
private JComboBox fCountry = new JComboBox();
private JComboBox<Object> fCountry = new JComboBox<Object>();
private JTextField fCity = new JTextField();
private JLabel lRegion = new JLabel();
private JComboBox fRegion = new JComboBox();
private JComboBox<Object> fRegion = new JComboBox<Object>();
/**
* Static Init

View File

@ -65,7 +65,7 @@ public class VTreeMaintenance extends TreeMaintenance
private CPanel northPanel = new CPanel ();
private FlowLayout northLayout = new FlowLayout ();
private CLabel treeLabel = new CLabel ();
private CComboBox treeField;
private CComboBox<Object> treeField;
private CButton bAddAll = new CButton (Env.getImageIcon("FastBack24.gif"));
private CButton bAdd = new CButton (Env.getImageIcon("StepBack24.gif"));
private CButton bDelete = new CButton (Env.getImageIcon("StepForward24.gif"));
@ -75,7 +75,7 @@ public class VTreeMaintenance extends TreeMaintenance
//
private JSplitPane splitPane = new JSplitPane ();
private VTreePanel centerTree;
private JList centerList = new JList ();
private JList<Object> centerList = new JList<Object> ();
/**
@ -107,7 +107,7 @@ public class VTreeMaintenance extends TreeMaintenance
*/
private void preInit()
{
treeField = new CComboBox(getTreeData());
treeField = new CComboBox<Object>(getTreeData());
treeField.addActionListener(this);
//
centerTree = new VTreePanel (m_WindowNo, false, true);
@ -191,7 +191,7 @@ public class VTreeMaintenance extends TreeMaintenance
if (log.isLoggable(Level.INFO)) log.info("Tree=" + tree);
if (tree.getKey() <= 0)
{
centerList.setModel(new DefaultListModel());
centerList.setModel(new DefaultListModel<Object>());
return;
}
// Tree
@ -204,7 +204,7 @@ public class VTreeMaintenance extends TreeMaintenance
//
// List
DefaultListModel model = new DefaultListModel();
DefaultListModel<Object> model = new DefaultListModel<Object>();
ArrayList<ListItem> items = getTreeItemData();
for(ListItem item : items)
model.addElement(item);
@ -247,7 +247,7 @@ public class VTreeMaintenance extends TreeMaintenance
if (tn == null)
return;
if (log.isLoggable(Level.INFO)) log.info(tn.toString());
ListModel model = centerList.getModel();
ListModel<Object> model = centerList.getModel();
int size = model.getSize();
int index = -1;
for (index = 0; index < size; index++)
@ -300,7 +300,7 @@ public class VTreeMaintenance extends TreeMaintenance
{
if (ADialog.ask(m_WindowNo, null, "TreeAddAllItems")) { // idempiere-85
log.info("");
ListModel model = centerList.getModel();
ListModel<Object> model = centerList.getModel();
int size = model.getSize();
int index = -1;
for (index = 0; index < size; index++)
@ -318,7 +318,7 @@ public class VTreeMaintenance extends TreeMaintenance
{
if (ADialog.ask(m_WindowNo, null, "TreeRemoveAllItems")) { // idempiere-85
log.info("");
ListModel model = centerList.getModel();
ListModel<Object> model = centerList.getModel();
int size = model.getSize();
int index = -1;
for (index = 0; index < size; index++)

View File

@ -83,7 +83,9 @@ import org.compiere.model.MQuery;
import org.compiere.model.MRole;
import org.compiere.model.MTable;
import org.compiere.model.MUserQuery;
import static org.compiere.model.SystemIDs.*;
import org.compiere.model.X_AD_Column;
import org.compiere.swing.CButton;
import org.compiere.swing.CComboBox;
@ -222,7 +224,7 @@ public final class Find extends CDialog
private ConfirmPanel confirmPanelA = new ConfirmPanel(true, true, false, false, false, false, true);
private CButton bIgnore = new CButton();
private JToolBar toolBar = new JToolBar();
private CComboBoxEditable fQueryName = new CComboBoxEditable();
private CComboBoxEditable<Object> fQueryName = new CComboBoxEditable<Object>();
private CButton bSave = new CButton();
private CButton bNew = new CButton();
private CButton bDelete = new CButton();
@ -311,17 +313,17 @@ public final class Find extends CDialog
public static final int INDEX_RIGHTBRACKET = 6;
/** Advanced Search Column */
public CComboBox columns = null;
/** Advanced Search Operators */
public CComboBox operators = null;
public CComboBox<ValueNamePair> columns = null;
public CComboBox<Object> operators = null;
private MUserQuery[] userQueries;
private ValueNamePair[] columnValueNamePairs;
private CComboBox leftBrackets;
private CComboBox<Object> leftBrackets;
private CComboBox rightBrackets;
private CComboBox<Object> rightBrackets;
private CComboBox andOr;
private CComboBox<Object> andOr;
private static final String FIELD_SEPARATOR = "<^>";
private static final String SEGMENT_SEPARATOR = "<~>";
@ -682,7 +684,7 @@ public final class Find extends CDialog
columnValueNamePairs = new ValueNamePair[items.size()];
items.toArray(columnValueNamePairs);
Arrays.sort(columnValueNamePairs); // sort alpha
columns = new CComboBox(columnValueNamePairs);
columns = new CComboBox<ValueNamePair>(columnValueNamePairs);
columns.addActionListener(this);
TableColumn tc = advancedTable.getColumnModel().getColumn(INDEX_COLUMNNAME);
tc.setPreferredWidth(120);
@ -710,7 +712,7 @@ public final class Find extends CDialog
// 0 = And/Or
andOr = new CComboBox(new String[] {"",Msg.getMsg(Env.getCtx(),"AND"),Msg.getMsg(Env.getCtx(), "OR")});
andOr = new CComboBox<Object>(new String[] {"",Msg.getMsg(Env.getCtx(),"AND"),Msg.getMsg(Env.getCtx(), "OR")});
tc = advancedTable.getColumnModel().getColumn(INDEX_ANDOR);
tc.setPreferredWidth(45);
dce = new FindCellEditor(andOr);
@ -718,7 +720,7 @@ public final class Find extends CDialog
tc.setHeaderValue(Msg.getMsg(Env.getCtx(), "And/Or"));
// 1 = Left Bracket
leftBrackets = new CComboBox(new String[] {"","(","((","((("});
leftBrackets = new CComboBox<Object>(new String[] {"","(","((","((("});
tc = advancedTable.getColumnModel().getColumn(INDEX_LEFTBRACKET);
tc.setPreferredWidth(25);
dce = new FindCellEditor(leftBrackets);
@ -726,7 +728,7 @@ public final class Find extends CDialog
tc.setHeaderValue("(");
// 3 = Operators
operators = new CComboBox(MQuery.OPERATORS);
operators = new CComboBox<Object>(MQuery.OPERATORS);
tc = advancedTable.getColumnModel().getColumn(INDEX_OPERATOR);
tc.setPreferredWidth(55);
dce = new FindCellEditor(operators);
@ -750,7 +752,7 @@ public final class Find extends CDialog
tc.setHeaderValue(Msg.getMsg(Env.getCtx(), "QueryValue2"));
// 6 = Right Bracket
rightBrackets = new CComboBox(new String[] {"",")","))",")))"});
rightBrackets = new CComboBox<Object>(new String[] {"",")","))",")))"});
tc = advancedTable.getColumnModel().getColumn(INDEX_RIGHTBRACKET);
tc.setPreferredWidth(25);
dce = new FindCellEditor(rightBrackets);
@ -766,7 +768,7 @@ public final class Find extends CDialog
String[] queries = new String[userQueries.length];
for (int i = 0; i < userQueries.length; i++)
queries[i] = userQueries[i].getName();
fQueryName.setModel(new DefaultComboBoxModel(queries));
fQueryName.setModel(new DefaultComboBoxModel<Object>(queries));
fQueryName.setValue("");
// No Row - Create one
@ -854,17 +856,17 @@ public final class Find extends CDialog
|| DisplayType.YesNo == referenceType
|| DisplayType.Button == referenceType)
{
operators.setModel(new DefaultComboBoxModel(MQuery.OPERATORS_LOOKUP));
operators.setModel(new DefaultComboBoxModel<Object>(MQuery.OPERATORS_LOOKUP));
}
else if (DisplayType.isNumeric(referenceType)
|| DisplayType.isDate(referenceType)
|| DisplayType.isID(referenceType)) // Note that lookups were filtered above
{
operators.setModel(new DefaultComboBoxModel(MQuery.OPERATORS_NUMBERS));
operators.setModel(new DefaultComboBoxModel<Object>(MQuery.OPERATORS_NUMBERS));
}
else // DisplayType.isText
{
operators.setModel(new DefaultComboBoxModel(MQuery.OPERATORS));
operators.setModel(new DefaultComboBoxModel<Object>(MQuery.OPERATORS));
}
}
}
@ -1311,7 +1313,7 @@ public final class Find extends CDialog
String[] queries = new String[userQueries.length];
for (int i = 0; i < userQueries.length; i++)
queries[i] = userQueries[i].getName();
fQueryName.setModel(new DefaultComboBoxModel(queries));
fQueryName.setModel(new DefaultComboBoxModel<Object>(queries));
fQueryName.setSelectedItem(selected);
if (fQueryName.getSelectedIndex() < 0)
fQueryName.setValue("");

View File

@ -118,8 +118,8 @@ public final class FindCellEditor extends AbstractCellEditor
// Other UI
((JComponent)m_editor).setFont(table.getFont());
if ( m_editor instanceof JComboBox) {
((JComboBox)m_editor).setBorder(BorderFactory.createEmptyBorder());
if ( m_editor instanceof JComboBox<?>) {
((JComboBox<?>)m_editor).setBorder(BorderFactory.createEmptyBorder());
} else {
((JComponent)m_editor).setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
}

View File

@ -124,9 +124,9 @@ public class InfoSchedule extends CDialog
private CPanel parameterPanel = new CPanel();
private GridBagLayout parameterLayout = new GridBagLayout();
private JLabel labelResourceType = new JLabel();
private JComboBox fieldResourceType = new JComboBox();
private JComboBox<Object> fieldResourceType = new JComboBox<Object>();
private JLabel labelResource = new JLabel();
private JComboBox fieldResource = new JComboBox();
private JComboBox<Object> fieldResource = new JComboBox<Object>();
private JButton bPrevious = new JButton();
private JLabel labelDate = new JLabel();
private VDate fieldDate = new VDate();

View File

@ -164,7 +164,7 @@ public class WFActivity extends CPanel
private CLabel lAnswer = new CLabel(Msg.getMsg(Env.getCtx(), "Answer"));
private CPanel answers = new CPanel(new FlowLayout(FlowLayout.LEADING));
private CTextField fAnswerText = new CTextField();
private CComboBox fAnswerList = new CComboBox();
private CComboBox<Object>fAnswerList = new CComboBox<Object>();
private CButton fAnswerButton = new CButton();
// private CButton bPrevious = AEnv.getButton("Previous");
// private CButton bNext = AEnv.getButton("Next");
@ -535,13 +535,13 @@ public class WFActivity extends CPanel
if (dt == DisplayType.YesNo)
{
ValueNamePair[] values = MRefList.getList(Env.getCtx(), 319, false); // _YesNo
fAnswerList.setModel(new DefaultComboBoxModel(values));
fAnswerList.setModel(new DefaultComboBoxModel<Object>(values));
fAnswerList.setVisible(true);
}
else if (dt == DisplayType.List)
{
ValueNamePair[] values = MRefList.getList(Env.getCtx(), m_column.getAD_Reference_Value_ID(), false);
fAnswerList.setModel(new DefaultComboBoxModel(values));
fAnswerList.setModel(new DefaultComboBoxModel<Object>(values));
fAnswerList.setVisible(true);
}
else // other display types come here

View File

@ -164,7 +164,7 @@ public class WFPanel extends CPanel
private JButton wfEnd = new JButton();
//
private CPanel loadPanel = new CPanel(new FlowLayout(FlowLayout.LEADING));
private CComboBox workflow = new CComboBox();
private CComboBox<Object>workflow = new CComboBox<Object>();
private CButton bResetLayout = AEnv.getButton("Reset");
private CButton bSaveLayout = AEnv.getButton ("Save");
private CButton bZoom = AEnv.getButton("Zoom");
@ -276,7 +276,7 @@ public class WFPanel extends CPanel
"AD_Workflow", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); // all
KeyNamePair[] pp = DB.getKeyNamePairs(sql, true);
//
workflow = new CComboBox(pp);
workflow = new CComboBox<Object>(pp);
loadPanel.add(workflow);
workflow.addActionListener(this);
//

View File

@ -125,7 +125,7 @@ public class CConnectionDialog extends CDialog implements ActionListener
private CTextField fwPortField = new CTextField();
private CButton bTestDB = new CButton();
private CLabel dbTypeLabel = new CLabel();
private CComboBox dbTypeField = new CComboBox(Database.getDatabaseNames());
private CComboBox<Object> dbTypeField = new CComboBox<Object>(Database.getDatabaseNames());
private CCheckBox cbBequeath = new CCheckBox();
private CLabel appsHostLabel = new CLabel();
private CTextField appsHostField = new CTextField();

View File

@ -98,7 +98,7 @@ public class ConvertDialog extends CFrame implements ActionListener
private JPanel parameterPanel = new JPanel();
private GridBagLayout gridBagLayout1 = new GridBagLayout();
private JLabel lSelectFile = new JLabel();
private JComboBox fSelectFile = new JComboBox();
private JComboBox<Object> fSelectFile = new JComboBox<Object>();
private JButton bSelectFile = new JButton();
private JCheckBox fExecute = new JCheckBox();
private JLabel lConnect = new JLabel();
@ -111,7 +111,7 @@ public class ConvertDialog extends CFrame implements ActionListener
private Component component3;
private Component component4;
private JLabel lTarget = new JLabel();
private JComboBox fTarget = new JComboBox(Database.getDatabaseNames());
private JComboBox<Object> fTarget = new JComboBox<Object>(Database.getDatabaseNames());
private JCheckBox fVerbose = new JCheckBox();
/**

View File

@ -94,7 +94,7 @@ public class RecordAccessDialog extends CDialog
private BorderLayout mainLayout = new BorderLayout();
private CLabel roleLabel = new CLabel(Msg.translate(Env.getCtx(), "AD_Role_ID"));
private CComboBox roleField = null;
private CComboBox<Object>roleField = null;
private CCheckBox cbActive = new CCheckBox(Msg.translate(Env.getCtx(), "IsActive"));
private CCheckBox cbExclude = new CCheckBox(Msg.translate(Env.getCtx(), "IsExclude"));
private CCheckBox cbReadOnly = new CCheckBox(Msg.translate(Env.getCtx(), "IsReadOnly"));
@ -117,7 +117,7 @@ public class RecordAccessDialog extends CDialog
String sql = MRole.getDefault().addAccessSQL(
"SELECT AD_Role_ID, Name FROM AD_Role ORDER BY 2",
"AD_Role", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
roleField = new CComboBox(DB.getKeyNamePairs(sql, false));
roleField = new CComboBox<Object>(DB.getKeyNamePairs(sql, false));
// Load Record Access for all roles
sql = "SELECT * FROM AD_Record_Access "

View File

@ -84,15 +84,15 @@ public class VCreateFromInvoiceUI extends CreateFromInvoice implements ActionLis
private VLookup bPartnerField;
private JLabel orderLabel = new JLabel();
private JComboBox orderField = new JComboBox();
private JComboBox<Object> orderField = new JComboBox<Object>();
private JLabel shipmentLabel = new JLabel();
private JComboBox shipmentField = new JComboBox();
private JComboBox<Object> shipmentField = new JComboBox<Object>();
/** Label for the rma selection */
private JLabel rmaLabel = new JLabel();
/** Combo box for selecting RMA document */
private JComboBox rmaField = new JComboBox();
private JComboBox<Object> rmaField = new JComboBox<Object>();
/**
* Dynamic Init

View File

@ -101,15 +101,15 @@ public class VCreateFromShipmentUI extends CreateFromShipment implements ActionL
private VLookup bPartnerField;
private JLabel orderLabel = new JLabel();
private JComboBox orderField = new JComboBox();
private JComboBox<Object> orderField = new JComboBox<Object>();
private JLabel invoiceLabel = new JLabel();
private JComboBox invoiceField = new JComboBox();
private JComboBox<Object> invoiceField = new JComboBox<Object>();
/** Label for the rma selection */
private JLabel rmaLabel = new JLabel();
/** Combo box for selecting RMA document */
private JComboBox rmaField = new JComboBox();
private JComboBox<Object> rmaField = new JComboBox<Object>();
private JLabel upcLabel = new JLabel();
private JTextField upcField = new JTextField();

View File

@ -46,11 +46,11 @@ public class VPaymentFormCash extends PaymentFormCash implements ActionListener
private VPaymentFormDialog dialog;
private CLabel bBankAccountLabel = new CLabel();
private CComboBox bBankAccountCombo = new CComboBox();
private CComboBox<Object>bBankAccountCombo = new CComboBox<Object>();
private CLabel bCashBookLabel = new CLabel();
private CComboBox bCashBookCombo = new CComboBox();
private CComboBox<Object>bCashBookCombo = new CComboBox<Object>();
private CLabel bCurrencyLabel = new CLabel();
private CComboBox bCurrencyCombo = new CComboBox();
private CComboBox<Object>bCurrencyCombo = new CComboBox<Object>();
private VDate bDateField;
private CLabel bDateLabel = new CLabel();
private CLabel bAmountLabel = new CLabel();

View File

@ -50,9 +50,9 @@ public class VPaymentFormCheck extends PaymentFormCheck implements ActionListene
private VPaymentFormDialog dialog;
private CLabel sBankAccountLabel = new CLabel();
private CComboBox sBankAccountCombo = new CComboBox();
private CComboBox<Object>sBankAccountCombo = new CComboBox<Object>();
private CLabel sCurrencyLabel = new CLabel();
private CComboBox sCurrencyCombo = new CComboBox();
private CComboBox<Object>sCurrencyCombo = new CComboBox<Object>();
private CLabel sAmountLabel = new CLabel();
private VNumber sAmountField = new VNumber();
private CLabel sRoutingLabel = new CLabel();

View File

@ -47,7 +47,7 @@ public class VPaymentFormCreditCard extends PaymentFormCreditCard implements Act
private VPaymentFormDialog dialog;
private CLabel kTypeLabel = new CLabel();
private CComboBox kTypeCombo = new CComboBox();
private CComboBox<Object>kTypeCombo = new CComboBox<Object>();
private CLabel kNumberLabel = new CLabel();
private CTextField kNumberField = new CTextField();
private CLabel kNameLabel = new CLabel();

View File

@ -43,7 +43,7 @@ public abstract class VPaymentFormDirect extends PaymentFormDirect implements Ac
private VPaymentFormDialog dialog;
private CLabel tAccountLabel = new CLabel();
private CComboBox tAccountCombo = new CComboBox();
private CComboBox<Object>tAccountCombo = new CComboBox<Object>();
private CButton tOnline = new CButton();
private CTextField tRoutingField = new CTextField();
private CTextField tNumberField = new CTextField();

View File

@ -35,7 +35,7 @@ public class VPaymentFormOnCredit extends PaymentFormOnCredit {
private VPaymentFormDialog dialog;
private CLabel pTermLabel = new CLabel();
private CComboBox pTermCombo = new CComboBox();
private CComboBox<Object>pTermCombo = new CComboBox<Object>();
public VPaymentFormOnCredit(int windowNo, GridTab mTab) {
super(windowNo, mTab);

View File

@ -128,7 +128,7 @@ public class VSortTab extends CPanel implements APanelTab
private CButton bUp = new CButton();
private CButton bDown = new CButton();
//
DefaultListModel noModel = new DefaultListModel()
DefaultListModel<Object> noModel = new DefaultListModel<Object>()
{
/**
*
@ -151,7 +151,7 @@ public class VSortTab extends CPanel implements APanelTab
addElement(obj);
}
};
DefaultListModel yesModel = new DefaultListModel();
DefaultListModel<Object> yesModel = new DefaultListModel<Object>();
DefaultListCellRenderer listRenderer = new DefaultListCellRenderer() {
/**
*
@ -159,7 +159,7 @@ public class VSortTab extends CPanel implements APanelTab
private static final long serialVersionUID = -101524191283634472L;
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value != null && value instanceof ListItem && !((ListItem)value).isUpdateable()) {
Font f = c.getFont();
@ -170,8 +170,8 @@ public class VSortTab extends CPanel implements APanelTab
}
};
JList noList = new JList(noModel);
JList yesList = new JList(yesModel);
JList<Object> noList = new JList<Object>(noModel);
JList<Object> yesList = new JList<Object>(yesModel);
private JScrollPane noPane = new JScrollPane(noList);
private JScrollPane yesPane = new JScrollPane(yesList);
@ -306,7 +306,7 @@ public class VSortTab extends CPanel implements APanelTab
{
if (me.getClickCount() > 1)
{
JList list = (JList)me.getComponent();
JList<?> list = (JList<?>)me.getComponent();
Point p = me.getPoint();
int index = list.locationToIndex(p);
if (index > -1 && list.getCellBounds(index, index).contains(p))
@ -362,7 +362,7 @@ public class VSortTab extends CPanel implements APanelTab
{
public void mouseDragged(MouseEvent me)
{
JList list = (JList)me.getComponent();
JList<?> list = (JList<?>)me.getComponent();
Point p = me.getPoint();
int index = list.locationToIndex(p);
if (index > -1 && list.getCellBounds(index, index).contains(p))
@ -533,13 +533,13 @@ public class VSortTab extends CPanel implements APanelTab
if (selObject == null || !selObject.isUpdateable())
continue;
DefaultListModel lmFrom = (source == bAdd || source == noList) ?
DefaultListModel<Object> lmFrom = (source == bAdd || source == noList) ?
noModel : yesModel;
DefaultListModel lmTo = (lmFrom == yesModel) ? noModel : yesModel;
DefaultListModel<Object> lmTo = (lmFrom == yesModel) ? noModel : yesModel;
lmFrom.removeElement(selObject);
lmTo.addElement(selObject);
JList list = (source == bAdd || source == noList) ?
JList<Object> list = (source == bAdd || source == noList) ?
yesList : noList;
list.setSelectedValue(selObject, true);
@ -816,10 +816,10 @@ public class VSortTab extends CPanel implements APanelTab
private String cursorName = "/org/compiere/images/DragCursor32.gif";
/** StartList */
private JList startList = null;
private JList<?> startList = null;
/** The startModel. */
private DefaultListModel startModel = null;
private DefaultListModel<Object> startModel = null;
/** The selObject. */
private Object selObject = null;
@ -834,7 +834,7 @@ public class VSortTab extends CPanel implements APanelTab
*/
public void mousePressed(MouseEvent me)
{
JList list = (JList)me.getComponent();
JList<?> list = (JList<?>)me.getComponent();
Point p = me.getPoint();
int index = list.locationToIndex(p);
if (index > -1 && list.getCellBounds(index, index).contains(p))
@ -873,8 +873,8 @@ public class VSortTab extends CPanel implements APanelTab
{
Point p = me.getPoint();
JList endList = yesList;
DefaultListModel endModel = yesModel;
JList<Object> endList = yesList;
DefaultListModel<Object> endModel = yesModel;
if (me.getComponent() == yesList)
{

View File

@ -42,7 +42,7 @@ public abstract class AutoCompleter implements MouseListener
protected final CLogger log = CLogger.getCLogger(getClass());
final JList listBox = new JList();
final JList<Object> listBox = new JList<Object>();
final JTextComponent textBox;
final private JPopupMenu popup = new JPopupMenu();
private boolean m_empty = false;
@ -114,7 +114,7 @@ public abstract class AutoCompleter implements MouseListener
if (completer.listBox.getSelectedValue() == null)
{
String txt = completer.textBox.getText();
ListModel lm = completer.listBox.getModel();
ListModel<Object> lm = completer.listBox.getModel();
for (int index = 0; index < lm.getSize(); index++)
{
if (startsWithIgnoreCase(lm.getElementAt(index).toString(), txt))

View File

@ -43,8 +43,8 @@ public class AutoCompletion extends PlainDocument {
*
*/
private static final long serialVersionUID = 1449135613844313889L;
CComboBox comboBox;
ComboBoxModel model;
CComboBox<Object> comboBox;
ComboBoxModel<?> model;
JTextComponent editor;
/**
* Flag to indicate if setSelectedItem has been called
@ -60,7 +60,7 @@ public class AutoCompletion extends PlainDocument {
KeyListener editorKeyListener;
FocusListener editorFocusListener;
public AutoCompletion(final CComboBox comboBox) {
public AutoCompletion(final CComboBox<Object> comboBox) {
this.comboBox = comboBox;
model = comboBox.getModel();
comboBox.addActionListener(new ActionListener() {
@ -71,7 +71,7 @@ public class AutoCompletion extends PlainDocument {
comboBox.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent e) {
if (e.getPropertyName().equals("editor")) configureEditor((ComboBoxEditor) e.getNewValue());
if (e.getPropertyName().equals("model")) model = (ComboBoxModel) e.getNewValue();
if (e.getPropertyName().equals("model")) model = (ComboBoxModel<?>) e.getNewValue();
}
});
editorKeyListener = new KeyAdapter() {
@ -104,7 +104,7 @@ public class AutoCompletion extends PlainDocument {
}
}
};
// Bug 5100422 on Java 1.5: Editable JComboBox won't hide popup when tabbing out
// Bug 5100422 on Java 1.5: Editable JComboBox<Object> won't hide popup when tabbing out
hidePopupOnFocusLoss=System.getProperty("java.version").startsWith("1.5");
// Highlight whole text when gaining focus
editorFocusListener = new FocusAdapter() {
@ -127,7 +127,7 @@ public class AutoCompletion extends PlainDocument {
* Enable auto completion for a combo box (strict mode)
* @param comboBox
*/
public static void enable(CComboBox comboBox) {
public static void enable(CComboBox<Object> comboBox) {
enable(comboBox, true);
}
@ -136,7 +136,7 @@ public class AutoCompletion extends PlainDocument {
* @param comboBox
* @param strictMode true if you want to set strict mode
*/
public static void enable(CComboBox comboBox, boolean strictMode) {
public static void enable(CComboBox<Object> comboBox, boolean strictMode) {
// has to be editable
comboBox.setEditable(true);
// change the editor's document

View File

@ -172,8 +172,8 @@ public final class Calculator extends CDialog
private CPanel bordPanel = new CPanel();
private CPanel currencyPanel = new CPanel();
private BorderLayout bordLayout = new BorderLayout();
private JComboBox curFrom = new JComboBox();
private JComboBox curTo = new JComboBox();
private JComboBox<Object> curFrom = new JComboBox<Object>();
private JComboBox<Object> curTo = new JComboBox<Object>();
private JLabel curLabel = new JLabel();
private FlowLayout currencyLayout = new FlowLayout();

View File

@ -149,7 +149,7 @@ public class Calendar extends CDialog
//
private CPanel mainPanel = new CPanel();
private CPanel monthPanel = new CPanel();
private CComboBox cMonth = new CComboBox();
private CComboBox<Object> cMonth = new CComboBox<Object>();
// BUG:3075946 KTU - Fix Thai Date
//private JSpinner cYear = new JSpinner(new SpinnerNumberModel(2000, 1900,2100,1));
private JSpinner cYear = new JSpinner(new SpinnerNumberModel(2000, 1900, 3000, 1));
@ -161,7 +161,7 @@ public class Calendar extends CDialog
private CButton bNext = new CButton();
private CButton bBack = new CButton();
private CPanel timePanel = new CPanel();
private CComboBox fHour = new CComboBox(getHours());
private CComboBox<Object> fHour = new CComboBox<Object>(getHours());
private CLabel lTimeSep = new CLabel();
private JSpinner fMinute = new JSpinner(new MinuteModel(5)); // 5 minute snap size
private JCheckBox cbPM = new JCheckBox();

View File

@ -50,7 +50,7 @@ public class ComboSelectionManager implements JComboBox.KeySelectionManager
* @param model a ComboBoxModel -- the component's data model, containing the list of selectable items
* @return an int equal to the selected row, where 0 is the first item and -1 is none
*/
public int selectionForKey (char key, ComboBoxModel model)
public int selectionForKey (char key, @SuppressWarnings("rawtypes") ComboBoxModel model)
{
if (log.isLoggable(Level.FINE)) log.fine("Key=" + key);
//

View File

@ -112,7 +112,7 @@ public final class VBPartner extends CDialog implements ActionListener
//
private VString fValue, fName, fName2, fContact, fTitle, fPhone, fFax, fPhone2, fEMail;
private VLocation fAddress;
private JComboBox fGreetingBP, fGreetingC;
private JComboBox<Object> fGreetingBP, fGreetingC;
//
private CPanel mainPanel = new CPanel();
private BorderLayout mainLayout = new BorderLayout();
@ -166,7 +166,7 @@ public final class VBPartner extends CDialog implements ActionListener
fValue.addActionListener(this);
createLine (fValue, "Value", true);
// Greeting Business Partner
fGreetingBP = new JComboBox (m_greeting);
fGreetingBP = new JComboBox<Object> (m_greeting);
createLine (fGreetingBP, "Greeting", false);
// Name
fName = new VString("Name", true, false, true, 30, 60, "", null);
@ -180,7 +180,7 @@ public final class VBPartner extends CDialog implements ActionListener
fContact = new VString("Contact", false, false, true, 30, 60, "", null);
createLine (fContact, "Contact", true).setFontBold(true);
// Greeting Contact
fGreetingC = new JComboBox (m_greeting);
fGreetingC = new JComboBox<Object> (m_greeting);
createLine (fGreetingC, "Greeting", false);
// Title
fTitle = new VString("Title", false, false, true, 30, 60, "", null);

View File

@ -34,7 +34,7 @@ import org.compiere.util.NamePair;
* @author Jorg Janke
* @version $Id: VComboBox.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
*/
public class VComboBox extends CComboBox
public class VComboBox extends CComboBox<Object>
{
/**
*
@ -54,7 +54,7 @@ public class VComboBox extends CComboBox
super(items);
// common_init();
}
public VComboBox(ComboBoxModel model)
public VComboBox(ComboBoxModel<Object> model)
{
super(model);
// common_init();
@ -91,7 +91,7 @@ public class VComboBox extends CComboBox
return;
}
ComboBoxModel model = getModel();
ComboBoxModel<Object> model = getModel();
int size = model.getSize();
for (int i = 0; i < size; i++)
{

View File

@ -116,7 +116,7 @@ public class VDocAction extends CDialog
private CPanel mainPanel = new CPanel();
private BorderLayout mainLayout = new BorderLayout();
private CPanel northPanel = new CPanel();
private CComboBox actionCombo = new CComboBox();
private CComboBox<Object>actionCombo = new CComboBox<Object>();
private JLabel actionLabel = new JLabel();
private JScrollPane centerPane = new JScrollPane();
private JTextArea message = new JTextArea();

View File

@ -139,11 +139,11 @@ public class VLocationDialog extends CDialog
Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "C_Country_ID", null);
// Current Country
fCountry = new CComboBoxEditable(MCountry.getCountries(Env.getCtx()));
fCountry = new CComboBoxEditable<Object>(MCountry.getCountries(Env.getCtx()));
fCountry.setSelectedItem(m_location.getCountry());
m_origCountry_ID = m_location.getC_Country_ID();
// Current Region
fRegion = new CComboBoxEditable(MRegion.getRegions(Env.getCtx(), m_origCountry_ID));
fRegion = new CComboBoxEditable<Object>(MRegion.getRegions(Env.getCtx(), m_origCountry_ID));
if (m_location.getCountry().isHasRegion()) {
if ( m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName) != null
&& m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName).trim().length() > 0)
@ -192,8 +192,8 @@ public class VLocationDialog extends CDialog
private CTextField fAddress4 = new CTextField(20); // length=60
private CTextField fCity = new CTextField(20); // length=60
private CityAutoCompleter fCityAutoCompleter;
private CComboBoxEditable fCountry;
private CComboBoxEditable fRegion;
private CComboBoxEditable<Object> fCountry;
private CComboBoxEditable<Object> fRegion;
private CTextField fPostal = new CTextField(5); // length=10
private CTextField fPostalAdd = new CTextField(5); // length=10
private CButton fOnline = new CButton();
@ -217,7 +217,7 @@ public class VLocationDialog extends CDialog
private JButton toLink = new JButton();
private JButton toRoute = new JButton();
private CComboBoxEditable lstAddressValidation = new CComboBoxEditable();
private CComboBoxEditable<Object> lstAddressValidation = new CComboBoxEditable<Object>();
private CButton btnOnline = new CButton();
private CTextArea txtResult = new CTextArea(3, 30);
private CCheckBox cbxValid = new CCheckBox();
@ -935,7 +935,7 @@ public class VLocationDialog extends CDialog
{
if (log.isLoggable(Level.FINE)) log.fine("Added new region from web service: " + values.getRegion());
//reload regions to combo box
fRegion = new CComboBoxEditable(MRegion.getRegions(Env.getCtx(), country.getC_Country_ID()));
fRegion = new CComboBoxEditable<Object>(MRegion.getRegions(Env.getCtx(), country.getC_Country_ID()));
// select region
fRegion.setSelectedItem(values);
} else

View File

@ -126,7 +126,7 @@ public class VLocatorDialog extends CDialog
private BorderLayout southLayout = new BorderLayout();
//
private VComboBox fLocator = new VComboBox();
private CComboBox fWarehouse = new CComboBox();
private CComboBox<Object>fWarehouse = new CComboBox<Object>();
private JCheckBox fCreateNew = new JCheckBox();
private CTextField fX = new CTextField();
private CTextField fY = new CTextField();

View File

@ -389,7 +389,7 @@ public class VLookup extends JComponent
m_combo.getEditor().getEditorComponent().removeMouseListener(mouseAdapter);
m_combo.removeFocusListener(this);
m_combo.removeActionListener(this);
m_combo.setModel(new DefaultComboBoxModel()); // remove reference
m_combo.setModel(new DefaultComboBoxModel<Object>()); // remove reference
// m_combo.removeAllItems();
m_combo = null;
} // dispose

View File

@ -195,7 +195,7 @@ public class VPAttributeDialog extends CDialog
private CButton bSelect = new CButton(Env.getImageIcon("PAttribute16.gif"));
// Lot
private VString fieldLotString = new VString ("Lot", false, false, true, 20, 20, null, null);
private CComboBox fieldLot = null;
private CComboBox<Object>fieldLot = null;
private CButton bLot = new CButton(Msg.getMsg (Env.getCtx(), "New"));
// Lot Popup
JPopupMenu popupMenu = new JPopupMenu();
@ -318,7 +318,7 @@ public class VPAttributeDialog extends CDialog
+ "WHERE EXISTS (SELECT M_Product_ID FROM M_Product p "
+ "WHERE p.M_AttributeSet_ID=" + m_masi.getM_AttributeSet_ID()
+ " AND p.M_Product_ID=l.M_Product_ID)";
fieldLot = new CComboBox(DB.getKeyNamePairs(sql, true));
fieldLot = new CComboBox<Object>(DB.getKeyNamePairs(sql, true));
label = new CLabel (Msg.translate(Env.getCtx(), "M_Lot_ID"));
label.setLabelFor (fieldLot);
centerPanel.add(label, new ALayoutConstraint(m_row++,0));
@ -436,7 +436,7 @@ public class VPAttributeDialog extends CDialog
if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attribute.getAttributeValueType()))
{
MAttributeValue[] values = attribute.getMAttributeValues(); // optional = null
CComboBox editor = new CComboBox(values);
CComboBox<Object> editor = new CComboBox<Object>(values);
boolean found = false;
if (instance != null)
{
@ -757,7 +757,7 @@ public class VPAttributeDialog extends CDialog
{
if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attributes[i].getAttributeValueType()))
{
CComboBox editor = (CComboBox)m_editors.get(i);
CComboBox<?> editor = (CComboBox<?>)m_editors.get(i);
MAttributeValue value = (MAttributeValue)editor.getSelectedItem();
if (log.isLoggable(Level.FINE)) log.fine(attributes[i].getName() + "=" + value);
if (attributes[i].isMandatory() && value == null)

View File

@ -132,7 +132,7 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene
m_combo.getEditor().getEditorComponent().removeFocusListener(this);
m_combo.removeFocusListener(this);
m_combo.removeActionListener(this);
m_combo.setModel(new DefaultComboBoxModel()); // remove reference
m_combo.setModel(new DefaultComboBoxModel<Object>()); // remove reference
// m_combo.removeAllItems();
m_combo = null;
}

View File

@ -70,16 +70,16 @@ public class VTranslationDialog extends TranslationController
private static CLogger log = CLogger.getCLogger(VTranslationDialog.class);
//
private GridBagLayout mainLayout = new GridBagLayout();
private JComboBox cbLanguage = new JComboBox();
private JComboBox<Object> cbLanguage = new JComboBox<Object>();
private JLabel lLanguage = new JLabel();
private JLabel lTable = new JLabel();
private JComboBox cbTable = new JComboBox();
private JComboBox<Object> cbTable = new JComboBox<Object>();
private JButton bExport = new JButton();
private JButton bImport = new JButton();
//
private StatusBar statusBar = new StatusBar();
private JLabel lClient = new JLabel();
private JComboBox cbClient = new JComboBox();
private JComboBox<Object> cbClient = new JComboBox<Object>();
/**

View File

@ -39,7 +39,7 @@ public class CompiereComboPopup extends BasicComboPopup
* Constructor
* @param combo
*/
public CompiereComboPopup(JComboBox combo)
public CompiereComboPopup(JComboBox<?> combo)
{
super(combo);
} // AdempiereComboPopup
@ -54,7 +54,7 @@ public class CompiereComboPopup extends BasicComboPopup
public void show()
{
// Check ComboBox if popup should be displayed
if (comboBox instanceof CComboBox && !((CComboBox)comboBox).displayPopup())
if (comboBox instanceof CComboBox && !((CComboBox<?>)comboBox).displayPopup())
return;
// Check Field if popup should be displayed
if (comboBox instanceof CField && !((CField)comboBox).displayPopup())
@ -64,7 +64,7 @@ public class CompiereComboPopup extends BasicComboPopup
/**
* Inform CComboBox and CField that Popup was hidden
* Inform CComboBox<Object> and CField that Popup was hidden
* @see CComboBox.hidingPopup
* @see CField.hidingPopup
*
@ -73,9 +73,9 @@ public class CompiereComboPopup extends BasicComboPopup
super.hide();
// Inform ComboBox that popup was hidden
if (comboBox instanceof CComboBox)
(CComboBox)comboBox).hidingPopup();
(CComboBox<Object>)comboBox).hidingPopup();
else if (comboBox instanceof CComboBox)
(CComboBox)comboBox).hidingPopup();
(CComboBox<Object>)comboBox).hidingPopup();
} // hided
/**/
} // AdempiereComboPopup

View File

@ -53,7 +53,9 @@ import org.compiere.model.MPOS;
import org.compiere.model.MPOSKey;
import org.compiere.model.MPayment;
import org.compiere.model.MPaymentValidate;
import static org.compiere.model.SystemIDs.*;
import org.compiere.swing.CButton;
import org.compiere.swing.CComboBox;
import org.compiere.swing.CDialog;
@ -179,7 +181,7 @@ public class PosPayment extends CDialog implements PosKeyListener, VetoableChang
private PosOrderModel p_order;
private CTextField fTotal = new CTextField(10);
private CTextField fBalance = new CTextField(10);
private CComboBox tenderTypePick = new CComboBox();
private CComboBox<Object>tenderTypePick = new CComboBox<Object>();
private PosTextField fPayAmt;
private CButton f_bProcess;
private boolean paid = false;
@ -189,7 +191,7 @@ public class PosPayment extends CDialog implements PosKeyListener, VetoableChang
private PosTextField fCheckRouteNo;
private PosTextField fCCardNo;
private PosTextField fCCardName;
private CComboBox fCCardType;
private CComboBox<Object>fCCardType;
private PosTextField fCCardMonth;
private PosTextField fCCardVC;
@ -252,7 +254,7 @@ public class PosPayment extends CDialog implements PosKeyListener, VetoableChang
MLookup lookup = MLookupFactory.get(Env.getCtx(), 0, 0, AD_Column_ID, DisplayType.List);
ArrayList<Object> types = lookup.getData(true, false, true, true, false); // IDEMPIERE 90
DefaultComboBoxModel typeModel = new DefaultComboBoxModel(types.toArray());
DefaultComboBoxModel<Object> typeModel = new DefaultComboBoxModel<Object>(types.toArray());
tenderTypePick.setModel(typeModel);
// default to cash payment
for (Object obj : types)
@ -271,10 +273,10 @@ public class PosPayment extends CDialog implements PosKeyListener, VetoableChang
tenderTypePick.setFont(font);
tenderTypePick.addActionListener(this);
tenderTypePick.setName("tenderTypePick"); //red1 for ID purpuse during testing
tenderTypePick.setRenderer(new ListCellRenderer() {
tenderTypePick.setRenderer(new ListCellRenderer<Object>() {
protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer();
public Component getListCellRendererComponent(JList list, Object value,
public Component getListCellRendererComponent(JList<?> list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
JLabel renderer = (JLabel) defaultRenderer
@ -340,12 +342,12 @@ public class PosPayment extends CDialog implements PosKeyListener, VetoableChang
*/
ValueNamePair[] ccs = p_order.getCreditCards((BigDecimal) fPayAmt.getValue());
// Set Selection
fCCardType = new CComboBox(ccs);
fCCardType = new CComboBox<Object>(ccs);
fCCardType.setName("cardType"); //red1 Id for testing
fCCardType.setRenderer(new ListCellRenderer() {
fCCardType.setRenderer(new ListCellRenderer<Object>() {
protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer();
public Component getListCellRendererComponent(JList list, Object value,
public Component getListCellRendererComponent(JList<?> list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
JLabel renderer = (JLabel) defaultRenderer

View File

@ -84,8 +84,8 @@ public class SubOrder extends PosSubPanel
private PosTextField f_name;
private CButton f_bNew;
//private CButton f_bSearch;
private CComboBox f_location;
private CComboBox f_user;
private CComboBox<KeyNamePair> f_location;
private CComboBox<KeyNamePair> f_user;
private CButton f_process;
private CButton f_print;
private CTextField f_DocumentNo;
@ -191,7 +191,7 @@ public class SubOrder extends PosSubPanel
//
/*
f_location = new CComboBox();
f_location = new CComboBox<Object>();
add (f_location, " wrap");
*/
@ -218,7 +218,7 @@ public class SubOrder extends PosSubPanel
f_total.setValue (Env.ZERO);
/*
//
f_user = new CComboBox();
f_user = new CComboBox<Object>();
add (f_user, "skip 1");
*/
} // init
@ -449,7 +449,7 @@ public class SubOrder extends PosSubPanel
for (int i = 0; i < locations.length; i++)
locationVector.add(locations[i].getKeyNamePair());
}
DefaultComboBoxModel locationModel = new DefaultComboBoxModel(locationVector);
DefaultComboBoxModel<KeyNamePair> locationModel = new DefaultComboBoxModel<KeyNamePair>(locationVector);
f_location.setModel(locationModel);
//
Vector<KeyNamePair> userVector = new Vector<KeyNamePair>();
@ -459,7 +459,7 @@ public class SubOrder extends PosSubPanel
for (int i = 0; i < users.length; i++)
userVector.add(users[i].getKeyNamePair());
}
DefaultComboBoxModel userModel = new DefaultComboBoxModel(userVector);
DefaultComboBoxModel<KeyNamePair> userModel = new DefaultComboBoxModel<KeyNamePair>(userVector);
f_user.setModel(userModel);
} // fillCombos

View File

@ -33,7 +33,7 @@ import org.compiere.util.Ini;
* @author Jorg Janke
* @version $Id: CPrinter.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $
*/
public class CPrinter extends CComboBox implements ActionListener
public class CPrinter extends CComboBox<Object> implements ActionListener
{
/**
*
@ -105,7 +105,7 @@ public class CPrinter extends CComboBox implements ActionListener
public void refresh() {
String current = (String) getSelectedItem();
removeAllItems();
setModel(new DefaultComboBoxModel(getPrinterNames()));
setModel(new DefaultComboBoxModel<Object>(getPrinterNames()));
if (current != null) {
for (int i = 0; i < getItemCount(); i++) {
String item = (String) getItemAt(i);

View File

@ -223,16 +223,16 @@ public class Viewer extends CFrame
private CButton bEnd = new CButton();
private CButton bFind = new CButton();
private CButton bExport = new CButton();
private CComboBox comboReport = new CComboBox();
private CComboBox<Object>comboReport = new CComboBox<Object>();
private CButton bPrevious = new CButton();
private CButton bNext = new CButton();
private SpinnerNumberModel spinnerModel = new SpinnerNumberModel(1,1,100,1);
private JSpinner spinner = new JSpinner(spinnerModel);
private CLabel labelDrill = new CLabel();
private CComboBox comboDrill = new CComboBox();
private CComboBox<Object>comboDrill = new CComboBox<Object>();
//FR 201156
private CCheckBox summary = new CCheckBox();
private CComboBox comboZoom = new CComboBox(View.ZOOM_OPTIONS);
private CComboBox<Object>comboZoom = new CComboBox<Object>(View.ZOOM_OPTIONS);
/**

View File

@ -703,7 +703,7 @@ public class CColumnControlButton extends JButton {
* @return a list containing all additional actions to include into the popup.
*/
protected List<Action> getAdditionalActions() {
List<Object> actionKeys = getColumnControlActionKeys();
List<String> actionKeys = getColumnControlActionKeys();
List<Action> actions = new ArrayList<Action>();
for (Object key : actionKeys) {
actions.add(table.getActionMap().get(key));
@ -721,13 +721,12 @@ public class CColumnControlButton extends JButton {
* @return the action keys of table's actionMap entries whose
* action should be included into the popup.
*/
@SuppressWarnings("unchecked")
protected List<Object> getColumnControlActionKeys() {
protected List<String> getColumnControlActionKeys() {
Object[] allKeys = table.getActionMap().allKeys();
List columnKeys = new ArrayList<Object>();
List<String> columnKeys = new ArrayList<String>();
for (int i = 0; i < allKeys.length; i++) {
if (isColumnControlActionKey(allKeys[i])) {
columnKeys.add(allKeys[i]);
columnKeys.add((String)allKeys[i]);
}
}
// JW: this will blow for non-String keys!
@ -769,7 +768,7 @@ public class CColumnControlButton extends JButton {
setFocusable(false);
// this is a trick to get hold of the client prop which
// prevents closing of the popup
JComboBox box = new JComboBox();
JComboBox<Object> box = new JComboBox<Object>();
Object preventHide = box.getClientProperty("doNotCancelPopup");
putClientProperty("doNotCancelPopup", preventHide);
}

View File

@ -54,7 +54,7 @@ import org.compiere.util.Trace;
* @author Jorg Janke
* @version $Id: CComboBox.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
*/
public class CComboBox extends JComboBox
public class CComboBox<E> extends JComboBox<E>
implements CEditor
{
/**
@ -73,7 +73,7 @@ public class CComboBox extends JComboBox
* displayed list of items
* @see DefaultComboBoxModel
*/
public CComboBox(ComboBoxModel aModel)
public CComboBox(ComboBoxModel<E> aModel)
{
super(aModel);
init();
@ -87,7 +87,7 @@ public class CComboBox extends JComboBox
* @param items an array of objects to insert into the combo box
* @see DefaultComboBoxModel
*/
public CComboBox(final Object items[])
public CComboBox(final E items[])
{
super(items);
init();
@ -102,7 +102,7 @@ public class CComboBox extends JComboBox
* @param key set selected if exists
* @see DefaultComboBoxModel
*/
public CComboBox(final Object items[], String key)
public CComboBox(final E items[], String key)
{
this(items);
if (key == null)
@ -133,7 +133,7 @@ public class CComboBox extends JComboBox
* @param items an array of vectors to insert into the combo box
* @see DefaultComboBoxModel
*/
public CComboBox(Vector<?> items)
public CComboBox(Vector<E> items)
{
super(items);
init();
@ -163,7 +163,7 @@ public class CComboBox extends JComboBox
public static final String CASE_SENSITIVE_PROPERTY = "caseSensitive";
/** View model for hiding showing only filtered data */
ReducibleModel m_reducibleModel;
ReducibleModel<E> m_reducibleModel;
/** Key listener for triggering an update the filtering model . */
private ReducibleKeyListener reducibleKeyListener = new ReducibleKeyListener();
@ -255,7 +255,7 @@ public class CComboBox extends JComboBox
} // setIcon
public ComboBoxModel getCompleteComboBoxModel()
public ComboBoxModel<E> getCompleteComboBoxModel()
{
return m_reducibleModel.getModel();
} // getCompleteComboBoxModel
@ -263,9 +263,9 @@ public class CComboBox extends JComboBox
/**
* @see javax.swing.JComboBox#setModel(javax.swing.ComboBoxModel)
*/
public void setModel(ComboBoxModel aModel)
public void setModel(ComboBoxModel<E> aModel)
{
m_reducibleModel = (m_reducibleModel == null) ? new ReducibleModel() : m_reducibleModel;
m_reducibleModel = (m_reducibleModel == null) ? new ReducibleModel<E>() : m_reducibleModel;
m_reducibleModel.setModel(aModel);
super.setModel(m_reducibleModel);
@ -573,7 +573,7 @@ public class CComboBox extends JComboBox
/**
* A view adapter model to hide filtered choices in the underlying combo box model.
*/
private class ReducibleModel implements MutableComboBoxModel, ListDataListener
private class ReducibleModel<T> implements MutableComboBoxModel<T>, ListDataListener
{
/**
* Default constructor. Creates a ReducibleModel.
@ -583,16 +583,16 @@ public class CComboBox extends JComboBox
}
/** The wrapped data model. */
private ComboBoxModel m_model;
private ComboBoxModel<T> m_model;
/** The wrapped data model. */
private EventListenerList m_listenerList = new EventListenerList();
/** The filtered data. */
private ArrayList<Object> m_visibleData = new ArrayList<Object>();
private ArrayList<T> m_visibleData = new ArrayList<T>();
/** The filtered data. */
private ArrayList<Object> m_modelData = new ArrayList<Object>();
private ArrayList<T> m_modelData = new ArrayList<T>();
/** The current filter. */
private String m_filter = "";
@ -605,11 +605,11 @@ public class CComboBox extends JComboBox
*
* @see javax.swing.DefaultComboBoxModel#addElement(java.lang.Object)
*/
public void addElement(Object anObject)
public void addElement(T anObject)
{
checkMutableComboBoxModel();
m_modelData.add(anObject);
((MutableComboBoxModel)m_model).addElement(anObject);
((MutableComboBoxModel<T>)m_model).addElement(anObject);
}
/* (non-Javadoc)
@ -668,7 +668,7 @@ public class CComboBox extends JComboBox
/* (non-Javadoc)
* @see javax.swing.ListModel#getElementAt(int)
*/
public Object getElementAt(int index)
public T getElementAt(int index)
{
return m_visibleData.get(index);
}
@ -702,7 +702,7 @@ public class CComboBox extends JComboBox
/**
* @return the wrapped model
*/
public ComboBoxModel getModel()
public ComboBoxModel<T> getModel()
{
return m_model;
}
@ -730,11 +730,11 @@ public class CComboBox extends JComboBox
*
* @see javax.swing.DefaultComboBoxModel#insertElementAt(java.lang.Object, int)
*/
public void insertElementAt(Object anObject, int index)
public void insertElementAt(T anObject, int index)
{
checkMutableComboBoxModel();
m_modelData.add(index, anObject);
((MutableComboBoxModel)m_model).insertElementAt(anObject, index);
((MutableComboBoxModel<T>)m_model).insertElementAt(anObject, index);
}
/**
@ -774,7 +774,7 @@ public class CComboBox extends JComboBox
m_modelData.clear();
m_visibleData.clear();
while (m_model.getSize() > 0)
((MutableComboBoxModel)m_model).removeElementAt(0);
((MutableComboBoxModel<T>)m_model).removeElementAt(0);
for (ListDataListener ldl : listeners)
addListDataListener(ldl);
@ -793,7 +793,7 @@ public class CComboBox extends JComboBox
checkMutableComboBoxModel();
m_modelData.remove(anObject);
m_visibleData.clear();
((MutableComboBoxModel)m_model).removeElement(anObject);
((MutableComboBoxModel<T>)m_model).removeElement(anObject);
}
/**
@ -806,7 +806,7 @@ public class CComboBox extends JComboBox
checkMutableComboBoxModel();
m_modelData.remove(index);
m_visibleData.clear();
((MutableComboBoxModel)m_model).removeElementAt(index);
((MutableComboBoxModel<T>)m_model).removeElementAt(index);
}
/* (non-Javadoc)
@ -831,7 +831,7 @@ public class CComboBox extends JComboBox
*
* @param model the model to set
*/
public void setModel(ComboBoxModel model)
public void setModel(ComboBoxModel<T> model)
{
if (this.m_model != null)
this.m_model.removeListDataListener(this);
@ -895,7 +895,7 @@ public class CComboBox extends JComboBox
for (int i = 0; i < size; i++)
{
Object element = m_model.getElementAt(i);
T element = m_model.getElementAt(i);
if (element == null || isMatchingFilter(element))
{
m_visibleData.add(element);

View File

@ -39,7 +39,7 @@ import org.compiere.util.Trace;
* @author Jorg Janke
* @version $Id: CComboBoxEditable.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
*/
public class CComboBoxEditable extends JComboBox
public class CComboBoxEditable<E> extends JComboBox<E>
implements CEditor
{
/**
@ -58,7 +58,7 @@ public class CComboBoxEditable extends JComboBox
* displayed list of items
* @see DefaultComboBoxModel
*/
public CComboBoxEditable(ComboBoxModel aModel)
public CComboBoxEditable(ComboBoxModel<E> aModel)
{
super(aModel);
init();
@ -72,7 +72,7 @@ public class CComboBoxEditable extends JComboBox
* @param items an array of objects to insert into the combo box
* @see DefaultComboBoxModel
*/
public CComboBoxEditable(final Object items[])
public CComboBoxEditable(final E items[])
{
super(items);
init();
@ -87,7 +87,7 @@ public class CComboBoxEditable extends JComboBox
* @param key set selected if exists
* @see DefaultComboBoxModel
*/
public CComboBoxEditable(final Object items[], String key)
public CComboBoxEditable(final E items[], String key)
{
this(items);
if (key == null)
@ -118,7 +118,7 @@ public class CComboBoxEditable extends JComboBox
* @param items an array of vectors to insert into the combo box
* @see DefaultComboBoxModel
*/
public CComboBoxEditable(Vector<Object> items)
public CComboBoxEditable(Vector<E> items)
{
super(items);
init();

View File

@ -44,7 +44,7 @@ import org.adempiere.plaf.AdempierePLAF;
* @author Jorg Janke
* @version $Id: CField.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
*/
public class CField extends JComboBox
public class CField extends JComboBox<Object>
implements CEditor, ActionListener
{

View File

@ -159,7 +159,7 @@ public class ColorEditor extends CDialog
private FlowLayout southLayout = new FlowLayout();
private GridBagLayout northLayout = new GridBagLayout();
private CLabel typeLabel = new CLabel();
private CComboBox typeField = new CComboBox(CompiereColor.TYPES);
private CComboBox<Object> typeField = new CComboBox<Object>(CompiereColor.TYPES);
private CButton gradientUpper = new CButton();
private CButton gradientLower = new CButton();
private CLabel urlLabel = new CLabel();
@ -175,7 +175,7 @@ public class ColorEditor extends CDialog
private CTextField distanceField = new CTextField(10);
private CPanel centerPanel = new CPanel();
private CButton flatField = new CButton();
private CComboBox gradientStartField = new CComboBox(CompiereColor.GRADIENT_SP);
private CComboBox<Object> gradientStartField = new CComboBox<Object>(CompiereColor.GRADIENT_SP);
private CTextField gradientDistanceField = new CTextField(10);
private CLabel gradientStartLabel = new CLabel();
private CLabel gradientDistanceLabel = new CLabel();

View File

@ -116,11 +116,11 @@ public class FontChooser extends CDialog
private BorderLayout mainLayout = new BorderLayout();
private CPanel selectPanel = new CPanel();
private CLabel nameLabel = new CLabel();
private CComboBox fontName = new CComboBox();
private CComboBox<Object>fontName = new CComboBox<Object>();
private CLabel sizeLabel = new CLabel();
private CLabel styleLabel = new CLabel();
private CComboBox fontStyle = new CComboBox();
private CComboBox fontSize = new CComboBox();
private CComboBox<Object>fontStyle = new CComboBox<Object>();
private CComboBox<Object>fontSize = new CComboBox<Object>();
private JTextArea fontTest = new JTextArea();
private JTextArea fontInfo = new JTextArea();
private GridBagLayout selectLayout = new GridBagLayout();

View File

@ -153,7 +153,7 @@ public class ADTreeOnDropListener implements EventListener<Event> {
{
tree.onInitRender();
}
Treeitem movingItem = tree.renderItemByPath(path);
tree.renderItemByPath(path);
//tree.setSelectedItem(movingItem);
//Events.sendEvent(tree, new Event(Events.ON_SELECT, tree));

View File

@ -33,7 +33,7 @@ import org.zkoss.zul.event.ListDataEvent;
import org.zkoss.zul.ext.Sortable;
/**
* This is a ListModel to be used with Listbox.
* This is a ListModel<Object> to be used with Listbox.
* The model allows for a table structure to be created, with columns
* in addition to the rows provided by {@link org.zkoss.zul.ListModelList}.
*
@ -63,7 +63,7 @@ public class ListModelTable extends ListModelList<Object> implements Sortable<Ob
}
/**
* Construct the ListModel with a collection of objects.
* Construct the ListModel<Object> with a collection of objects.
* A copy is made of the collection.
* The objects should be vectors of objects
*

View File

@ -23,7 +23,6 @@ import java.util.Set;
import org.zkoss.lang.Library;
import org.zkoss.lang.Objects;
import org.zkoss.xel.VariableResolver;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.UiException;
import org.zkoss.zk.ui.util.ForEachStatus;
@ -79,7 +78,7 @@ public class GridDataLoader implements DataLoader, Cropper {
public int getTotalSize() {
final Rows rows = _grid.getRows();
final ListModel model = _grid.getModel();
final ListModel<Object> model = _grid.getModel();
return model != null ? model.getSize() : rows != null ? rows.getVisibleItemCount() : 0;
}
@ -112,12 +111,12 @@ public class GridDataLoader implements DataLoader, Cropper {
else min = max - cnt + 1;
if (min > oldsz) min = oldsz;
RowRenderer renderer = null;
RowRenderer<?> renderer = null;
final Component next =
min < oldsz ? rows.getChildren().get(min): null;
while (--cnt >= 0) {
if (renderer == null)
renderer = (RowRenderer) getRealRenderer();
renderer = (RowRenderer<?>) getRealRenderer();
rows.insertBefore(newUnloadedItem(renderer, min++), next);
}
break;
@ -154,11 +153,11 @@ public class GridDataLoader implements DataLoader, Cropper {
/** Creates a new and unloaded row. */
protected Component newUnloadedItem(Object renderer, int index) {
final RowRenderer renderer0 = (RowRenderer) renderer;
final ListModel model = ((Grid)getOwner()).getModel();
final RowRenderer<?> renderer0 = (RowRenderer<?>) renderer;
final ListModel<Object> model = ((Grid)getOwner()).getModel();
Row row = null;
if (model instanceof GroupsListModel) {
final GroupsListModel gmodel = (GroupsListModel) model;
if (model instanceof GroupsListModel <?, ?, ?>) {
final GroupsListModel<?, ?, ?> gmodel = (GroupsListModel<?, ?, ?>) model;
final GroupingInfo info = gmodel.getDataInfo(index);
switch(info.getType()){
case GroupDataInfo.GROUP:
@ -181,7 +180,7 @@ public class GridDataLoader implements DataLoader, Cropper {
return row;
}
private Row newRow(RowRenderer renderer) {
private Row newRow(RowRenderer<?> renderer) {
Row row = null;
if (renderer instanceof RowRendererExt)
row = ((RowRendererExt)renderer).newRow((Grid)getOwner());
@ -191,7 +190,7 @@ public class GridDataLoader implements DataLoader, Cropper {
}
return row;
}
private Group newGroup(RowRenderer renderer) {
private Group newGroup(RowRenderer<?> renderer) {
Group group = null;
if (renderer instanceof GroupRendererExt)
group = ((GroupRendererExt)renderer).newGroup((Grid)getOwner());
@ -201,7 +200,7 @@ public class GridDataLoader implements DataLoader, Cropper {
}
return group;
}
private Groupfoot newGroupfoot(RowRenderer renderer) {
private Groupfoot newGroupfoot(RowRenderer<?> renderer) {
Groupfoot groupfoot = null;
if (renderer instanceof GroupRendererExt)
groupfoot = ((GroupRendererExt)renderer).newGroupfoot((Grid)getOwner());
@ -211,7 +210,7 @@ public class GridDataLoader implements DataLoader, Cropper {
}
return groupfoot;
}
private Component newUnloadedCell(RowRenderer renderer, Row row) {
private Component newUnloadedCell(RowRenderer<?> renderer, Row row) {
Component cell = null;
if (renderer instanceof RowRendererExt)
cell = ((RowRendererExt)renderer).newCell(row);
@ -233,10 +232,10 @@ public class GridDataLoader implements DataLoader, Cropper {
}
public Object getRealRenderer() {
final RowRenderer renderer = _grid.getRowRenderer();
final RowRenderer<?> renderer = _grid.getRowRenderer();
return renderer != null ? renderer : _defRend;
}
private static final RowRenderer _defRend = new RowRenderer() {
private static final RowRenderer<Object> _defRend = new RowRenderer<Object>() {
public void render(final Row row, final Object data, final int index) {
final Rows rows = (Rows)row.getParent();
final Grid grid = (Grid)rows.getParent();
@ -246,8 +245,8 @@ public class GridDataLoader implements DataLoader, Cropper {
final Template tm2 = getTemplate(grid, rows, "model:group");
if (tm2 != null)
tm = tm2;
if (grid.getModel() instanceof GroupsListModel) {
final GroupsListModel gmodel = (GroupsListModel) grid.getModel();
if (grid.getModel() instanceof GroupsListModel<?, ?, ?>) {
final GroupsListModel<?, ?, ?> gmodel = (GroupsListModel<?, ?, ?>)grid.getModel();
info = gmodel.getDataInfo(index);
}
} else if (row instanceof Groupfoot) {
@ -325,7 +324,7 @@ public class GridDataLoader implements DataLoader, Cropper {
int min = offset;
int max = offset + limit - 1;
final ListModel model = _grid.getModel();
final ListModel<Object> model = _grid.getModel();
Rows rows = _grid.getRows();
final int newsz = model.getSize();
final int oldsz = rows != null ? rows.getChildren().size(): 0;
@ -336,7 +335,7 @@ public class GridDataLoader implements DataLoader, Cropper {
int newcnt = newsz - oldsz;
int atg = pgi != null ? _grid.getActivePage(): 0;
RowRenderer renderer = null;
RowRenderer<?> renderer = null;
Component next = null;
if (oldsz > 0) {
if (min < 0) min = 0;
@ -365,7 +364,7 @@ public class GridDataLoader implements DataLoader, Cropper {
comp.detach();
comp = p;
}
} else { //ListModel
} else { //ListModel<Object>
int addcnt = 0;
Component row = rows.getChildren().get(min);
while (--cnt >= 0) {
@ -375,7 +374,7 @@ public class GridDataLoader implements DataLoader, Cropper {
row.detach(); //remove extra
} else if (((LoadStatus)((Row)row).getExtraCtrl()).isLoaded()) {
if (renderer == null)
renderer = (RowRenderer)getRealRenderer();
renderer = (RowRenderer<?>)getRealRenderer();
row.detach(); //always detach
rows.insertBefore(newUnloadedItem(renderer, min), next);
++addcnt;
@ -402,7 +401,7 @@ public class GridDataLoader implements DataLoader, Cropper {
for (; --newcnt >= 0; ++min) {
if (renderer == null)
renderer = (RowRenderer) getRealRenderer();
renderer = (RowRenderer<?>) getRealRenderer();
rows.insertBefore(newUnloadedItem(renderer, min), next);
}