Package com.smartgwt.client.widgets.form.fields

Examples of com.smartgwt.client.widgets.form.fields.RadioGroupItem


        this.executionModeForm = new EnhancedDynamicForm(isReadOnly());
        this.executionModeForm.setNumCols(2);
        this.executionModeForm.setColWidths(FIRST_COLUMN_WIDTH, "*");

        RadioGroupItem executionModeItem = new RadioGroupItem(FIELD_EXECUTION_MODE,
            MSG.view_group_operationScheduleDetails_field_execute());
        LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>(2);
        valueMap.put(EXECUTION_ORDER_PARALLEL, MSG.view_group_operationScheduleDetails_value_parallel());
        valueMap.put(EXECUTION_ORDER_SEQUENTIAL, MSG.view_group_operationScheduleDetails_value_sequential());
        executionModeItem.setValueMap(valueMap);
        executionModeItem.setDefaultValue(EXECUTION_ORDER_PARALLEL);
        executionModeItem.setShowTitle(true);

        final CheckboxItem haltOnFailureItem = new CheckboxItem(GroupOperationScheduleDataSource.Field.HALT_ON_FAILURE,
            MSG.view_group_operationScheduleDetails_field_haltOnFailure());
        haltOnFailureItem.setDefaultValue(false);
        haltOnFailureItem.setVisible(false);
        haltOnFailureItem.setLabelAsTitle(true);
        haltOnFailureItem.setShowTitle(true);

        this.executionModeForm.setFields(executionModeItem, haltOnFailureItem);

        contentPane.addMember(this.executionModeForm);

        HLayout hLayout = new HLayout();
        VLayout horizontalSpacer = new VLayout();
        horizontalSpacer.setWidth(140);
        hLayout.addMember(horizontalSpacer);
        ResourceCategory resourceCategory = this.groupComposite.getResourceGroup().getResourceType().getCategory();
        String memberIcon = ImageManager.getResourceIcon(resourceCategory);
        HoverCustomizer nameHoverCustomizer = new HoverCustomizer() {
            public String hoverHTML(Object value, ListGridRecord listGridRecord, int rowNum, int colNum) {
                return AncestryUtil.getAncestryHoverHTML(listGridRecord, 0);
            }
        };
        this.memberExecutionOrderer = new ReorderableList(this.memberResourceRecords, null, memberIcon,
            nameHoverCustomizer);
        this.memberExecutionOrderer.setVisible(false);
        this.memberExecutionOrderer.setNameFieldTitle(MSG.view_group_operationScheduleDetails_memberResource());
        hLayout.addMember(this.memberExecutionOrderer);
        contentPane.addMember(hLayout);

        executionModeItem.addChangedHandler(new ChangedHandler() {
            public void onChanged(ChangedEvent event) {
                if (event.getValue().equals(EXECUTION_ORDER_PARALLEL)) {
                    haltOnFailureItem.hide();
                    memberExecutionOrderer.hide();
                } else {
View Full Code Here


        List<FormItem> automaticDeploymentItems = builder.withName(FIELD_AUTOMATIC_DEPLOYMENT)
            .withTitle(MSG.view_adminTopology_storageNodes_clusterSettings_deployments_autoDeploy_title())
            .withValue(Boolean.toString(settings.getAutomaticDeployment()))
            .withDescription(MSG.view_adminTopology_storageNodes_clusterSettings_deployments_autoDeploy())
            .withReadOnlySetTo(readOnly).build((FormItem) GWT.create(RadioGroupItem.class));
        RadioGroupItem autoDeployRadio = (RadioGroupItem) automaticDeploymentItems.get(1);
        autoDeployRadio.setVertical(false);
        LinkedHashMap<String, String> values = new LinkedHashMap<String, String>(2);
        values.put("true", "On");
        values.put("false", "Off");
        autoDeployRadio.setValueMap(values);
        autoDeployRadio.setValue(settings.getAutomaticDeployment());
        items.addAll(automaticDeploymentItems);
        deploymentForm.setFields(items.toArray(new FormItem[items.size()]));

        credentialsForm = buildForm("<div align='left' class='storageConfig'><div>"
            + MSG.view_adminTopology_storageNodes_clusterSettings_credentials() + "</div><div>"
            + MSG.view_adminTopology_storageNodes_clusterSettings_credentials_desc() + "</div>");
        FormItemBuilder.resetOddRow();
        items = buildHeaderItems();

        // username field
        StringLengthValidator usernameValidator = new StringLengthValidator(4, 100, false);
        builder = new FormItemBuilder();
        List<FormItem> usernameItems = builder.withName(FIELD_USERNAME).withTitle(MSG.common_title_username())
            .withDescription(MSG.view_adminTopology_storageNodes_clusterSettings_credentials_username())
            .withValue(settings.getUsername()).withReadOnlySetTo(true).withValidators(usernameValidator).build();
        items.addAll(usernameItems);

        // password field
        StringLengthValidator passwordValidator1 = new StringLengthValidator(6, 100, false);
        passwordValidator1.setErrorMessage(MSG.view_adminTopology_storageNodes_clusterSettings_credentials_err1());
        // due to SmartGWT bug that changes focus after each input (https://code.google.com/p/smartgwt/issues/detail?id=309)
        passwordValidator1.setValidateOnChange(false);
        builder = new FormItemBuilder();
        List<FormItem> passwordItems = builder.withName(FIELD_PASSWORD).withTitle(MSG.common_title_password())
            .withDescription(MSG.view_adminTopology_storageNodes_clusterSettings_credentials_password())
            .withValue(settings.getPasswordHash()).withReadOnlySetTo(readOnly).withValidators(passwordValidator1)
            .withAttribute("autocomplete", "off").build((FormItem) GWT.create(PasswordItem.class));
        items.addAll(passwordItems);

        // password_verify field
        builder = new FormItemBuilder();
        passwordValidator1 = new StringLengthValidator(6, 100, false);
        passwordValidator1.setErrorMessage(MSG.view_adminTopology_storageNodes_clusterSettings_credentials_err1());
        MatchesFieldValidator passwordValidator2 = new MatchesFieldValidator();
        passwordValidator2.setOtherField(FIELD_PASSWORD);
        passwordValidator2.setErrorMessage(MSG.view_adminTopology_storageNodes_clusterSettings_credentials_err2());
        // due to same bug in SmartGWT as above
        passwordValidator1.setValidateOnChange(false);
        passwordValidator2.setValidateOnChange(false);
        List<FormItem> passwordVerifyItems = builder.withName(FIELD_PASSWORD_VERIFY)
            .withTitle(MSG.view_adminTopology_storageNodes_clusterSettings_credentials_verify_title())
            .withValue(settings.getPasswordHash())
            .withDescription(MSG.view_adminTopology_storageNodes_clusterSettings_credentials_verify())
            .withReadOnlySetTo(readOnly).withValidators(passwordValidator1, passwordValidator2)
            .withAttribute("autocomplete", "off").build((FormItem) GWT.create(PasswordItem.class));

        items.addAll(passwordVerifyItems);
        credentialsForm.setFields(items.toArray(new FormItem[items.size()]));

        validator = new IntegerRangeValidator();
        ((IntegerRangeValidator) validator).setMin(0);

        regularSnapshotsForm = buildForm("<div align='left' class='storageConfig'><div>"
            + MSG.view_adminTopology_storageNodes_clusterSettings_snapshotManagement() + "</div><div>"
            + MSG.view_adminTopology_storageNodes_clusterSettings_snapshotManagement_desc() + "</div>");
        FormItemBuilder.resetOddRow();
        items = buildHeaderItems();

        builder = new FormItemBuilder();
        List<FormItem> snapshotsEnabledFormItems = builder.withName(FIELD_SNAPSHOTS_ENABLED)
            .withTitle(MSG.view_adminTopology_storageNodes_clusterSettings_snapshotManagement_enabled_title())
            .withValue(Boolean.toString(settings.getRegularSnapshots().getEnabled()))
            .withDescription(MSG.view_adminTopology_storageNodes_clusterSettings_snapshotManagement_enabled_desc())
            .build((FormItem) GWT.create(RadioGroupItem.class));
        RadioGroupItem snapshotsEnabledRadio = (RadioGroupItem) snapshotsEnabledFormItems.get(1);
        snapshotsEnabledRadio.setVertical(false);
        values = new LinkedHashMap<String, String>(2);
        values.put("true", "On");
        values.put("false", "Off");
        snapshotsEnabledRadio.setValueMap(values);
        snapshotsEnabledRadio.setValue(settings.getRegularSnapshots().getEnabled());
        items.addAll(snapshotsEnabledFormItems);

        List<FormItem> snapshotsScheduleFormItems = builder.withName(FIELD_SNAPSHOTS_SCHEDULE)
            .withTitle(MSG.view_adminTopology_storageNodes_clusterSettings_snapshotManagement_schedule_title())
            .withValue(settings.getRegularSnapshots().getSchedule())
View Full Code Here

            public void onChanged(ChangedEvent event) {
                buildExpressionValue();
            }
        });

        this.unsetItem = new RadioGroupItem("unset", MSG.view_dynagroup_exprBuilder_unset());
        this.unsetItem.setTooltip(MSG.view_dynagroup_exprBuilder_unset_tooltip());
        this.unsetItem.setHoverWidth(250);
        this.unsetItem.setDefaultValue(MSG.common_val_no());
        this.unsetItem.setValueMap(MSG.common_val_yes(), MSG.common_val_no());
        this.unsetItem.setVertical(false);
        this.unsetItem.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                enableDisableComponents();
                buildExpressionValue();
            }
        });

        this.propertyNameItem = new SelectItem("propertyName", MSG.view_dynagroup_exprBuilder_propertyName());
        this.propertyNameItem.setTooltip(MSG.view_dynagroup_exprBuilder_propertyName_tooltip());
        this.propertyNameItem.setHoverWidth(250);
        this.propertyNameItem.setRedrawOnChange(true);
        this.propertyNameItem.setWidth("*");
        this.propertyNameItem.setDefaultToFirstOption(true);
        this.propertyNameItem.setEmptyDisplayValue(MSG.view_dynagroup_exprBuilder_noProperties());
        this.propertyNameItem.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                buildExpressionValue();
            }
        });

        this.resourceTypeItem = new SortedSelectItem("resourceType", MSG.view_dynagroup_exprBuilder_resourceType());
        this.resourceTypeItem.setTooltip(MSG.view_dynagroup_exprBuilder_resourceType_tooltip());
        this.resourceTypeItem.setHoverWidth(250);
        this.resourceTypeItem.setRedrawOnChange(true);
        this.resourceTypeItem.setWidth("*");
        this.resourceTypeItem.setDefaultToFirstOption(true);
        this.resourceTypeItem.setEmptyDisplayValue(MSG.view_dynagroup_exprBuilder_noResourceTypes());
        this.resourceTypeItem.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                loadPropertyNameDropDown();
            }
        });

        this.pluginItem = new SortedSelectItem("plugin", MSG.view_dynagroup_exprBuilder_definingPlugin());
        this.pluginItem.setTooltip(MSG.view_dynagroup_exprBuilder_definingPlugin_tooltip());
        this.pluginItem.setHoverWidth(250);
        this.pluginItem.setRedrawOnChange(true);
        this.pluginItem.setWidth("*");
        this.pluginItem.setDefaultToFirstOption(true);
        this.pluginItem.setEmptyDisplayValue(MSG.view_dynagroup_exprBuilder_noPlugins());
        this.pluginItem.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                Object newValue = event.getValue();
                if (newValue != null) {
                    loadResourceTypeDropDown(newValue.toString());
                }
            }
        });
        GWTServiceLookup.getPluginService().getAgentPlugins(false, new AsyncCallback<ArrayList<Plugin>>() {
            @Override
            public void onSuccess(ArrayList<Plugin> result) {
                plugins.clear();
                for (Plugin plugin : result) {
                    if (plugin.isEnabled()) {
                        plugins.add(plugin.getName());
                    }
                }
                Collections.sort(plugins);
                pluginItem.setValueMap(plugins.toArray(new String[plugins.size()]));
                pluginItem.clearValue();

                // do the initial population of the resource type drop down
                if (!plugins.isEmpty()) {
                    loadResourceTypeDropDown(plugins.get(0));
                }

                markForRedraw();
            }

            @Override
            public void onFailure(Throwable caught) {
                CoreGUI.getErrorHandler().handleError(MSG.view_dynagroup_exprBuilder_pluginLoadFailure(), caught);
            }
        });

        this.expressionTypeItem = new SortedSelectItem("expressionType",
            MSG.view_dynagroup_exprBuilder_expressionType());
        this.expressionTypeItem.setTooltip(MSG.view_dynagroup_exprBuilder_expressionType_tooltip());
        this.expressionTypeItem.setHoverWidth(250);
        this.expressionTypeItem.setRedrawOnChange(true);
        this.expressionTypeItem.setWidth("*");
        this.expressionTypeItem.setDefaultToFirstOption(true);
        this.expressionTypeItem.setValueMap(MSG.view_dynagroup_exprBuilder_expressionType_resource(), //
            MSG.view_dynagroup_exprBuilder_expressionType_resourceType(), //
            MSG.view_dynagroup_exprBuilder_expressionType_resourceCategory(), //
            MSG.view_dynagroup_exprBuilder_expressionType_trait(), //
            MSG.view_dynagroup_exprBuilder_expressionType_pluginConfig(), //
            MSG.view_dynagroup_exprBuilder_expressionType_resourceConfig());
        this.expressionTypeItem.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                enableDisableComponents();
                loadPropertyNameDropDown();
            }
        });

        this.resourceItem = new SortedSelectItem("resource", MSG.view_dynagroup_exprBuilder_resource());
        this.resourceItem.setTooltip(MSG.view_dynagroup_exprBuilder_resource_tooltip());
        this.resourceItem.setHoverWidth(250);
        this.resourceItem.setRedrawOnChange(true);
        this.resourceItem.setWidth("*");
        this.resourceItem.setDefaultToFirstOption(true);
        this.resourceItem.setValueMap(MSG.view_dynagroup_exprBuilder_resource_resource(), //
            MSG.view_dynagroup_exprBuilder_resource_child(), //
            MSG.view_dynagroup_exprBuilder_resource_parent(), //
            MSG.view_dynagroup_exprBuilder_resource_grandparent(), //
            MSG.view_dynagroup_exprBuilder_resource_greatGrandparent(), //
            MSG.view_dynagroup_exprBuilder_resource_greatGreatGrandparent());
        this.resourceItem.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                buildExpressionValue();
            }
        });

        this.memberOfItem = new RadioGroupItem("memberOf", MSG.view_dynagroup_exprBuilder_memberOf());
        this.memberOfItem.setTooltip(MSG.view_dynagroup_exprBuilder_memberOf_tooltip());
        this.memberOfItem.setHoverWidth(250);
        this.memberOfItem.setDefaultValue(MSG.common_val_no());
        this.memberOfItem.setValueMap(MSG.common_val_yes(), MSG.common_val_no());
        this.memberOfItem.setVertical(false);
        this.memberOfItem.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                enableDisableComponents();
                buildExpressionValue();
            }
        });

        this.memberOfGroupItem = new SingleResourceGroupSelectorItem("memberOfGroup", MSG.common_title_group(), null);
        this.memberOfGroupItem.setTooltip(MSG.view_dynagroup_exprBuilder_groupBy_tooltip());
        this.memberOfGroupItem.setHoverWidth(250);
        this.memberOfGroupItem.setRedrawOnChange(true);
        this.memberOfGroupItem.setWidth("*");
        this.memberOfGroupItem.setDefaultToFirstOption(true);
        this.memberOfGroupItem.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                buildExpressionValue();
            }
        });

        this.groupByItem = new RadioGroupItem("groupBy", MSG.view_dynagroup_exprBuilder_groupBy());
        this.groupByItem.setTooltip(MSG.view_dynagroup_exprBuilder_groupBy_tooltip());
        this.groupByItem.setHoverWidth(250);
        this.groupByItem.setDefaultValue(MSG.common_val_no());
        this.groupByItem.setValueMap(MSG.common_val_yes(), MSG.common_val_no());
        this.groupByItem.setVertical(false);
