Package com.suwish.pc.ui.component

Examples of com.suwish.pc.ui.component.KeyValueItem


    listModel.removeAllElements();
    IDevice[] devices = PhoneManager.getInstance().getDdmsManager().getDevices();
     for(IDevice device : devices){
//        if(StringUtils.isEmpty(value)) continue;
//        System.err.println(value);
        listModel.addElement(new KeyValueItem(DeviceUtils.getDeviceInfo4List(device), device));
      }
  }
View Full Code Here


    private static final long serialVersionUID = 1L;
    @Override
    public void actionPerformed(ActionEvent e) {
      int index = deviceList.getSelectedIndex();
      if(index < 0) return;
      KeyValueItem item = (KeyValueItem)listModel.get(index);
      device = (IDevice)item.getValue();
      dispose();
    }
     });
     reFreshButton.addActionListener(new AbstractAction() {
    private static final long serialVersionUID = 1L;
View Full Code Here

  public static int getKeyValueItemIndex(JComboBox comboBox, String value){
    if(value == null) return -1;
    int count = comboBox.getItemCount();
    if(count == 0 || !(comboBox.getItemAt(0) instanceof KeyValueItem)) return -1;
    for(int index = 0 ; index < count ; index ++){
      KeyValueItem item = (KeyValueItem)comboBox.getItemAt(index);
      if(value.equals(item.getValue())) return index;
    }
    return -1;
  }
View Full Code Here

  private void initUI(){
    setLayout(new GridBagLayout());
    add(new JLabel("ADB mode:"), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHEAST,
        GridBagConstraints.NONE, new Insets(10, 10, 0, 0), 0, 0));
    adbComboBox = new JComboBox();
    adbComboBox.addItem(new KeyValueItem("Socket(Default)", "socket"));
    adbComboBox.addItem(new KeyValueItem("Adb", "adb"));
    add(adbComboBox, new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST,
        GridBagConstraints.HORIZONTAL, new Insets(10, 5, 0, 0), 0, 0));
    add(new JLabel("need restart"), new GridBagConstraints(3, 0, 1, 1, 1, 0, GridBagConstraints.NORTHEAST,
        GridBagConstraints.HORIZONTAL, new Insets(10, 5, 0, 0), 0, 0));
   
    add(new JLabel("Look&Feel:"), new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.NORTHEAST,
        GridBagConstraints.NONE, new Insets(10, 10, 0, 0), 0, 0));   
    lfComboxBox = new JComboBox();
    lfComboxBox.addItem(new KeyValueItem("Native(Windows Default)", UIManager.getSystemLookAndFeelClassName()));
    lfComboxBox.addItem(new KeyValueItem("Crocss Platform(Linux Default)", UIManager.getCrossPlatformLookAndFeelClassName()));
    add(lfComboxBox, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.NORTHWEST,
        GridBagConstraints.HORIZONTAL, new Insets(10, 5, 0, 0), 0, 0));
    add(new JLabel("need restart"), new GridBagConstraints(3, 1, 1, 1, 1, 0, GridBagConstraints.NORTHEAST,
        GridBagConstraints.HORIZONTAL, new Insets(10, 5, 0, 0), 0, 0));
   
    add(new JLabel("Window close:"), new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.NORTHEAST,
        GridBagConstraints.NONE, new Insets(10, 10, 0, 0), 0, 0));   
    mainWidowCloseComboxBox = new JComboBox();
    mainWidowCloseComboxBox.addItem(new KeyValueItem("Exit(Default)", "1"));
    mainWidowCloseComboxBox.addItem(new KeyValueItem("Minimize", "2"));
    add(mainWidowCloseComboxBox, new GridBagConstraints(1, 2, 1, 1, 0, 0, GridBagConstraints.NORTHWEST,
        GridBagConstraints.HORIZONTAL, new Insets(10, 5, 0, 0), 0, 0));
   
    add(new JLabel(), new GridBagConstraints(100, 100, 100, 1, 1, 1, GridBagConstraints.WEST,
        GridBagConstraints.BOTH, new Insets(10, 10, 0, 0), 0, 0));
View Full Code Here

TOP

Related Classes of com.suwish.pc.ui.component.KeyValueItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.