Package lcmc.common.domain

Examples of lcmc.common.domain.StringValue


    @Override
    protected void setValueAndWait0(final Value item) {
        application.isSwingThread();
        final MComboBox<Value> cb = getInternalComponent();
        if (item == null) {
            cb.setSelectedItem(new StringValue());
        } else {
            cb.setSelectedItem(item);
            if (!Tools.areEqual(item, cb.getSelectedItem())) {
                setAlwaysEditable(true);
                setText(item.getValueForConfig());
View Full Code Here


        return new ItemListener() {
            @Override
            public void itemStateChanged(final ItemEvent e) {
                if (wl.isEnabled()
                    && e.getStateChange() == ItemEvent.SELECTED) {
                    final Value value = new StringValue(((AbstractButton) e.getItem()).getText());
                    final Thread t = new Thread(new Runnable() {
                        @Override
                        public void run() {
                            wl.check(value);
                        }
View Full Code Here

            }
            first = false;
            config.append(host.getHostname());
        }
        /* choices */
        optionValues.put(NODE_OPTION, new Value[]{new StringValue(config.toString()), new StringValue()});
        optionDefaults.put(NODE_OPTION, new StringValue(config.toString()));
        optionValues.put(CRM_OPTION, new Value[]{new StringValue("respawn"),
                                                 new StringValue("on"),
                                                 new StringValue("off")});
        optionValues.put(COMPRESSION_OPTION, new Value[]{new StringValue(),
                                                         new StringValue("zlib"),
                                                         new StringValue("bz2")});
        optionValues.put(TRADITIONAL_COMPRESSION_OPTION,
                         new Value[]{new StringValue(), new StringValue("on"), new StringValue("off")});
        optionValues.put(LOGFACILITY_OPTION, new Value[]{new StringValue("local0"),
                                                         new StringValue("local1"),
                                                         new StringValue("local2"),
                                                         new StringValue("local3"),
                                                         new StringValue("local4"),
                                                         new StringValue("local5"),
                                                         new StringValue("local6"),
                                                         new StringValue("local7"),
                                                         new StringValue("none")});
        optionValues.put(USE_LOGD_OPTION, new Value[]{new StringValue(),
                                                      new StringValue("on"),
                                                      new StringValue("off")});
        optionValues.put(AUTOJOIN_OPTION, new Value[]{new StringValue(),
                                                      new StringValue("any"),
                                                      new StringValue("other"),
                                                      new StringValue("none")});
        configs = new String[hosts.length];
        makeConfigButton.setBackgroundColor(Tools.getDefaultColor("ConfigDialog.Button"));
        makeConfigButton.setEnabled(false);
        makeConfigButton.addActionListener(
            new ActionListener() {
View Full Code Here

                castAddresses.add(new CastAddress(type, iface, addr, serial));
            }
        }
        for (final String option : OPTIONS) {
            if (opValues.containsKey(option)) {
                optionsWidgets.get(option).setValue(new StringValue(opValues.get(option)));
            } else {
                optionsWidgets.get(option).setValue(new StringValue());
            }
        }
    }
View Full Code Here

        if (serviceInfoParent == null || serviceInfoChild == null) {
            /* rsc set placeholder */
            final CrmXml.OrderData orderData = clStatus.getOrderData(ordId);
            final String score = orderData.getScore();
            resourceNode.put(CrmXml.SCORE_CONSTRAINT_PARAM, new StringValue(score));
        } else if (serviceInfoParent.isConstraintPlaceholder() || serviceInfoChild.isConstraintPlaceholder()) {
            /* rsc set edge */
            final ConstraintPHInfo cphi;
            final CrmXml.RscSet rscSet;
            if (serviceInfoParent.isConstraintPlaceholder()) {
                cphi = (ConstraintPHInfo) serviceInfoParent;
                rscSet = cphi.getRscSetConnectionDataOrder().getRscSet2();
            } else {
                cphi = (ConstraintPHInfo) serviceInfoChild;
                rscSet = cphi.getRscSetConnectionDataOrder().getRscSet1();
            }
            resourceNode.put("sequential", new StringValue(rscSet.getSequential()));
            resourceNode.put(CrmXml.REQUIRE_ALL_ATTR, new StringValue(rscSet.getRequireAll()));
            resourceNode.put("action", new StringValue(rscSet.getOrderAction()));
        } else {
            final CrmXml.OrderData orderData = clStatus.getOrderData(ordId);
            if (orderData != null) {
                final String score = orderData.getScore();
                final String symmetrical = orderData.getSymmetrical();
                final String firstAction = orderData.getFirstAction();
                final String thenAction = orderData.getThenAction();

                resourceNode.put(CrmXml.SCORE_CONSTRAINT_PARAM, new StringValue(score));
                resourceNode.put("symmetrical", new StringValue(symmetrical));
                resourceNode.put("first-action", new StringValue(firstAction));
                resourceNode.put("then-action", new StringValue(thenAction));
            }
        }

        final String[] params = getParametersFromXML();
        if (params != null) {
View Full Code Here

                                             Widget.NO_ABBRV,
                                             new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                                             Widget.NO_BUTTON);

        /* serial links */
        final Value[] serialDevs = {new StringValue("/dev/ttyS0"),
                                    new StringValue("/dev/ttyS1"),
                                    new StringValue("/dev/ttyS2"),
                                    new StringValue("/dev/ttyS3")};

        serialWidget = widgetFactory.createInstance(
                                             Widget.GUESS_TYPE,
                                             Widget.NO_DEFAULT,
                                             serialDevs,
                                             Widget.NO_REGEXP,
                                             LINK_COMBOBOX_WIDTH,
                                             Widget.NO_ABBRV,
                                             new AccessMode(AccessMode.RO, AccessMode.NORMAL),
                                             Widget.NO_BUTTON);

        /* this matches something like this: 225.0.0.43 694 1 0
         * if you think that the regexp is too complicated for that, consider,
         * that it must match also during the thing is written.
         * TODO: it does not work very good anyway
         */
        final String regexp = "^\\d{1,3}(\\.\\d{0,3}(\\d\\.\\d{0,3}"
                              + "(\\d\\.\\d{0,3})( \\d{0,3}(\\d \\d{0,3}"
                              + "(\\d \\d{0,3})?)?)?)?)?$";
        addrWidget = widgetFactory.createInstance(
                                     Widget.GUESS_TYPE,
                                     new StringValue("239.192.0.0 694 1 0"),
                                     Widget.NO_ITEMS,
                                     regexp,
                                     ADDR_COMBOBOX_WIDTH,
                                     Widget.NO_ABBRV,
                                     new AccessMode(AccessMode.RO, AccessMode.NORMAL),
View Full Code Here

                    }
                } catch (final UnknownHostException e) {
                    LOG.appWarning("parseHostInfo: cannot parse: net-info: " + line);
                }
            } else if (BRIDGE_INFO_DELIM.equals(type)) {
                newBridges.add(new StringValue(line));
            } else if ("disk-info".equals(type)) {
                final Optional<BlockDevice> blockDevice = createBlockDevice(line);
                if (!blockDevice.isPresent()) {
                    continue;
                }
                final String bdName = blockDevice.get().getName();
                if (bdName != null) {
                    final Matcher drbdM = DRBD_DEV_FILE_PATTERN.matcher(bdName);
                    if (drbdM.matches()) {
                        if (drbdBlockDevices.containsKey(bdName)) {
                            drbdBlockDevices.get(bdName).updateFrom(blockDevice.get());
                        } else {
                            newDrbdBlockDevices.put(bdName, blockDevice.get());
                        }
                    } else {
                        newBlockDevices.put(bdName, blockDevice.get());
                        if (blockDevice.get().getVolumeGroup() == null
                            && bdName.length() > 5 && bdName.indexOf('/', 5) < 0) {
                            final Matcher m = BLOCK_DEV_FILE_PATTERN.matcher(bdName);
                            if (m.matches()) {
                                newBlockDevices.remove(m.group(1));
                            }
                        }
                    }
                }
                final String vg = blockDevice.get().getVolumeGroup();
                if (vg != null) {
                    Set<String> logicalVolumes = newVolumeGroupsLVS.get(vg);
                    if (logicalVolumes == null) {
                        logicalVolumes = new HashSet<String>();
                        newVolumeGroupsLVS.put(vg, logicalVolumes);
                    }
                    final String lv = blockDevice.get().getLogicalVolume();
                    if (lv != null) {
                        logicalVolumes.add(lv);
                    }
                }
                if (blockDevice.get().isPhysicalVolume()) {
                    newPhysicalVolumes.add(blockDevice.get());
                }
            } else if (DISK_SPACE_DELIM.equals(type)) {
                final Matcher dsM = USED_DISK_SPACE_PATTERN.matcher(line);
                if (dsM.matches()) {
                    final String bdName = dsM.group(1);
                    final String used = dsM.group(2);
                    diskSpaces.put(bdName, used);
                }
            } else if ("vg-info".equals(type)) {
                final String[] vgi = line.split("\\s+");
                if (vgi.length == 2) {
                    newVolumeGroups.put(vgi[0], Long.parseLong(vgi[1]));
                } else {
                    LOG.appWarning("parseHostInfo: could not parse volume info: " + line);
                }
            } else if ("filesystems-info".equals(type)) {
                newFileSystems.add(line);
            } else if ("crypto-info".equals(type)) {
                newCryptoModules.add(line);
            } else if ("qemu-keymaps-info".equals(type)) {
                newQemuKeymaps.add(new StringValue(line));
            } else if ("cpu-map-model-info".equals(type)) {
                newCpuMapModels.add(new StringValue(line));
            } else if ("cpu-map-vendor-info".equals(type)) {
                newCpuMapVendors.add(new StringValue(line));
            } else if ("mount-points-info".equals(type)) {
                newMountPoints.add(line);
            } else if ("gui-info".equals(type)) {
                parseGuiInfo(line);
            } else if ("installation-info".equals(type)) {
View Full Code Here

        optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.PAGE_AXIS));
        optionsPanel.setAlignmentY(java.awt.Component.TOP_ALIGNMENT);
        diskInfo.savePreferredValues();
        diskInfo.getResource().setValue(DiskData.TYPE, DiskInfo.FILE_TYPE);
        diskInfo.getResource().setValue(DiskData.TARGET_BUS_TYPE, DiskInfo.BUS_TYPE_CDROM);
        diskInfo.getResource().setValue(DiskData.TARGET_DEVICE, new StringValue("hdc"));
        diskInfo.getResource().setValue(DiskData.DRIVER_TYPE, new StringValue("raw"));
        diskInfo.getResource().setValue(DiskData.DRIVER_CACHE, new StringValue("default"));
        diskInfo.getResource().setValue(DiskData.READONLY, new StringValue("True"));
        diskInfo.getResource().setValue(DiskData.SOURCE_FILE, new StringValue(DiskInfo.LIBVIRT_IMAGE_LOCATION));
        diskInfo.addWizardParams(optionsPanel,
                                 PARAMS,
                                 buttonClass(nextButton()),
                                 application.getDefaultSize("Dialog.vm.Resource.LabelWidth"),
                                 application.getDefaultSize("Dialog.vm.Resource.FieldWidth"),
View Full Code Here

        optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.PAGE_AXIS));
        optionsPanel.setAlignmentY(java.awt.Component.TOP_ALIGNMENT);
        diskInfo.savePreferredValues();
        diskInfo.getResource().setValue(DiskData.TYPE, DiskInfo.FILE_TYPE);
        diskInfo.getResource().setValue(DiskData.TARGET_BUS_TYPE, DiskInfo.BUS_TYPE_IDE);
        diskInfo.getResource().setValue(DiskData.TARGET_DEVICE, new StringValue("hda"));
        diskInfo.getResource().setValue(DiskData.DRIVER_TYPE, new StringValue("raw"));
        diskInfo.getResource().setValue(DiskData.DRIVER_CACHE, new StringValue("default"));
        if ("xen".equals(getVMSVirtualDomainInfo().getWidget(VmsXml.VM_PARAM_DOMAIN_TYPE, null).getStringValue())) {
            diskInfo.getResource().setValue(DiskData.DRIVER_NAME, new StringValue("file"));
        } else {
            diskInfo.getResource().setValue(DiskData.DRIVER_NAME, new StringValue("qemu"));
        }
        diskInfo.getResource().setValue(
                                    DiskData.SOURCE_FILE,
                                    new StringValue("/var/lib/libvirt/images/"
                                                    + getVMSVirtualDomainInfo().getComboBoxValue(VmsXml.VM_PARAM_NAME)
                                                    + ".img"));
        diskInfo.addWizardParams(optionsPanel,
                                 PARAMS,
                                 buttonClass(nextButton()),
View Full Code Here

    void init(final String name, final Browser browser, final DomainInfo domainInfo) {
        super.init(name, browser, domainInfo);
        final List<Host> hosts = getVMSVirtualDomainInfo().getDefinedOnHosts();
        final Set<Value> sds = new LinkedHashSet<Value>();
        sds.add(new StringValue());
        for (final Host h : hosts) {
            for (final String guiOps : h.getGuiOptions(Host.VM_FILESYSTEM_SOURCE_DIR_LXC)) {
                sds.add(new StringValue(guiOps));
            }
        }
        sourceDirs = sds.toArray(new Value[sds.size()]);
    }
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.