View Full Code Here

                    }
                }
            });
            FormUtility.addContextualHelp(deployDirTextItem, MSG.view_bundle_deployWizard_getDest_deployDir_help());

            this.destSpecItem = new RadioGroupItem("destSpec",
                MSG.view_bundle_deployWizard_getDest_destBaseDirName());
            this.destSpecItem.setWidth(300);
            this.destSpecItem.setRequired(true);
            this.destSpecItem.setDisabled(true);
            this.destSpecItem.addChangedHandler(new ChangedHandler() {
View Full Code Here

        this.modeForm = new EnhancedDynamicForm(this.isReadOnly);
        this.modeForm.setNumCols(3);
        this.modeForm.setColWidths("140", "220", "*");

        RadioGroupItem modeItem = new RadioGroupItem(FIELD_MODE, MSG.widget_jobTriggerEditor_field_mode());
        LinkedHashMap<String, String> modeValueMap = new LinkedHashMap<String, String>();
        modeValueMap.put("calendar", MSG.widget_jobTriggerEditor_value_calendar());
        modeValueMap.put("cron", MSG.widget_jobTriggerEditor_value_cronExpression());
        modeItem.setValueMap(modeValueMap);
        modeItem.setVertical(false);
        modeItem.setShowTitle(true);
        modeItem.setValue("calendar");

        this.modeForm.setFields(modeItem);
        addMember(this.modeForm);

        this.calendarModeLayout = new EnhancedVLayout();

        this.calendarTypeForm = new EnhancedDynamicForm(this.isReadOnly);

        RadioGroupItem calendarTypeItem = new RadioGroupItem("calendarType");
        calendarTypeItem.setWidth(440);
        calendarTypeItem.setShowTitle(false);
        LinkedHashMap<String, String> calendarTypeValueMap = new LinkedHashMap<String, String>();
        calendarTypeValueMap.put("now", MSG.widget_jobTriggerEditor_value_now());
        calendarTypeValueMap.put("nowAndRepeat", MSG.widget_jobTriggerEditor_value_nowAndRepeat());
        calendarTypeValueMap.put("later", MSG.widget_jobTriggerEditor_value_later());
        calendarTypeValueMap.put("laterAndRepeat", MSG.widget_jobTriggerEditor_value_laterAndRepeat());
        calendarTypeItem.setValueMap(calendarTypeValueMap);
        calendarTypeItem.setVertical(false);
        calendarTypeItem.setValue("now");

        this.calendarTypeForm.setFields(calendarTypeItem);

        this.calendarModeLayout.addMember(this.calendarTypeForm);
        addMember(this.calendarModeLayout);

        this.cronModeLayout = new EnhancedVLayout();
        this.cronModeLayout.setVisible(false);

        this.cronForm = new DynamicForm();

        TextItem cronExpressionItem = new TextItem(FIELD_CRON_EXPRESSION,
            MSG.widget_jobTriggerEditor_field_cronExpression());
        cronExpressionItem.setRequired(true);
        cronExpressionItem.setWidth(340);

        this.cronForm.setFields(cronExpressionItem);

        this.cronModeLayout.addMember(this.cronForm);

        final TabSet cronHelpTabSet = new TabSet();
        cronHelpTabSet.setWidth100();
        cronHelpTabSet.setHeight(200);
        Img closeIcon = new Img("[SKIN]/headerIcons/close.png", 16, 16);
        closeIcon.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                cronHelpTabSet.hide();
            }
        });
        cronHelpTabSet.setTabBarControls(closeIcon);

        Tab formatTab = new Tab(MSG.widget_jobTriggerEditor_tab_format());
        HTMLFlow formatPane = new HTMLFlow();
        formatPane.setWidth100();
        formatPane
            .setContents("<p>A cron expression is a string comprised of 6 or 7 fields separated by white space. Fields can contain any of the\n"
                + "allowed values, along with various combinations of the allowed special characters for that field. The fields are as\n"
                + "follows:</p>\n"
                + "<table cellpadding=\"3\" cellspacing=\"1\">\n"
                + "    <tbody>\n"
                + "\n"
                + "        <tr>\n"
                + "            <th>Field Name</th>\n"
                + "            <th>Mandatory</th>\n"
                + "            <th>Allowed Values</th>\n"
                + "            <th>Allowed Special Characters</th>\n"
                + "        </tr>\n"
                + "        <tr>\n"
                + "\n"
                + "            <td>Seconds</td>\n"
                + "            <td>YES</td>\n"
                + "\n"
                + "            <td>0-59</td>\n"
                + "            <td>, - * /</td>\n"
                + "        </tr>\n"
                + "        <tr>\n"
                + "\n"
                + "            <td>Minutes</td>\n"
                + "            <td>YES</td>\n"
                + "            <td>0-59</td>\n"
                + "\n"
                + "            <td>, - * /</td>\n"
                + "        </tr>\n"
                + "        <tr>\n"
                + "\n"
                + "            <td>Hours</td>\n"
                + "            <td>YES</td>\n"
                + "            <td>0-23</td>\n"
                + "            <td>, - * /</td>\n"
                + "\n"
                + "        </tr>\n"
                + "        <tr>\n"
                + "\n"
                + "            <td>Day of month</td>\n"
                + "            <td>YES</td>\n"
                + "            <td>1-31</td>\n"
                + "            <td>, - * ? / L W<br clear=\"all\" />\n"
                + "            </td>\n"
                + "        </tr>\n"
                + "        <tr>\n"
                + "\n"
                + "            <td>Month</td>\n"
                + "            <td>YES</td>\n"
                + "            <td>1-12 or JAN-DEC</td>\n"
                + "            <td>, - * /</td>\n"
                + "        </tr>\n"
                + "        <tr>\n"
                + "\n"
                + "            <td>Day of week</td>\n"
                + "\n"
                + "            <td>YES</td>\n"
                + "            <td>1-7 or SUN-SAT</td>\n"
                + "            <td>, - * ? / L #</td>\n"
                + "        </tr>\n"
                + "        <tr>\n"
                + "\n"
                + "            <td>Year</td>\n"
                + "            <td>NO</td>\n"
                + "\n"
                + "            <td>empty, 1970-2099</td>\n"
                + "            <td>, - * /</td>\n"
                + "        </tr>\n"
                + "    </tbody>\n"
                + "\n"
                + "</table>\n"
                + "<p>So cron expressions can be as simple as this: <tt>0 * * ? * *</tt> to run every minute on the minute<br />\n"
                + "or more complex, like this: <tt>0/5 14,18,3-39,52 * ? JAN,MAR,SEP MON-FRI 2002-2015</tt></p>\n"
                + "\n"
                + "<h2><a name=\"CronTriggersTutorial-Specialcharacters\"></a>Special Characters</h2>\n"
                + "\n"
                + "<ul>\n"
                + "    <li><tt><b>&#42;</b></tt> (<em>\"all values\"</em>) - used to select all values within a field. For example, \"*\"\n"
                + "    in the minute field means <em>\"every minute\"</em>.</li>\n"
                + "\n"
                + "</ul>\n"
                + "\n"
                + "\n"
                + "<ul>\n"
                + "    <li><tt><b>?</b></tt> (<em>\"no specific value\"</em>) - useful when you need to specify something in one of the\n"
                + "    two fields in which the character is allowed, but not the other. For example, if I want my trigger to fire on a\n"
                + "    particular day of the month (say, the 10th), but don't care what day of the week that happens to be, I would put\n"
                + "    \"10\" in the day-of-month field, and \"?\" in the day-of-week field. See the examples below for clarification.</li>\n"
                + "\n"
                + "</ul>\n"
                + "\n"
                + "\n"
                + "<ul>\n"
                + "    <li><tt><b>&#45;</b></tt> &#45; used to specify ranges. For example, \"10-12\" in the hour field means <em>\"the\n"
                + "    hours 10, 11 and 12\"</em>.</li>\n"
                + "\n"
                + "</ul>\n"
                + "\n"
                + "\n"
                + "<ul>\n"
                + "    <li><tt><b>,</b></tt> &#45; used to specify additional values. For example, \"MON,WED,FRI\" in the day-of-week\n"
                + "    field means <em>\"the days Monday, Wednesday, and Friday\"</em>.</li>\n"
                + "\n"
                + "</ul>\n"
                + "\n"
                + "\n"
                + "<ul>\n"
                + "\n"
                + "    <li><tt><b>/</b></tt> &#45; used to specify increments. For example, \"0/15\" in the seconds field means <em>\"the\n"
                + "    seconds 0, 15, 30, and 45\"</em>. And \"5/15\" in the seconds field means <em>\"the seconds 5, 20, 35, and 50\"</em>. You can\n"
                + "    also specify '/' after the '<b>' character - in this case '</b>' is equivalent to having '0' before the '/'. '1/3'\n"
                + "    in the day-of-month field means <em>\"fire every 3 days starting on the first day of the month\"</em>.</li>\n"
                + "\n"
                + "</ul>\n"
                + "\n"
                + "<ul>\n"
                + "    <li><tt><b>L</b></tt> (<em>\"last\"</em>) - has different meaning in each of the two fields in which it is\n"
                + "    allowed. For example, the value \"L\" in the day-of-month field means <em>\"the last day of the month\"</em> &#45; day\n"
                + "    31 for January, day 28 for February on non-leap years. If used in the day-of-week field by itself, it simply means\n"
                + "    \"7\" or \"SAT\". But if used in the day-of-week field after another value, it means <em>\"the last xxx day of the\n"
                + "    month\"</em> &#45; for example \"6L\" means <em>\"the last friday of the month\"</em>. When using the 'L' option, it is\n"
                + "    important not to specify lists, or ranges of values, as you'll get confusing results.</li>\n"
                + "\n"
                + "</ul>\n"
                + "\n"
                + "\n"
                + "<ul>\n"
                + "    <li><tt><b>W</b></tt> (<em>\"weekday\"</em>) - used to specify the weekday (Monday-Friday) nearest the given day.\n"
                + "    As an example, if you were to specify \"15W\" as the value for the day-of-month field, the meaning is: <em>\"the\n"
                + "    nearest weekday to the 15th of the month\"</em>. So if the 15th is a Saturday, the trigger will fire on Friday the 14th.\n"
                + "    If the 15th is a Sunday, the trigger will fire on Monday the 16th. If the 15th is a Tuesday, then it will fire on\n"
                + "    Tuesday the 15th. However if you specify \"1W\" as the value for day-of-month, and the 1st is a Saturday, the trigger\n"
                + "    will fire on Monday the 3rd, as it will not 'jump' over the boundary of a month's days. The 'W' character can only\n"
                + "    be specified when the day-of-month is a single day, not a range or list of days.\n"
                + "        <div class=\"tip\">\n"
                + "            The 'L' and 'W' characters can also be combined in the day-of-month field to yield 'LW', which\n"
                + "            translates to <em>\"last weekday of the month\"</em>.\n"
                + "        </div>\n"
                + "\n"
                + "    </li>\n"
                + "\n"
                + "    <li><tt><b>&#35;</b></tt> &#45; used to specify \"the nth\" XXX day of the month. For example, the value of \"6#3\"\n"
                + "    in the day-of-week field means <em>\"the third Friday of the month\"</em> (day 6 = Friday and \"#3\" = the 3rd one in\n"
                + "    the month). Other examples: \"2#1\" = the first Monday of the month and \"4#5\" = the fifth Wednesday of the month. Note\n"
                + "    that if you specify \"#5\" and there is not 5 of the given day-of-week in the month, then no firing will occur that\n"
                + "    month.\n"
                + "        <div class=\"tip\">\n"
                + "            The legal characters and the names of months and days of the week are not case sensitive. <tt>MON</tt>\n"
                + "            is the same as <tt>mon</tt>.\n"
                + "        </div>\n"
                + "\n"
                + "    </li>\n"
                + "</ul>"
                + "<h2><a name=\"CronTriggersTutorial-Notes\"></a>Notes</h2>\n"
                + "\n"
                + "<ul>\n"
                + "    <li>Support for specifying both a day-of-week and a day-of-month value is not complete (you must currently use\n"
                + "    the '?' character in one of these fields).</li>\n"
                + "    <li>Be careful when setting fire times between mid-night and 1:00 AM - \"daylight savings\" can cause a skip or a\n"
                + "    repeat depending on whether the time moves back or jumps forward.</li>\n" + "\n" + "</ul>");
        formatTab.setPane(formatPane);

        Tab examplesTab = new Tab(MSG.widget_jobTriggerEditor_tab_examples());
        HTMLFlow examplesPane = new HTMLFlow();
        examplesPane.setWidth100();
        examplesPane.setContents("<table cellpadding=\"3\" cellspacing=\"1\">\n" + "    <tbody>\n" + "        <tr>\n"
            + "            <th>Expression</th>\n" + "\n" + "            <th>Meaning</th>\n" + "        </tr>\n"
            + "        <tr>\n" + "            <td><tt>0 0 12 * * ?</tt></td>\n" + "\n"
            + "            <td>Fire at 12pm (noon) every day</td>\n" + "        </tr>\n" + "        <tr>\n" + "\n"
            + "            <td><tt>0 15 10 ? * *</tt></td>\n" + "            <td>Fire at 10:15am every day</td>\n"
            + "        </tr>\n" + "        <tr>\n" + "            <td><tt>0 15 10 * * ?</tt></td>\n" + "\n"
            + "            <td>Fire at 10:15am every day</td>\n" + "\n" + "        </tr>\n" + "        <tr>\n"
            + "            <td><tt>0 15 10 * * ? *</tt></td>\n" + "            <td>Fire at 10:15am every day</td>\n"
            + "        </tr>\n" + "        <tr>\n" + "            <td><tt>0 15 10 * * ? 2005</tt></td>\n" + "\n"
            + "            <td>Fire at 10:15am every day during the year 2005</td>\n" + "        </tr>\n"
            + "        <tr>\n" + "            <td><tt>0 * 14 * * ?</tt></td>\n"
            + "            <td>Fire every minute starting at 2pm and ending at 2:59pm, every day</td>\n"
            + "        </tr>\n" + "        <tr>\n" + "\n" + "            <td><tt>0 0/5 14 * * ?</tt></td>\n" + "\n"
            + "            <td>Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day</td>\n"
            + "        </tr>\n" + "        <tr>\n" + "            <td><tt>0 0/5 14,18 * * ?</tt></td>\n"
            + "            <td>Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5\n"
            + "            minutes starting at 6pm and ending at 6:55pm, every day</td>\n" + "\n" + "        </tr>\n"
            + "        <tr>\n" + "            <td><tt>0 0-5 14 * * ?</tt></td>\n" + "\n"
            + "            <td>Fire every minute starting at 2pm and ending at 2:05pm, every day</td>\n"
            + "        </tr>\n" + "        <tr>\n" + "            <td><tt>0 10,44 14 ? 3 WED</tt></td>\n" + "\n"
            + "            <td>Fire at 2:10pm and at 2:44pm every Wednesday in the month of March.</td>\n"
            + "        </tr>\n" + "        <tr>\n" + "            <td><tt>0 15 10 ? * MON-FRI</tt></td>\n" + "\n"
            + "            <td>Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday</td>\n"
            + "        </tr>\n" + "        <tr>\n" + "\n" + "            <td><tt>0 15 10 15 * ?</tt></td>\n"
            + "            <td>Fire at 10:15am on the 15th day of every month</td>\n" + "        </tr>\n"
            + "        <tr>\n" + "            <td><tt>0 15 10 L * ?</tt></td>\n" + "\n"
            + "            <td>Fire at 10:15am on the last day of every month</td>\n" + "\n" + "        </tr>\n"
            + "        <tr>\n" + "            <td><tt>0 15 10 ? * 6L</tt></td>\n"
            + "            <td>Fire at 10:15am on the last Friday of every month</td>\n" + "        </tr>\n"
            + "        <tr>\n" + "            <td><tt>0 15 10 ? * 6L</tt></td>\n" + "\n"
            + "            <td>Fire at 10:15am on the last Friday of every month</td>\n" + "        </tr>\n"
            + "        <tr>\n" + "            <td><tt>0 15 10 ? * 6L 2002-2005</tt></td>\n"
            + "            <td>Fire at 10:15am on every last friday of every month during the years 2002,\n"
            + "            2003, 2004 and 2005</td>\n" + "        </tr>\n" + "        <tr>\n" + "\n"
            + "            <td><tt>0 15 10 ? * 6#3</tt></td>\n" + "\n"
            + "            <td>Fire at 10:15am on the third Friday of every month</td>\n" + "        </tr>\n"
            + "        <tr>\n" + "            <td><tt>0 0 12 1/5 * ?</tt></td>\n"
            + "            <td>Fire at 12pm (noon) every 5 days every month, starting on the first day of the\n"
            + "            month.</td>\n" + "\n" + "        </tr>\n" + "        <tr>\n"
            + "            <td><tt>0 11 11 11 11 ?</tt></td>\n" + "\n"
            + "            <td>Fire every November 11th at 11:11am.</td>\n" + "        </tr>\n" + "    </tbody>\n"
            + "</table>");
        examplesTab.setPane(examplesPane);

        cronHelpTabSet.addTab(formatTab);
        cronHelpTabSet.addTab(examplesTab);

        cronHelpTabSet.setVisible(false);

        FormItemIcon helpIcon = new FormItemIcon();
        helpIcon.setSrc("[SKIN]/actions/help.png");
        cronExpressionItem.setIcons(helpIcon);
        cronExpressionItem.addIconClickHandler(new IconClickHandler() {
            public void onIconClick(IconClickEvent event) {
                cronHelpTabSet.show();
            }
        });

        this.cronModeLayout.addMember(cronHelpTabSet);
        addMember(this.cronModeLayout);

        modeItem.addChangedHandler(new ChangedHandler() {
            public void onChanged(ChangedEvent event) {
                String mode = (String) event.getValue();
                changeMode(mode);
            }
        });

        this.laterForm = createLaterForm();
        this.calendarModeLayout.addMember(this.laterForm);

        this.repeatForm = createRepeatForm();
        this.calendarModeLayout.addMember(this.repeatForm);

        calendarTypeItem.addChangedHandler(new ChangedHandler() {
            public void onChanged(ChangedEvent event) {
                String calendarType = (String) event.getValue();
                changeCalendarType(calendarType);
            }
        });
