Package lcmc.common.domain

Examples of lcmc.common.domain.StringValue


                              final String connectSourceService,
                              final String protocolType,
                              final String targetPort) {
        super();
        this.type = type;
        setValue(TYPE, new StringValue(type));
        setValue(SOURCE_PATH, new StringValue(sourcePath));
        setValue(BIND_SOURCE_MODE, new StringValue(bindSourceMode));
        setValue(BIND_SOURCE_HOST, new StringValue(bindSourceHost));
        setValue(BIND_SOURCE_SERVICE, new StringValue(bindSourceService));
        setValue(CONNECT_SOURCE_MODE, new StringValue(connectSourceMode));
        setValue(CONNECT_SOURCE_HOST, new StringValue(connectSourceHost));
        setValue(CONNECT_SOURCE_SERVICE, new StringValue(connectSourceService));
        setValue(PROTOCOL_TYPE, new StringValue(protocolType));
        setValue(TARGET_PORT, new StringValue(targetPort));
    }
View Full Code Here


                         final String targetDev,
                         final String modelType,
                         final String scriptPath) {
        super();
        this.type = type;
        setValue(TYPE, new StringValue(type));
        setValue(MAC_ADDRESS, new StringValue(macAddress));
        this.sourceNetwork = sourceNetwork;
        setValue(SOURCE_NETWORK, new StringValue(sourceNetwork));
        this.sourceBridge = sourceBridge;
        setValue(SOURCE_BRIDGE, new StringValue(sourceBridge));
        this.targetDev = targetDev;
        setValue(TARGET_DEV, new StringValue(targetDev));
        setValue(MODEL_TYPE, new StringValue(modelType));
        setValue(SCRIPT_PATH, new StringValue(scriptPath));
    }
View Full Code Here

                        final String keymap,
                        final String display,
                        final String xauth) {
        super();
        this.type = type;
        setValue(TYPE, new StringValue(type));
        setValue(PORT, new StringValue(port));
        setValue(LISTEN, new StringValue(listen));
        setValue(PASSWD, new StringValue(passwd));
        setValue(KEYMAP, new StringValue(keymap));
        setValue(DISPLAY, new StringValue(display));
        setValue(XAUTH, new StringValue(xauth));
    }
View Full Code Here

        if (hf) {
            application.invokeLater(new Runnable() {
                @Override
                public void run() {
                    hostField.setBackground(new StringValue(getHost().getEnteredHostOrIp()),
                                            new StringValue(getHost().getEnteredHostOrIp()),
                                            true);
                }
            });
        } else {
            hostField.wrongValue();
            incorrect.add("host");
        }

        if (uf) {
            application.invokeLater(new Runnable() {
                @Override
                public void run() {
                    usernameField.setBackground(new StringValue(getHost().getUsername()),
                                                new StringValue(getHost().getUsername()),
                                                true);
                    if (useSudoField != null) {
                        if (Host.ROOT_USER.equals(us)) {
                            useSudoField.setValueAndWait(new StringValue("false"));
                            useSudoField.setEnabled(false);
                        } else {
                            useSudoField.setValueAndWait(new StringValue("true"));
                            useSudoField.setEnabled(true);
                        }
                    }
                }
            });
        } else {
            usernameField.wrongValue();
            incorrect.add("username");
        }

        if (pf) {
            application.invokeLater(new Runnable() {
                @Override
                public void run() {
                    sshPortField.setBackground(new StringValue(getHost().getSSHPort()),
                                               new StringValue(getHost().getSSHPort()),
                                               true);
                }
            });
        } else {
            sshPortField.wrongValue();
View Full Code Here

        });
        if (!application.getAutoHosts().isEmpty()) {
            application.invokeLater(new Runnable() {
                @Override
                public void run() {
                    hostField.setValue(new StringValue(application.getAutoHosts().get(0)));
                }
            });
            Tools.sleep(3000);
            pressNextButton();
        }
