Java Code Examples for org.jdesktop.swingx.JXList#addListSelectionListener()

The following examples show how to use org.jdesktop.swingx.JXList#addListSelectionListener() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Spark   File: CallHistoryUI.java    License: Apache License 2.0 6 votes vote down vote up
private void addAllPanel(DefaultListModel model) {
    final JXList list = new JXList(model);
    list.addListSelectionListener(this);
    list.setCellRenderer(renderer);

    list.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent mouseEvent) {
            if (mouseEvent.getClickCount() == 2) {
                CallEntry entry = (CallEntry)list.getSelectedValue();
                callHistoryFrame.dispose();
                SoftPhoneManager.getInstance().getDefaultGuiManager().dial(entry.getNumber());
            }
        }
    });

    tabs.addTab(PhoneRes.getIString("phone.all"), null, new JScrollPane(list), PhoneRes.getIString("phone.allcalls"));
}
 
Example 2
Source Project: Spark   File: CallHistoryUI.java    License: Apache License 2.0 6 votes vote down vote up
private void addDialedCalls(DefaultListModel model) {
    final JXList list = new JXList(model);
    list.addListSelectionListener(this);
    list.setCellRenderer(renderer);
    list.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent mouseEvent) {
            if (mouseEvent.getClickCount() == 2) {
                CallEntry entry = (CallEntry)list.getSelectedValue();
                callHistoryFrame.dispose();
                SoftPhoneManager.getInstance().getDefaultGuiManager().dial(entry.getNumber());
            }
        }
    });
    List<RowFilter<Object,Object>> filters = new ArrayList<RowFilter<Object,Object>>();
    filters.add(RowFilter.regexFilter(CallLog.Type.dialed.toString(), 1));
    filters.add(RowFilter.regexFilter(CallLog.Type.dialed.toString(), 2));
    filters.add(RowFilter.regexFilter(CallLog.Type.dialed.toString(), 3));
    RowFilter<Object,Object> af = RowFilter.orFilter(filters);
    list.setRowFilter(af);           

    tabs.addTab(PhoneRes.getIString("phone.dialed"), null, new JScrollPane(list), PhoneRes.getIString("phone.dialedcalls"));
}
 
Example 3
Source Project: Spark   File: CallHistoryUI.java    License: Apache License 2.0 6 votes vote down vote up
private void addCallsReceived(DefaultListModel model) {
    final JXList list = new JXList(model);
    list.addListSelectionListener(this);
    list.setCellRenderer(renderer);
    list.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent mouseEvent) {
            if (mouseEvent.getClickCount() == 2) {
                CallEntry entry = (CallEntry)list.getSelectedValue();
                callHistoryFrame.dispose();
                SoftPhoneManager.getInstance().getDefaultGuiManager().dial(entry.getNumber());
            }
        }
    });

    List<RowFilter<Object,Object>> filters = new ArrayList<RowFilter<Object,Object>>();
    filters.add(RowFilter.regexFilter(CallLog.Type.received.toString(), 1));
    filters.add(RowFilter.regexFilter(CallLog.Type.received.toString(), 2));
    filters.add(RowFilter.regexFilter(CallLog.Type.received.toString(), 3));
    RowFilter<Object,Object> af = RowFilter.orFilter(filters);
    list.setRowFilter(af);

    tabs.addTab(PhoneRes.getIString("phone.received"), null, new JScrollPane(list), PhoneRes.getIString("phone.receivedcalls"));
}
 
Example 4
Source Project: Spark   File: CallHistoryUI.java    License: Apache License 2.0 6 votes vote down vote up
private void addCallsMissed(DefaultListModel model) {
    final JXList list = new JXList(model);
    list.addListSelectionListener(this);
    list.setCellRenderer(renderer);
    list.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent mouseEvent) {
            if (mouseEvent.getClickCount() == 2) {
                CallEntry entry = (CallEntry)list.getSelectedValue();
                callHistoryFrame.dispose();
                SoftPhoneManager.getInstance().getDefaultGuiManager().dial(entry.getNumber());
            }
        }
    });

    List<RowFilter<Object,Object>> filters = new ArrayList<RowFilter<Object,Object>>();
    filters.add(RowFilter.regexFilter(CallLog.Type.missed.toString(), 1));
    filters.add(RowFilter.regexFilter(CallLog.Type.missed.toString(), 2));
    filters.add(RowFilter.regexFilter(CallLog.Type.missed.toString(), 3));
    RowFilter<Object,Object> af = RowFilter.orFilter(filters);
    list.setRowFilter(af);

    tabs.addTab(PhoneRes.getIString("phone.missed"), null, new JScrollPane(list), PhoneRes.getIString("phone.missedcalls"));
}
 
Example 5
public FilterPipeline(JXList pThisList, JXList pRightList) {
    inputList = pThisList;
    outputList = pRightList;
    pThisList.addListSelectionListener(FilterPipeline.this);
}