View Full Code Here

        DurationItem repeatIntervalItem = new DurationItem(FIELD_REPEAT_INTERVAL,
            MSG.widget_jobTriggerEditor_field_repeatInterval_now(), supportedUnits, false, this.isReadOnly);
        repeatIntervalItem.setRequired(true);
        repeatIntervalItem.setContextualHelp(MSG.widget_jobTriggerEditor_fieldHelp_repeatInterval());

        RadioGroupItem recurrenceTypeItem = new RadioGroupItem(FIELD_RECURRENCE_TYPE);
        recurrenceTypeItem.setRequired(true);
        recurrenceTypeItem.setShowTitle(false);
        LinkedHashMap<String, String> recurrenceTypeValueMap = new LinkedHashMap<String, String>();
        recurrenceTypeValueMap.put("for", MSG.widget_jobTriggerEditor_value_for());
        recurrenceTypeValueMap.put("until", MSG.widget_jobTriggerEditor_value_until());
        recurrenceTypeValueMap.put("indefinitely", MSG.widget_jobTriggerEditor_value_indefinitely());
        recurrenceTypeItem.setValueMap(recurrenceTypeValueMap);

        supportedUnits = new TreeSet<TimeUnit>();
        supportedUnits.add(TimeUnit.SECONDS);
        supportedUnits.add(TimeUnit.MINUTES);
        supportedUnits.add(TimeUnit.HOURS);
        supportedUnits.add(TimeUnit.DAYS);
        supportedUnits.add(TimeUnit.WEEKS);
        supportedUnits.add(TimeUnit.MONTHS);
        supportedUnits.add(TimeUnit.YEARS);
        final DurationItem repeatDurationItem = new DurationItem(FIELD_REPEAT_DURATION, null, supportedUnits, true,
            this.isReadOnly);
        repeatDurationItem.setShowTitle(false);
        repeatDurationItem.setVisible(false);
        repeatDurationItem.setContextualHelp(MSG.widget_jobTriggerEditor_fieldHelp_repeatDuration());

        final DateTimeItem endTimeItem = createDateTimeItem(FIELD_END_TIME);
        endTimeItem.setShowTitle(false);
        endTimeItem.setVisible(false);

        SpacerItem spacerItem = new SpacerItem();

        recurrenceTypeItem.addChangedHandler(new ChangedHandler() {
            public void onChanged(ChangedEvent event) {
                String recurrenceType = (String) event.getValue();
                changeRecurrenceType(recurrenceType, endTimeItem, repeatDurationItem);
            }
        });
