public void clear() { contact = null; personView.clear(); teleView.clear(); emailView.clear(); websiteView.clear(); addressView.clear(); if (cbTelAddress != null) { cbTelAddress.removeItemListener(this); remove(cbTelAddress); revalidate(); cbTelAddress = null; } linkTelAddress = false; note.setText(""); }
public ContactFileEditor(GemDesktop _desktop) { super(_desktop); note = new GemLabel(); note.setForeground(java.awt.Color.red); personView = new PersonView(); infosView = new GemPanel(); infosView.setBorder(BorderFactory.createMatteBorder(0, 1, 0, 0, Color.lightGray)); teleView = new TelView( ParamTableIO.find(Category.TELEPHONE.getTable(), Category.TELEPHONE.getCol(), dc)); emailView = new EmailView(); websiteView = new WebSiteView( ParamTableIO.find(Category.SITEWEB.getTable(), Category.SITEWEB.getCol(), dc)); infosView.setLayout(new BoxLayout(infosView, BoxLayout.Y_AXIS)); infosView.add(teleView); infosView.add(emailView); infosView.add(websiteView); JScrollPane scp = new JScrollPane(infosView); scp.setBorder(null); scp.setPreferredSize(new Dimension(400, scp.getPreferredSize().height)); GemPanel addressPanel = new GemPanel(); addressPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); addressView = new AddressView(); addressView.setBorder(null); addressPanel.add(addressView, BorderLayout.SOUTH); this.setLayout(new GridBagLayout()); gb = new GridBagHelper(this); GemBorderPanel gp = new GemBorderPanel(new BorderLayout()); gp.add(personView, BorderLayout.WEST); gp.add(scp, BorderLayout.EAST); gb.add(gp, 0, 0, 1, 1, GridBagHelper.BOTH, 1.0, 1.0); gb.add(addressPanel, 0, 2, 1, 1, GridBagHelper.BOTH, GridBagHelper.WEST); gb.add(note, 0, 3, 1, 1, GridBagHelper.HORIZONTAL, GridBagHelper.WEST); }
public void setNote(Note n) { if (n != null) { String s = n.getText().replace('\n', ' '); note.setText(s); } }