Package javax.swing

Examples of javax.swing.SpinnerListModel


  private static class MySpinner extends JSpinner {
    private boolean recording;
    private final MethodInvocations methodInvocations = new MethodInvocations();

    MySpinner(Object... values) {
      super(new SpinnerListModel(values));
    }
View Full Code Here


      return execute(new GuiQuery<JSpinner>() {
        @Override
        protected JSpinner executeInEDT() {
          JSpinner spinner = new JSpinner();
          if (!isNullOrEmpty(values)) {
            spinner.setModel(new SpinnerListModel(values));
          }
          spinner.setName(name);
          return spinner;
        }
      });
View Full Code Here

  private static class MySpinner extends JSpinner {
    private boolean recording;
    private final MethodInvocations methodInvocations = new MethodInvocations();

    public MySpinner(Object... values) {
      super(new SpinnerListModel(values));
    }
View Full Code Here

      String line;
      while((line=br.readLine())!=null){
        list.add(line);
      }
      String[]items = new String[list.size()];
      return new SpinnerListModel(list.toArray(items));
    } catch (IOException e) {
      TypePlugin.getLogger().error(e);
      return null;
    }     
  }
View Full Code Here

 
  public void setValue(Object value) {
    if (value == null) {
      text.setText("");
    } else {
      SpinnerListModel model = (SpinnerListModel) value;
      List<?> list = model.getList();
      StringBuilder builder = new StringBuilder();
      for(int i=0;i<list.size();i++){
        if(i!=0){
          builder.append("\n");
        }
View Full Code Here

 
  public String getJavaCode(Object value, ImportRewrite imports) {
    if (value == null)
      return "null";
    SpinnerListModel slm = (SpinnerListModel) value;
    String className = imports.addImport("javax.swing.SpinnerListModel");
    List list = slm.getList();
    StringBuilder builder = new StringBuilder();
    builder.append("new " + className + "(new Object[]{");
    for (Object item : list) {
      if (item == null)
        builder.append("null, ");
View Full Code Here

    return null;
  }

 
  public Object clone(Object object) {
    SpinnerListModel slm=(SpinnerListModel)object;   
    return new SpinnerListModel(slm.getList());
  }
View Full Code Here

    this.lheurePM = new JLabel("Heure de d�but ( en PM+X ) :");
    this.lheurePM.setBounds(20, 240, 180, 30);
   
   
    String[] dataCoef = {"45", "60", "90"};
    SpinnerModel modelCoef = new SpinnerListModel(dataCoef);
    this.sCoef = new JSpinner(modelCoef);
    this.sCoef.setBounds(180, 20, 100, 30);
   
    String[] data = {"Initiation", "Entrainement"};
    SpinnerModel model = new SpinnerListModel(data);
    this.sDiff = new JSpinner(model);
    this.sDiff.setBounds(180, 60, 100, 30);
   
    this.sbAvance = new JCheckBox("Activer les options avanc�es");
    this.sbAvance.setBounds(300, 20, 200, 30);
    this.sbAvance.addChangeListener(this);
   
    this.bValider = new JButton("Valider");
    this.bValider.setBounds(220, 300, 100, 30);
    this.bValider.addActionListener(this);
   
    String[] dataHeure = new String[24];
    for(int i = 0; i < 24; i++){
      dataHeure[i] = String.valueOf(i);
    }
    SpinnerModel modelHeure = new SpinnerListModel(dataHeure);
    this.sHeure = new JSpinner(modelHeure);
    this.sHeure.setBounds(220, 200, 150, 30);
    this.sHeure.setEnabled(false);
   
    String[] dataHeurePM = new String[12];
    for(int i = 0; i < 12; i++){
      dataHeurePM[i] = String.valueOf(i);
    }
    SpinnerModel modelHeurePM = new SpinnerListModel(dataHeurePM);
    this.sHeurePM = new JSpinner(modelHeurePM);
    this.sHeurePM.setBounds(220, 240, 150, 30);
    this.sHeurePM.setEnabled(false);
   
    this.add(this.lCoef);
View Full Code Here

    this.lheurePM = new JLabel("Heure de d�but ( en PM+X ) :");
    this.lheurePM.setBounds(20, 240, 180, 30);
   
   
    String[] dataCoef = {"45", "60", "90"};
    SpinnerModel modelCoef = new SpinnerListModel(dataCoef);
    this.sCoef = new JSpinner(modelCoef);
    this.sCoef.setBounds(180, 20, 100, 30);
   
    String[] data = {"Initiation", "Entrainement"};
    SpinnerModel model = new SpinnerListModel(data);
    this.sDiff = new JSpinner(model);
    this.sDiff.setBounds(180, 60, 100, 30);
   
    this.sbAvance = new JCheckBox("Activer les options avanc�es");
    this.sbAvance.setBounds(300, 20, 200, 30);
    this.sbAvance.addChangeListener(this);
   
    this.bValider = new JButton("Valider");
    this.bValider.setBounds(220, 300, 100, 30);
    this.bValider.addActionListener(this);
   
    String[] dataHeure = new String[24];
    for(int i = 0; i < 24; i++){
      dataHeure[i] = String.valueOf(i);
    }
    SpinnerModel modelHeure = new SpinnerListModel(dataHeure);
    this.sHeure = new JSpinner(modelHeure);
    this.sHeure.setBounds(220, 200, 150, 30);
    this.sHeure.setEnabled(false);
   
    String[] dataHeurePM = new String[12];
    for(int i = 0; i < 12; i++){
      dataHeurePM[i] = String.valueOf(i);
    }
    SpinnerModel modelHeurePM = new SpinnerListModel(dataHeurePM);
    this.sHeurePM = new JSpinner(modelHeurePM);
    this.sHeurePM.setBounds(220, 240, 150, 30);
    this.sHeurePM.setEnabled(false);
   
    this.add(this.lCoef);
View Full Code Here

public class constructor implements Testlet
{
  public void test(TestHarness harness)
  {
    harness.checkPoint("(JSpinner)");
    SpinnerListModel m = new SpinnerListModel(new String[] {"A", "B", "C"});
    JSpinner s = new JSpinner(m);
    JSpinner.DefaultEditor e = new JSpinner.DefaultEditor(s);
    harness.check(e.getLayout(), e);
    harness.check(e.getTextField().getValue(), "A");
   
View Full Code Here

TOP

Related Classes of javax.swing.SpinnerListModel

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.