@Override public GemPanel init() { number = new GemNumericField(6); number.addActionListener(this); name = new GemField(15); name.addActionListener(this); style = new GemField(15); style.addActionListener(this); site = new GemField(15); site.addActionListener(this); btErase = new GemButton(GemCommand.ERASE_CMD); btErase.addActionListener(this); mask = new GemPanel(); mask.setLayout(new GridBagLayout()); GridBagHelper gb = new GridBagHelper(mask); gb.add(new GemLabel(BundleUtil.getLabel("Number.label")), 0, 0, 1, 1, GridBagHelper.WEST); gb.add(new GemLabel(BundleUtil.getLabel("Name.label")), 0, 1, 1, 1, GridBagHelper.WEST); gb.add(new GemLabel(BundleUtil.getLabel("Style.label")), 0, 2, 1, 1, GridBagHelper.WEST); gb.add(new GemLabel(BundleUtil.getLabel("Website.label")), 0, 3, 1, 1, GridBagHelper.WEST); gb.add(number, 1, 0, 1, 1, GridBagHelper.WEST); gb.add(name, 1, 1, 1, 1, GridBagHelper.WEST); gb.add(style, 1, 2, 1, 1, GridBagHelper.WEST); gb.add(site, 1, 3, 1, 1, GridBagHelper.WEST); gb.add(btErase, 2, 4, 1, 1, GridBagHelper.WEST); return mask; }
@Override public void clear() { number.setText(""); name.setText(""); style.setText(""); site.setText(""); }
@Override public String getField(int n) { String s = null; switch (n) { case 0: s = number.getText(); break; case 1: s = name.getText(); break; case 2: s = style.getText(); break; case 3: s = site.getText(); break; } if (s != null && s.length() > 0) { return s; } else { return null; } }