Package lcmc.common.domain

Examples of lcmc.common.domain.StringValue


        }
        /* Attributes */
        final String[] params = getParametersFromXML();
        if (params != null) {
            for (final String param : params) {
                Value value = new StringValue(resourceNode.get(param));
                final Value defaultValue = getParamDefault(param);
                if (value.isNothingSelected()) {
                    value = defaultValue;
                }
                final Value oldValue = getParamSaved(param);
                final Widget wi = getWidget(param, null);
                final boolean haveChanged = !Tools.areEqual(value, oldValue)
View Full Code Here


    @Override
    public Value getParamSaved(final String param) {
        final ClusterStatus clStatus = getBrowser().getClusterStatus();
        Value value = super.getParamSaved(param);
        if (value == null) {
            value = new StringValue(clStatus.getRscDefaultsParameter(param, Application.RunMode.LIVE));
            if (value.isNothingSelected()) {
                value = getParamPreferred(param);
                if (value == null) {
                    return getParamDefault(param);
                }
View Full Code Here

    }

    /** Return value, that user have chosen in the field or typed in. */
    @Override
    protected Value getValueInternal() {
        final Value value = new StringValue(((JTextComponent) getInternalComponent()).getText());
        if (value.isNothingSelected()) {
            return null;
        }
        return value;
    }
View Full Code Here

            final List<Host> definedOnHosts =
                                getVMSVirtualDomainInfo().getDefinedOnHosts();
            final Map<String, Integer> networksIntersection = netInterfaceService.getNetworksIntersection(definedOnHosts);
            final List<Value> commonNetworks = new ArrayList<Value>();
            commonNetworks.add(new StringValue());
            commonNetworks.add(new StringValue("0.0.0.0", "All Interfaces/0.0.0.0"));
            commonNetworks.add(new StringValue("127.0.0.1", "localhost/127.0.0.1"));
            if (networksIntersection != null) {
                for (final String netIp : networksIntersection.keySet()) {
                    final Value network = new StringValue(netIp);
                    commonNetworks.add(network);
                }
            }
            return commonNetworks.toArray(
                                        new StringValue[commonNetworks.size()]);
        } else if (GraphicsData.KEYMAP.equals(param)) {
            List<Value> keymaps = null;
            final List<Host> definedOnHosts =
                                getVMSVirtualDomainInfo().getDefinedOnHosts();
            for (final Host host : definedOnHosts) {
                if (keymaps == null) {
                    keymaps = new ArrayList<Value>();
                    keymaps.add(new StringValue());
                    keymaps.addAll(host.getAvailableQemuKeymaps());
                } else {
                    final Set<Value> hostKeymaps = host.getAvailableQemuKeymaps();
                    final List<Value> newKeymaps = new ArrayList<Value>();
                    newKeymaps.add(new StringValue());
                    for (final Value km : keymaps) {
                        if (km != null && hostKeymaps.contains(km)) {
                            newKeymaps.add(km);
                        }
                    }
                    keymaps = newKeymaps;
                }
            }
            if (keymaps == null) {
                return new StringValue[]{new StringValue()};
            }
            return keymaps.toArray(new Value[keymaps.size()]);
        }
        return POSSIBLE_VALUES.get(param);
    }
View Full Code Here

            } else {
                id = crmId;
            }
        }
        LOG.debug1("setHeartbeatId: set crm id: " + crmId + ", id: " + id);
        setValue("id", new StringValue(id));
    }
View Full Code Here

            if (host.getHeartbeatVersion() == null) {
                hbIsPossible = false;
            }
        }
        if (!aisIsPossible && hbIsPossible) {
            chooseStackCombo.setValue(new StringValue(Application.HEARTBEAT_NAME));
        }
        final boolean ais = aisIsPossible;
        final boolean hb = hbIsPossible;
        if (ais || hb) {
            application.invokeLater(new Runnable() {
View Full Code Here

    }

    public final void setIdAndCrmId(final String id) {
        this.id = id;
        crmId = getCrmIdFromId(id);
        setValue("id", new StringValue(id));
    }
View Full Code Here

        if (defaultValue == null) {
            defaultValue = Application.COROSYNC_NAME;
        }
        chooseStackCombo = widgetFactory.createInstance(
                                          Widget.Type.RADIOGROUP,
                                          new StringValue(defaultValue),
                                          new Value[]{new StringValue(Application.HEARTBEAT_NAME),
                                                      new StringValue(Application.COROSYNC_NAME)},
                                          Widget.NO_REGEXP,
                                          500,
                                          Widget.NO_ABBRV,
                                          new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL),
                                          Widget.NO_BUTTON);
View Full Code Here

            public void run() {
                final MComboBox<Value> cb = getInternalComponent();
                final Object selectedObject = cb.getSelectedItem();
                final Value selectedItem;
                if (selectedObject instanceof String) {
                    selectedItem = new StringValue((String) selectedObject);
                } else {
                    selectedItem = (Value) selectedObject;
                }
                boolean selectedChanged = false;
                if (selectedValue == null && selectedItem != null && !selectedItem.isNothingSelected()) {
View Full Code Here

                        return null;
                    }
                    return comboBoxValue;
                }
            }
            return new StringValue(text);
        }
        final Value value = (Value) cb.getSelectedItem();
        if (value == null || value.isNothingSelected()) {
            return null;
        }
View Full Code Here

TOP

Related Classes of lcmc.common.domain.StringValue

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.