View Full Code Here

            hn = hostname;
        }
        final String regexp = "^[,\\w.-]+$";
        hostField = widgetFactory.createInstance(
                                       Widget.GUESS_TYPE,
                                       new StringValue(hn),
                                       Widget.NO_ITEMS,
                                       regexp,
                                       FIELD_WIDTH,
                                       Widget.NO_ABBRV,
                                       new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                                       Widget.NO_BUTTON);
        if (hostname == null || Host.DEFAULT_HOSTNAME.equals(hostname)) {
            /* so that hostname is not disabled after going back in the wizard*/
            enableHostname = true;
        } else {
            if (!enableHostname) {
                hostField.setEnabled(false);
            }
        }

        addCheckField(hostField);
        hostLabel.setLabelFor(hostField.getComponent());
        inputPane.add(hostField.getComponent());
        hostField.setBackground(new StringValue(getHost().getEnteredHostOrIp()),
                                new StringValue(getHost().getEnteredHostOrIp()),
                                true);

        /* SSH Port */
        final JLabel sshPortLabel = new JLabel(Tools.getString("Dialog.Host.NewHost.SSHPort"));

        inputPane.add(sshPortLabel);
        String sshPort = getHost().getSSHPort();
        if (sshPort == null) {
            sshPort = application.getLastEnteredSSHPort();
            if (sshPort == null) {
                sshPort = DEFAULT_SSH_PORT;
            }
        }
        sshPortField = widgetFactory.createInstance(
                                      Widget.GUESS_TYPE,
                                      new StringValue(sshPort),
                                      Widget.NO_ITEMS,
                                      "^\\d+$",
                                      50,
                                      Widget.NO_ABBRV,
                                      new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                                      Widget.NO_BUTTON);
        addCheckField(sshPortField);
        sshPortLabel.setLabelFor(sshPortField.getComponent());
        inputPane.add(sshPortField.getComponent());
        sshPortField.setBackground(new StringValue(getHost().getSSHPort()),
                                   new StringValue(getHost().getSSHPort()),
                                   true);


        /* Username */
        final JLabel usernameLabel = new JLabel(Tools.getString("Dialog.Host.NewHost.EnterUsername"));

        inputPane.add(usernameLabel);
        String userName = getHost().getUsername();
        if (userName == null) {
            userName = application.getLastEnteredUser();
            if (userName == null) {
                userName = DEFAULT_SSH_ROOT_USER;
            }
        }
        final List<Value> users = new ArrayList<Value>();
        final String user = System.getProperty("user.name");
        if (!DEFAULT_SSH_ROOT_USER.equals(user)) {
            users.add(new StringValue(DEFAULT_SSH_ROOT_USER));
        }
        users.add(new StringValue(user));
        usernameField = widgetFactory.createInstance(
                                   Widget.GUESS_TYPE,
                                   new StringValue(userName),
                                   users.toArray(new Value[users.size()]),
                                   regexp,
                                   FIELD_WIDTH,
                                   Widget.NO_ABBRV,
                                   new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                                   Widget.NO_BUTTON);
        usernameField.setEditable(true);
        addCheckField(usernameField);
        usernameLabel.setLabelFor(usernameField.getComponent());
        inputPane.add(usernameField.getComponent());
        usernameField.setBackground(new StringValue(getHost().getUsername()),
                                    new StringValue(getHost().getUsername()),
                                    true);
        /* use sudo */
        final JLabel useSudoLabel = new JLabel(Tools.getString("Dialog.Host.NewHost.UseSudo"));

        inputPane.add(useSudoLabel);
        Boolean useSudo = getHost().isUseSudo();
        if (useSudo == null) {
            useSudo = application.getLastEnteredUseSudo();
            if (useSudo == null) {
                useSudo = false;
            }
        }
        final Value useSudoValue = new StringValue(useSudo.toString());
        useSudoField = widgetFactory.createInstance(
                                      Widget.GUESS_TYPE,
                                      useSudoValue,
                                      new Value[]{new StringValue("true"), new StringValue("false")},
                                      Widget.NO_REGEXP,
                                      50,
                                      Widget.NO_ABBRV,
                                      new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                                      Widget.NO_BUTTON);
View Full Code Here

        return drbdDevice;
    }

    public void setDrbdDevice(final String drbdDevice) {
        this.drbdDevice = drbdDevice;
        setValue("device", new StringValue(drbdDevice));
    }
View Full Code Here

    }

    @Override
    public Value getValue(final String parameter) {
        if ("ip".equals(parameter)) {
            return new StringValue(ip);
        }
        if ("String".equals(parameter)) {
            return new StringValue(ip);
        } else {
            LOG.appError("getValue: Unknown parameter: " + parameter, "");
            return null;
        }
    }
View Full Code Here

    }

    @Override
    public Value getValue(final String parameter) {
        if ("device".equals(parameter)) {
            return new StringValue(getName());
        } else {
            LOG.appError("getValue: unknown parameter: " + parameter, "");
            return null;
        }
    }
View Full Code Here

    public void init(final WizardDialog previousDialog, final Cluster cluster) {
        super.init(previousDialog, cluster);
        useOpenaisButton = widgetFactory.createInstance(
                Widget.Type.RADIOGROUP,
                Widget.NO_DEFAULT,
                new Value[]{new StringValue(COROSYNC_INIT_SCRIPT), new StringValue(OPENAIS_INIT_SCRIPT)},
                Widget.NO_REGEXP,
                0,
                Widget.NO_ABBRV,
                new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL),
                Widget.NO_BUTTON);
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.