/** 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); } }); }
/** Initializes the call button. */ private void initSMSButton() { if (!parentWindow.hasOperationSet(OperationSetSmsMessaging.class)) return; smsButton = new JButton(GuiActivator.getResources().getI18NString("service.gui.SEND_SMS")); smsButton.setIcon(GuiActivator.getResources().getImage("service.gui.icons.SMS_BUTTON_ICON")); buttonPanel.add(smsButton); smsButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final String searchText = parentWindow.getCurrentSearchText(); if (searchText == null) return; SMSManager.sendSMS(smsButton, searchText); } }); }