Package lcmc.common.domain

Examples of lcmc.common.domain.Value


                                    getVMSVirtualDomainInfo().getFilesystems();
        if (filesystems != null) {
            final FilesystemData filesystemData = filesystems.get(getName());
            if (filesystemData != null) {
                for (final String param : getParametersFromXML()) {
                    final Value oldValue = getParamSaved(param);
                    Value value = getParamSaved(param);
                    final Widget wi = getWidget(param, null);
                    for (final Host h
                            : getVMSVirtualDomainInfo().getDefinedOnHosts()) {
                        final VmsXml vmsXml = getBrowser().getVmsXml(h);
                        if (vmsXml != null) {
                            final Value savedValue =
                                               filesystemData.getValue(param);
                            if (savedValue != null) {
                                value = savedValue;
                            }
                        }
View Full Code Here


        final StringBuilder s = new StringBuilder(30);
        final String name = getName();
        if (name == null) {
            return "new FS...";
        }
        final Value saved;
        final Value type = getComboBoxValue(FilesystemData.TYPE);

        if (MOUNT_TYPE.equals(type)) {
            saved = getParamSaved(FilesystemData.SOURCE_DIR);
        } else {
            saved = getParamSaved(FilesystemData.SOURCE_NAME);
View Full Code Here

    /** Returns combo box for parameter. */
    @Override
    protected Widget createWidget(final String param, final String prefix, final int width) {
        if (FilesystemData.SOURCE_DIR.equals(param)) {
            final Value sourceDir = getParamSaved(FilesystemData.SOURCE_DIR);
            final MyButton fileChooserBtn = widgetFactory.createButton("Browse...");
            application.makeMiniButton(fileChooserBtn);
            final String regexp = ".*[^/]?$";
            final Widget paramWi = widgetFactory.createInstance(
                                     getFieldType(param),
                                     sourceDir,
                                     getParamPossibleChoices(param),
                                     regexp,
                                     width,
                                     Widget.NO_ABBRV,
                                     new AccessMode(getAccessType(param), AccessMode.NORMAL),
                                     fileChooserBtn);
            paramWi.setAlwaysEditable(true);
            if (prefix == null) {
                sourceDirWi.put("", paramWi);
            } else {
                sourceDirWi.put(prefix, paramWi);
            }
            if (Tools.isWindows()) {
                paramWi.setTFButtonEnabled(false);
            }
            fileChooserBtn.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(final ActionEvent e) {
                    final Thread t = new Thread(new Runnable() {
                        @Override
                        public void run() {
                            final String file;
                            final String oldFile = paramWi.getStringValue();
                            if (oldFile == null || oldFile.isEmpty()) {
                                file = LXC_SOURCE_DIR;
                            } else {
                                file = oldFile;
                            }
                            startFileChooser(paramWi,
                                             file,
                                             FILECHOOSER_DIR_ONLY);
                        }
                    });
                    t.start();
                }
            });
            widgetAdd(param, prefix, paramWi);
            return paramWi;
        } else if (FilesystemData.SOURCE_NAME.equals(param)) {
            final Value sourceName = getParamSaved(FilesystemData.SOURCE_NAME);
            final Widget paramWi = widgetFactory.createInstance(
                                    getFieldType(param),
                                    sourceName,
                                    getParamPossibleChoices(param),
                                    Widget.NO_REGEXP,
View Full Code Here

                }
                if (paramWi.getValue() == null
                    || paramWi.getValue().isNothingSelected()) {
                    rpwi.setValueAndWait(null);
                } else {
                    final Value value = paramWi.getValue();
                    rpwi.setValueAndWait(value);
                }
            }
        }
        for (final String param : params) {
View Full Code Here

                        @Override
                        public void run() {
                            if (paramWi.getValue() == null || paramWi.getValue().isNothingSelected()) {
                                realParamWi.setValueAndWait(null);
                            } else {
                                final Value value = paramWi.getValue();
                                realParamWi.setValueAndWait(value);
                            }
                        }
                    });
                    application.waitForSwing();
View Full Code Here

    }

    /** Stores values in the combo boxes in the component c. */
    public void storeComboBoxValues(final String[] params) {
        for (final String param : params) {
            final Value value = getComboBoxValue(param);
            getResource().setValue(param, value);
            final Widget wi = getWidget(param, null);
            if (wi != null) {
                wi.setToolTipText(getToolTipText(param, wi));
            }
View Full Code Here

    /** Returns combo box for one parameter. */
    protected Widget createWidget(final String param, final String prefix, final int width) {
        getResource().setPossibleChoices(param, getParamPossibleChoices(param));
        /* set default value */
        Value initValue = getPreviouslySelected(param, prefix);
        if (initValue == null) {
            final Value value = getParamSaved(param);
            if (value == null || value.isNothingSelected()) {
                if (getResource().isNew()) {
                    initValue = getResource().getPreferredValue(param);
                    if (initValue == null) {
                        initValue = getParamPreferred(param);
                    }
View Full Code Here

    public Value getParamSaved(final String param) {
        return getResource().getValue(param);
    }

    protected String getParamSavedForConfig(final String param) {
        final Value v = getResource().getValue(param);
        if (v == null) {
            return null;
        } else {
            return v.getValueForConfig();
        }
    }
View Full Code Here

    /**
     * Returns on mouse over text for parameter. If value is different
     * from default value, default value will be returned.
     */
    protected final String getToolTipText(final String param, final Widget wi) {
        final Value defaultValue = getParamDefault(param);
        final StringBuilder ret = new StringBuilder(120);
        if (wi != null) {
            final String value = wi.getStringValue();
            ret.append("<b>");
            ret.append(value);
            ret.append("</b>");
        }
        if (defaultValue != null && !defaultValue.isNothingSelected()) {
            ret.append("<table><tr><td><b>");
            ret.append(Tools.getString("Browser.ParamDefault"));
            ret.append("</b></td><td>");
            ret.append(defaultValue);
            ret.append("</td></tr></table>");
View Full Code Here

            for (final String otherParam : params) {
                final Widget wi = getWidget(otherParam, null);
                if (wi == null) {
                    continue;
                }
                Value newValue = wi.getValue();

                /* check if value has changed */
                Value oldValue = getParamSaved(otherParam);
                if (oldValue == null) {
                    oldValue = getParamDefault(otherParam);
                }
                if (!Tools.areEqual(newValue, oldValue)) {
                    changed.add(otherParam + ": " + oldValue + " \u2192 " + newValue);
View Full Code Here

TOP

Related Classes of lcmc.common.domain.Value

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.