Package lcmc.cluster.ui.widget

Examples of lcmc.cluster.ui.widget.Widget


            ret = false;
        } else if (DRBD_MD_PARAM.equals(param)) {
            if (infoPanel != null) {
                if (!getHost().getWaitForServerStatusLatch()) {
                    final boolean internal = "internal".equals(newValue.getValueForConfig());
                    final Widget ind = getWidget(DRBD_MD_INDEX_PARAM, null);
                    final Widget indW = getWidget(DRBD_MD_INDEX_PARAM,
                    Widget.WIZARD_PREFIX);
                    if (internal) {
                        ind.setValue(DRBD_MD_TYPE_FLEXIBLE);
                        if (indW != null) {
                            indW.setValue(DRBD_MD_TYPE_FLEXIBLE);
                        }
                    }
                    application.invokeLater(new Runnable() {
                        @Override
                        public void run() {
                            ind.setEnabled(!internal);
                        }
                    });
                    if (indW != null) {
                        application.invokeLater(new Runnable() {
                            @Override
                            public void run() {
                                indW.setEnabled(!internal);
                            }
                        });
                    }
                }
            }
View Full Code Here


            final Value defaultValue = getParamDefault(param);
            if (value == null) {
                value = defaultValue;
            }
            final Value oldValue = getParamSaved(param);
            final Widget wi = getWidget(param, null);
            if (!Tools.areEqual(value, oldValue)) {
                getResource().setValue(param, value);
                if (wi != null) {
                    wi.setValueAndWait(value);
                }
            }
        }
    }
View Full Code Here

            }
            final Value value = new StringValue(valueS);
            final Value oldValue = getParamSaved(param);
            if (!Tools.areEqual(value, oldValue)) {
                getResource().setValue(param, value);
                final Widget wi = getWidget(param, null);
                if (wi != null) {
                    wi.setValue(value);
                }
            }
        }
        if (infoPanel == null) {
            application.invokeLater(new Runnable() {
View Full Code Here

    public Check checkResourceFields(final String param, final String[] params) {
        final List<String> incorrect = new ArrayList<String>();
        final List<String> changed = new ArrayList<String>();
        final Check check = new Check(incorrect, changed);
        check.addCheck(super.checkResourceFields(param, params));
        final Widget wi;
        if (getResourceAgent().isHeartbeatClass()) {
            wi = getWidget("1", null);
        } else if (getResourceAgent().isOCFClass()) {
            wi = getWidget("ip", null);
        } else {
            return check;
        }
        if (wi == null) {
            return check;
        }
        wi.setEditable(true);
        wi.selectSubnet();
        final String ip = wi.getStringValue();
        if (!Tools.isIp(ip)) {
            incorrect.add("wrong ip");
        }
        return check;
    }
View Full Code Here

    }

    /** Returns combo box for parameter. */
    @Override
    protected Widget createWidget(final String param, final String prefix, final int width) {
        final Widget paramWi;
        if ("ip".equals(param)) {
            /* get networks */
            Value ip = getPreviouslySelected(param, prefix);
            if (ip == null) {
                ip = getParamSaved(param);
            }
            final Value defaultValue;
            if (ip.isNothingSelected()) {
                defaultValue = new StringValue(ip.getValueForConfig(),
                                               Tools.getString("ClusterBrowser.SelectNetInterface"));
            } else {
                defaultValue = new StringValue(ip.getValueForConfig());
            }
            @SuppressWarnings("unchecked")
            final Value[] networks = nodesToServiceInfos(defaultValue,
                    getName(),
                    getBrowser().getNetworksNode().children());

            final String regexp = "^[\\d.*]*|Select\\.\\.\\.$";
            paramWi = widgetFactory.createInstance(
                                 Widget.Type.COMBOBOX,
                                 ip,
                                 networks,
                                 regexp,
                                 width,
                                 Widget.NO_ABBRV,
                                 new AccessMode(getAccessType(param), isEnabledOnlyInAdvancedMode(param)),
                                 Widget.NO_BUTTON);

            paramWi.setAlwaysEditable(true);
            widgetAdd(param, prefix, paramWi);
        } else {
            paramWi = super.createWidget(param, prefix, width);
        }
        return paramWi;
View Full Code Here

                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)
                                            || !Tools.areEqual(defaultValue, getResource().getDefaultValue(param));
                if (haveChanged) {
                    getResource().setValue(param, value);
                    getResource().setDefaultValue(param, defaultValue);
                    if (wi != null) {
                        wi.setValue(value);
                    }
                }
            }
        }
    }
View Full Code Here

            final GraphicsData graphicsData = graphicDisplays.get(getName());
            if (graphicsData != 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 =
                                               graphicsData.getValue(param);
                            if (savedValue != null) {
                                value = savedValue;
                            }
                        }
                    }
                    if (!Tools.areEqual(value, oldValue)) {
                        getResource().setValue(param, value);
                        if (wi != null) {
                            /* only if it is not changed by user. */
                            wi.setValue(value);
                        }
                    }
                }
            }
        }
View Full Code Here

    }

    /** Returns combo box for parameter. */
    @Override
    protected Widget createWidget(final String param, final String prefix, final int width) {
        final Widget paramWi = super.createWidget(param, prefix, width);
        if (GraphicsData.PORT.equals(param)) {
            if (prefix == null) {
                portWi.put("", paramWi);
            } else {
                portWi.put(prefix, paramWi);
View Full Code Here

                    value = getParamDefault(param);
                }
                final Value oldValue = getParamSaved(param);
                if (!Tools.areEqual(value, oldValue)) {
                    getResource().setValue(param, value);
                    final Widget wi = getWidget(param, null);
                    if (wi != null) {
                        wi.setValue(value);
                    }
                }
            }
        }
    }
View Full Code Here

            if (OPTION_SIZES.containsKey(option)) {
                size = OPTION_SIZES.get(option);
            } else {
                size = 40;
            }
            final Widget w = widgetFactory.createInstance(
                    OPTION_WIDGET_TYPES.get(option),
                    optionDefaults.get(option),
                    optionValues.get(option),
                    '^' + OPTION_REGEXPS.get(option) + "\\s*$",
                    size,
                    Widget.NO_ABBRV,
                    new AccessMode(AccessMode.ADMIN, AccessMode.NORMAL),
                    Widget.NO_BUTTON);
            optionsWidgets.put(option, w);
            w.setAlwaysEditable(true);
            w.addListeners(getOptionListener());
        }

        /* dopd */
        dopdWidget = new JCheckBox(Tools.getString("Dialog.Cluster.HbConfig.UseDopdCheckBox"), null, false);
        dopdWidget.setBackground(Tools.getDefaultColor("ConfigDialog.Background"));
View Full Code Here

TOP

Related Classes of lcmc.cluster.ui.widget.Widget

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.