/** Initializes the call button. */ private void initCallButton() { List<ProtocolProviderService> telephonyProviders = CallManager.getTelephonyProviders(); if (telephonyProviders != null && telephonyProviders.size() > 0) { if (callButton.getParent() != null) return; callButton.setAlignmentX(JButton.CENTER_ALIGNMENT); callButton.setMnemonic( GuiActivator.getResources().getI18nMnemonic("service.gui.CALL_CONTACT")); buttonPanel.add(callButton); callButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { String searchText = parentWindow.getCurrentSearchText(); if (searchText == null) return; CallManager.createCall(searchText, callButton); } }); } else { buttonPanel.remove(callButton); } }
private void initAddContactButton() { addButton.setAlignmentX(JButton.CENTER_ALIGNMENT); addButton.setMnemonic(GuiActivator.getResources().getI18nMnemonic("service.gui.ADD_CONTACT")); buttonPanel.add(addButton); addButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { AddContactDialog dialog = new AddContactDialog(parentWindow); dialog.setContactAddress(parentWindow.getCurrentSearchText()); dialog.setVisible(true); } }); }