use of org.jivesoftware.sparkplugin.ui.transfer.TransferManager in project Spark by igniterealtime.
the class NonRosterPanel method setupDefaults.
public void setupDefaults() {
holdButton.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent mouseEvent) {
toggleHold();
}
});
muteButton.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent mouseEvent) {
toggleMute();
}
});
transferButton.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent mouseEvent) {
TransferManager ui = new TransferManager();
final String number = ui.getNumber(SparkManager.getChatManager().getChatContainer().getChatFrame());
if (ModelUtil.hasLength(number)) {
setStatus(PhoneRes.getIString("phone.transferring") + "...", blueColor);
historyPanel.transferring();
SwingWorker transferringThread = new SwingWorker() {
public Object construct() {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return true;
}
public void finished() {
setStatus(PhoneRes.getIString("phone.transfered"), blueColor);
historyPanel.transfer(number);
callWasTransferred = true;
softPhone.handleTransfer(getActiveCall().getID(), number);
callEnded();
}
};
transferringThread.start();
}
}
});
final SoftPhoneManager manager = SoftPhoneManager.getInstance();
hangUpButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
manager.getDefaultGuiManager().hangup(activeCall);
hangUpButton.setEnabled(false);
muteButton.setButtonSelected(false);
holdButton.setButtonSelected(false);
}
});
redialButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
manager.getDefaultGuiManager().dial(activeCall.getCall().getNumber());
redialButton.setVisible(false);
hangUpButton.setVisible(true);
}
});
}
use of org.jivesoftware.sparkplugin.ui.transfer.TransferManager in project Spark by igniterealtime.
the class RosterMemberPanel method setupDefaults.
public void setupDefaults() {
holdButton.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent mouseEvent) {
toggleHold();
}
});
muteButton.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent mouseEvent) {
toggleMute();
}
});
transferButton.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent mouseEvent) {
TransferManager ui = new TransferManager();
final String number = ui.getNumber(SparkManager.getChatManager().getChatContainer().getChatFrame());
if (ModelUtil.hasLength(number)) {
setStatus("Transferring...", blueColor);
historyPanel.transferring();
SwingWorker transferringThread = new SwingWorker() {
public Object construct() {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return true;
}
public void finished() {
setStatus("Transferred", blueColor);
historyPanel.transfer(number);
callWasTransferred = true;
softPhone.handleTransfer(getActiveCall().getID(), number);
callEnded();
}
};
transferringThread.start();
}
}
});
final SoftPhoneManager manager = SoftPhoneManager.getInstance();
hangUpButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
manager.getDefaultGuiManager().hangup(activeCall);
hangUpButton.setEnabled(false);
}
});
}
Aggregations