Examples of Limits


Examples of org.apache.pivot.wtk.Limits

        }
    }

    private Component addLimitsControl(final Dictionary<String, Object> dictionary,
        final String key, Form.Section section) {
        Limits limits = (Limits)dictionary.get(key);

        BoxPane boxPane = new BoxPane(Orientation.VERTICAL);
        section.add(boxPane);
        Form.setLabel(boxPane, key);

        FlowPane flowPane = new FlowPane();
        flowPane.getStyles().put("alignToBaseline", true);
        flowPane.getStyles().put("horizontalSpacing", 5);
        boxPane.add(flowPane);

        TextInput textInput = new TextInput();
        textInput.setTextSize(10);
        textInput.setMaximumLength(10);
        textInput.setValidator(new IntValidator());
        textInput.setText(String.valueOf(limits.minimum));
        flowPane.add(textInput);

        textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() {
            @Override
            public void focusedChanged(Component component, Component obverseComponent) {
                if (!component.isFocused()) {
                    TextInput textInput = (TextInput)component;
                    Limits limits = (Limits)dictionary.get(key);

                    try {
                        int min = Integer.parseInt(textInput.getText());
                        dictionary.put(key, new Limits(min, limits.maximum));
                    } catch (Exception exception) {
                        displayErrorMessage(exception, component.getWindow());
                        textInput.setText(String.valueOf(limits.minimum));
                    }
                }
            }
        });

        Label label = new Label("min");
        label.getStyles().put("font", "{italic:true}");
        flowPane.add(label);

        flowPane = new FlowPane();
        flowPane.getStyles().put("alignToBaseline", true);
        flowPane.getStyles().put("horizontalSpacing", 5);
        boxPane.add(flowPane);

        textInput = new TextInput();
        textInput.setTextSize(10);
        textInput.setMaximumLength(10);
        textInput.setValidator(new IntValidator());
        textInput.setText(String.valueOf(limits.maximum));
        flowPane.add(textInput);

        textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() {
            @Override
            public void focusedChanged(Component component, Component obverseComponent) {
                if (!component.isFocused()) {
                    TextInput textInput = (TextInput)component;
                    Limits limits = (Limits)dictionary.get(key);

                    try {
                        int max = Integer.parseInt(textInput.getText());
                        dictionary.put(key, new Limits(limits.minimum, max));
                    } catch (Exception exception) {
                        displayErrorMessage(exception, component.getWindow());
                        textInput.setText(String.valueOf(limits.maximum));
                    }
                }
View Full Code Here

Examples of org.apache.pivot.wtk.Limits

    private void updateLimitsControl(Dictionary<String, Object> dictionary, String key) {
        BoxPane boxPane = (BoxPane)controls.get(key);

        if (boxPane != null) {
            Limits limits = (Limits)dictionary.get(key);

            TextInput minTextInput = (TextInput)((FlowPane)boxPane.get(0)).get(0);
            TextInput maxTextInput = (TextInput)((FlowPane)boxPane.get(1)).get(0);

            minTextInput.setText(String.valueOf(limits.minimum));
View Full Code Here

Examples of org.apache.pivot.wtk.Limits

        }
    }

    private Component addLimitsControl(final Dictionary<String, Object> dictionary,
        final String key, Form.Section section) {
        Limits limits = (Limits)dictionary.get(key);

        BoxPane boxPane = new BoxPane(Orientation.VERTICAL);
        section.add(boxPane);
        Form.setLabel(boxPane, key);

        FlowPane flowPane = new FlowPane();
        flowPane.getStyles().put("alignToBaseline", true);
        flowPane.getStyles().put("horizontalSpacing", 5);
        boxPane.add(flowPane);

        TextInput textInput = new TextInput();
        textInput.setTextSize(10);
        textInput.setMaximumLength(10);
        textInput.setValidator(new IntValidator());
        textInput.setText(String.valueOf(limits.min));
        flowPane.add(textInput);

        textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() {
            @Override
            public void focusedChanged(Component component, Component obverseComponent) {
                if (!component.isFocused()) {
                    TextInput textInput = (TextInput)component;
                    Limits limits = (Limits)dictionary.get(key);

                    try {
                        int min = Integer.parseInt(textInput.getText());
                        dictionary.put(key, new Limits(min, limits.max));
                    } catch (Exception exception) {
                        displayErrorMessage(exception, component.getWindow());
                        textInput.setText(String.valueOf(limits.min));
                    }
                }
            }
        });

        Label label = new Label("min");
        label.getStyles().put("font", "{italic:true}");
        flowPane.add(label);

        flowPane = new FlowPane();
        flowPane.getStyles().put("alignToBaseline", true);
        flowPane.getStyles().put("horizontalSpacing", 5);
        boxPane.add(flowPane);

        textInput = new TextInput();
        textInput.setTextSize(10);
        textInput.setMaximumLength(10);
        textInput.setValidator(new IntValidator());
        textInput.setText(String.valueOf(limits.max));
        flowPane.add(textInput);

        textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() {
            @Override
            public void focusedChanged(Component component, Component obverseComponent) {
                if (!component.isFocused()) {
                    TextInput textInput = (TextInput)component;
                    Limits limits = (Limits)dictionary.get(key);

                    try {
                        int max = Integer.parseInt(textInput.getText());
                        dictionary.put(key, new Limits(limits.min, max));
                    } catch (Exception exception) {
                        displayErrorMessage(exception, component.getWindow());
                        textInput.setText(String.valueOf(limits.max));
                    }
                }
View Full Code Here

Examples of org.apache.pivot.wtk.Limits

    private void updateLimitsControl(Dictionary<String, Object> dictionary, String key) {
        BoxPane boxPane = (BoxPane)controls.get(key);

        if (boxPane != null) {
            Limits limits = (Limits)dictionary.get(key);

            TextInput minTextInput = (TextInput)((FlowPane)boxPane.get(0)).get(0);
            TextInput maxTextInput = (TextInput)((FlowPane)boxPane.get(1)).get(0);

            minTextInput.setText(String.valueOf(limits.min));
View Full Code Here

Examples of org.jclouds.abiquo.domain.enterprise.Limits

   protected void createEnterprise() {
      enterprise = Enterprise.builder(context.getApiContext()).name(randomName()).build();
      enterprise.save();
      assertNotNull(enterprise.getId());
      Limits limits = enterprise.allowDatacenter(datacenter);
      assertNotNull(limits);
   }
View Full Code Here

Examples of org.jclouds.abiquo.domain.enterprise.Limits

   protected void createEnterprise() {
      enterprise = Enterprise.builder(context.getApiContext()).name(randomName()).build();
      enterprise.save();
      assertNotNull(enterprise.getId());
      Limits limits = enterprise.allowDatacenter(datacenter);
      assertNotNull(limits);
   }
View Full Code Here

Examples of org.jclouds.abiquo.domain.enterprise.Limits

   protected void createEnterprise() {
      enterprise = Enterprise.builder(context.getApiContext()).name(randomName()).build();
      enterprise.save();
      assertNotNull(enterprise.getId());
      Limits limits = enterprise.allowDatacenter(datacenter);
      assertNotNull(limits);
   }
View Full Code Here

Examples of org.jclouds.cloudservers.domain.Limits

      socketTester = retry(socketOpen, 120, 1, SECONDS);
      injector.injectMembers(socketOpen); // add logger
   }

   public void testLimits() throws Exception {
      Limits response = client.getLimits();
      assert null != response;
      assertTrue(response.getAbsolute().size() > 0);
      assertTrue(response.getRate().size() > 0);
   }
View Full Code Here

Examples of org.jclouds.cloudservers.domain.Limits

      socketTester = retry(socketOpen, 120, 1, SECONDS);
      injector.injectMembers(socketOpen); // add logger
   }

   public void testLimits() throws Exception {
      Limits response = client.getLimits();
      assert null != response;
      assertTrue(response.getAbsolute().size() > 0);
      assertTrue(response.getRate().size() > 0);
   }
View Full Code Here

Examples of org.jclouds.cloudservers.domain.Limits

      socketTester = retry(socketOpen, 120, 1, SECONDS);
      injector.injectMembers(socketOpen); // add logger
   }

   public void testLimits() throws Exception {
      Limits response = client.getLimits();
      assert null != response;
      assertTrue(response.getAbsolute().size() > 0);
      assertTrue(response.getRate().size() > 0);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.