View Full Code Here

    private DynamicForm createLaterForm() {
        final EnhancedDynamicForm laterForm = new EnhancedDynamicForm(this.isReadOnly);
        laterForm.setNumCols(4);
        laterForm.setColWidths(140, 130, 130);

        RadioGroupItem startTypeItem = new RadioGroupItem(FIELD_START_TYPE,
            MSG.widget_jobTriggerEditor_field_startType());
        LinkedHashMap<String, String> startTypeValueMap = new LinkedHashMap<String, String>();
        startTypeValueMap.put("on", MSG.widget_jobTriggerEditor_value_on());
        startTypeValueMap.put("in", MSG.widget_jobTriggerEditor_value_in());
        startTypeItem.setValueMap(startTypeValueMap);
        startTypeItem.setShowTitle(true);

        final DateTimeItem startTimeItem = createDateTimeItem(FIELD_START_TIME);

        TreeSet<TimeUnit> supportedUnits = new TreeSet<TimeUnit>();
        supportedUnits.add(TimeUnit.SECONDS);
        supportedUnits.add(TimeUnit.MINUTES);
        supportedUnits.add(TimeUnit.HOURS);
        supportedUnits.add(TimeUnit.DAYS);
        supportedUnits.add(TimeUnit.WEEKS);
        supportedUnits.add(TimeUnit.MONTHS);
        supportedUnits.add(TimeUnit.YEARS);
        final DurationItem startDelayItem = new DurationItem(FIELD_START_DELAY, null, supportedUnits, false,
            this.isReadOnly);
        startDelayItem.setShowTitle(false);
        startDelayItem.setVisible(false);
        startDelayItem.setContextualHelp(MSG.widget_jobTriggerEditor_fieldHelp_startDelay());

        SpacerItem spacerItem = new SpacerItem();

        startTypeItem.addChangedHandler(new ChangedHandler() {
            public void onChanged(ChangedEvent event) {
                String startType = (String) event.getValue();
                changeStartType(startType, startDelayItem, startTimeItem);
            }
        });
View Full Code Here

        if (composite.isCanBeUnassigned()) {
            radioForm = new DynamicForm();
            radioForm.setNumCols(1);
            radioForm.setColWidths(350);

            final RadioGroupItem radioGroupItem = new RadioGroupItem("RadioOptions");
            radioGroupItem.setTitleOrientation(TitleOrientation.TOP);
            radioGroupItem.setTitle(MSG.view_bundle_createWizard_groupsStep_radioTitle());
            radioGroupItem.setRequired(true);
            radioGroupItem.setAlign(Alignment.LEFT);

            LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
            valueMap.put("unassigned", MSG.view_bundle_createWizard_groupsStep_leaveUnassigned());
            valueMap.put("assign", MSG.view_bundle_createWizard_groupsStep_assign());
            radioGroupItem.setValueMap(valueMap);
            radioGroupItem.setValue(map.isEmpty() ? "unassigned" : "assign");

            radioGroupItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    if (map.isEmpty()) {
                        radioGroupItem.setValue("unassigned");

                    } else {
                        selector.setDisabled("unassigned".equals(event.getValue()));
                    }
View Full Code Here

        boolean userBeingEditedIsRhqadmin = (getRecordId() == SUBJECT_ID_RHQADMIN);
        FormItem activeItem;
        if (!this.loggedInUserHasManageSecurityPermission || userBeingEditedIsRhqadmin) {
            activeItem = new StaticTextItem(UsersDataSource.Field.FACTIVE);
        } else {
            RadioGroupItem activeRadioGroupItem = new RadioGroupItem(UsersDataSource.Field.FACTIVE);
            activeRadioGroupItem.setVertical(false);
            activeItem = activeRadioGroupItem;
        }
        items.add(activeItem);

        return items;
View Full Code Here

            form = new DynamicForm();
            form.setWidth100();
            form.setNumCols(2);
            form.setColWidths("50%", "*");

            rgDeployTimeItem = new RadioGroupItem("deployTime", MSG.view_bundle_deployWizard_getOptions_deployTime());
            LinkedHashMap<String, String> deployTimeValues = new LinkedHashMap<String, String>();
            deployTimeValues.put(DEPLOY_NOW, MSG.view_bundle_deployWizard_getOptions_deployNow());
            deployTimeValues.put(DEPLOY_LATER, MSG.view_bundle_deployWizard_getOptions_deployLater());
            rgDeployTimeItem.setRequired(true);
            rgDeployTimeItem.setValueMap(deployTimeValues);
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.form.fields.RadioGroupItem

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.