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

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


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

            final TextItem nameTextItem = new TextItem("name", MSG.view_bundle_deployWizard_getDest_name());
            nameTextItem.setWidth(300);
            nameTextItem.setRequired(true);
            nameTextItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    Object value = event.getValue();
                    if (value == null) {
                        value = "";
                    }
                    wizard.setSubtitle(value.toString());
                    destination.setName(value.toString());
                }
            });
            FormUtility.addContextualHelp(nameTextItem, MSG.view_bundle_deployWizard_getDest_name_help());

            final TextAreaItem descriptionTextAreaItem = new TextAreaItem("description",
                MSG.view_bundle_deployWizard_getDest_desc());
            descriptionTextAreaItem.setWidth(300);
            descriptionTextAreaItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    Object value = event.getValue();
                    if (value == null) {
                        value = "";
                    }
                    destination.setDescription(value.toString());
                }
            });

            final TextItem deployDirTextItem = new TextItem("deployDir",
                MSG.view_bundle_deployWizard_getDest_deployDir());
            deployDirTextItem.setWidth(300);
            deployDirTextItem.setRequired(false);
            deployDirTextItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    Object value = event.getValue();
                    if (value != null) {
                        destination.setDeployDir(value.toString());
                    }
View Full Code Here


            public void onChanged(ChangedEvent event) {
                setOperationDropDownMenuValues(Integer.valueOf(event.getItem().getValue().toString()), null, null);
            }
        });

        descendantNameTextItem = new TextItem("descendantNameTextItem");
        descendantNameTextItem.setStartRow(false);
        descendantNameTextItem.setEndRow(true);
        descendantNameTextItem.setShowTitle(false);
        descendantNameTextItem.setRequired(false);
        descendantNameTextItem.setTooltip(MSG
View Full Code Here

            form = new DynamicForm();
            form.setNumCols(1);
            List<FormItem> formItems = new ArrayList<FormItem>(2);

            if (null != namePrompt) {
                TextItem nameItem = new TextItem("resourceName", namePrompt);
                nameItem.setRequired(true);
                nameItem.setTitleOrientation(TitleOrientation.TOP);
                nameItem.setAlign(Alignment.LEFT);
                nameItem.setWidth(300);

                nameItem.addChangedHandler(new ChangedHandler() {
                    public void onChanged(ChangedEvent event) {
                        Object value = event.getValue();
                        if (value == null) {
                            value = "";
                        }
                        wizard.setNewResourceName(value.toString());
                    }
                });
                formItems.add(nameItem);
            }

            if (null != versionPrompt) {
                TextItem versionItem = new TextItem("version", versionPrompt);
                versionItem.setRequired(true);
                versionItem.setTitleOrientation(TitleOrientation.TOP);
                versionItem.setAlign(Alignment.LEFT);
                versionItem.setWidth(300);
                versionItem.setValue("0");
                wizard.setNewResourceVersion("0");

                versionItem.addChangedHandler(new ChangedHandler() {
                    public void onChanged(ChangedEvent event) {
                        Object value = event.getValue();
                        if (value == null) {
                            value = "";
                        }
View Full Code Here

                            public void onChanged(ChangedEvent event) {
                                wizard.setCleanDeployment((Boolean) event.getValue());
                            }
                        });

                        final TextItem discoveryDelayItem = new TextItem("discoveryDelay", MSG.view_bundle_deployWizard_discoveryDelay());
                        discoveryDelayItem.setValue(getDiscoveryDelayConfigurationValue());
                        discoveryDelayItem.setWidth(300);
                        discoveryDelayItem.setRequired(false);
                        discoveryDelayItem.setValidators(new IsIntegerValidator());
                        discoveryDelayItem.addChangedHandler(new ChangedHandler() {
                            @Override
                            public void onChanged(ChangedEvent changedEvent) {
                                wizard.getNewDeploymentConfig().setSimpleValue("org.rhq.discoveryDelay", (String) changedEvent.getValue());
                            }
                        });
View Full Code Here

        final DashboardPortlet storedPortlet = this.portletWindow.getStoredPortlet();
        final Configuration portletConfig = storedPortlet.getConfiguration();

        List<FormItem> items = new ArrayList<FormItem>(4);
        // resource name
        final TextItem eventResourceFilter = getContext().type == Type.SubsystemView ? PortletConfigurationEditorComponent
            .getEventResourceEditor(portletConfig) : null;
        if (eventResourceFilter != null) {
            items.add(eventResourceFilter);
        }
       
        // event source
        final TextItem eventSourceFilter = PortletConfigurationEditorComponent.getEventSourceEditor(portletConfig);
        items.add(eventSourceFilter);
       
        // event severity
        final SelectItem eventSeveritySelector = PortletConfigurationEditorComponent
            .getEventSeverityEditor(portletConfig);
        items.add(eventSeveritySelector);

        // result count selector
        final SelectItem resultCountSelector = PortletConfigurationEditorComponent.getResultCountEditor(portletConfig);
        items.add(resultCountSelector);

        // range selector
        final CustomConfigMeasurementRangeEditor measurementRangeEditor = PortletConfigurationEditorComponent
            .getMeasurementRangeEditor(portletConfig);
       
        filterForm.setItems(items.toArray(new FormItem[items.size()]));

        //submit handler
        customSettingsForm.addSubmitValuesHandler(new SubmitValuesHandler() {

            @Override
            public void onSubmitValues(SubmitValuesEvent event) {
                // resource name
                if (eventResourceFilter != null) {
                    String selectedValue = (null == eventResourceFilter.getValue()) ? "" : eventResourceFilter.getValue()
                        .toString();
                    portletConfig.put(new PropertySimple(Constant.EVENT_RESOURCE, selectedValue));
                }
               
                // event source
                String selectedValue = (null == eventSourceFilter.getValue()) ? "" : eventSourceFilter.getValue()
                    .toString();
                portletConfig.put(new PropertySimple(Constant.EVENT_SOURCE, selectedValue));
               
                // event severity
                selectedValue = (null == eventSeveritySelector.getValue()) ? "" : eventSeveritySelector
View Full Code Here

        final DashboardPortlet storedPortlet = this.portletWindow.getStoredPortlet();
        final Configuration portletConfig = storedPortlet.getConfiguration();

        // alert name filter
        final TextItem alertNameFilter = PortletConfigurationEditorComponent.getAlertNameEditor(portletConfig);
       
        // alert priority selector
        final SelectItem alertPrioritySelector = PortletConfigurationEditorComponent
            .getAlertPriorityEditor(portletConfig);

        // result count selector
        final SelectItem resultCountSelector = PortletConfigurationEditorComponent.getResultCountEditor(portletConfig);

        // range selector
        final CustomConfigMeasurementRangeEditor measurementRangeEditor = PortletConfigurationEditorComponent
            .getMeasurementRangeEditor(portletConfig);

        // "Filter acknowledged", "Filter recovery alerts", "Filter recovered" - drop down
        final SelectItem filterSelector = PortletConfigurationEditorComponent.getAlertFilterEditor(portletConfig);

        filterForm.setItems(alertNameFilter, alertPrioritySelector, resultCountSelector, filterSelector);

        //submit handler
        customSettingsForm.addSubmitValuesHandler(new SubmitValuesHandler() {

            @Override
            public void onSubmitValues(SubmitValuesEvent event) {
                // alert name
                String selectedValue = (null == alertNameFilter.getValue()) ? "" : alertNameFilter.getValue()
                    .toString();
                portletConfig.put(new PropertySimple(Constant.ALERT_NAME, selectedValue));
               
                // alert severity
                selectedValue = (null == alertPrioritySelector.getValue()) ? "" : alertPrioritySelector
View Full Code Here

            MSG.view_adminTopology_partitionEvents_execStatusFilter(), ExecutionStatus.class, null, null);

        final EnumSelectItem typeFilter = new EnumSelectItem(PartitionEventDatasource.FILTER_EVENT_TYPE,
            MSG.view_adminTopology_partitionEvents_typeFilter(), PartitionEventType.class, null, null);

        final TextItem detail = new TextItem(PartitionEventDatasource.FILTER_EVENT_DETAIL,
            MSG.view_adminTopology_partitionEvents_detailsFilter());

        if (isShowFilterForm()) {
            setFilterFormItems(statusFilter, detail, typeFilter);
        }
View Full Code Here

        connectionForm.setPadding(5);
        connectionForm.setIsGroup(true);
        connectionForm.setGroupTitle(MSG.view_remoteAgentInstall_connInfo());
        final int textFieldWidth = 440;

        TextItem host = new TextItem("host", MSG.common_title_host());
        host.setRequired(true);
        host.setWidth(textFieldWidth);
        host.setPrompt(MSG.view_remoteAgentInstall_promptHost());
        host.setHoverWidth(300);
        host.setEndRow(true);
        host.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                hostAuthorized = false; // if the host changes, we need to make sure the user authorizes it if needed
            }
        });

        TextItem port = new TextItem("port", MSG.common_title_port());
        port.setRequired(false);
        port.setWidth(textFieldWidth);
        port.setPrompt(MSG.view_remoteAgentInstall_promptPort());
        port.setHoverWidth(300);
        port.setEndRow(true);
        IntegerRangeValidator portValidator = new IntegerRangeValidator();
        portValidator.setMin(1);
        portValidator.setMax(65535);
        port.setValidators(new IsIntegerValidator(), portValidator);

        TextItem username = new TextItem("username", MSG.common_title_user());
        username.setRequired(false); // if not specified, the server will attempt to use the default ssh user defined in system settings
        username.setWidth(textFieldWidth);
        username.setPrompt(MSG.view_remoteAgentInstall_promptUser());
        username.setHoverWidth(300);
        username.setEndRow(true);

        PasswordItem password = new PasswordItem("password", MSG.common_title_password());
        password.setRequired(false); // if not specified, the server will attempt to use the default ssh pw defined in system settings
        password.setWidth(textFieldWidth);
        password.setPrompt(MSG.view_remoteAgentInstall_promptPassword());
        password.setHoverWidth(300);
        password.setEndRow(true);
        password.setAttribute("autocomplete", "off");

        rememberMeCheckbox = new CheckboxItem("rememberme", MSG.view_remoteAgentInstall_rememberMe());
        rememberMeCheckbox.setRequired(false);
        rememberMeCheckbox.setPrompt(MSG.view_remoteAgentInstall_promptRememberMe());
        rememberMeCheckbox.setHoverWidth(300);
        rememberMeCheckbox.setColSpan(2);
        rememberMeCheckbox.setEndRow(true);

        agentInstallPath = new TextItem("agentInstallPath", MSG.view_remoteAgentInstall_installPath());
        agentInstallPath.setWidth(textFieldWidth);
        agentInstallPath.setPrompt(MSG.view_remoteAgentInstall_promptInstallPath());
        agentInstallPath.setHoverWidth(300);
        agentInstallPath.setStartRow(true);
        agentInstallPath.setEndRow(false);
        agentInstallPath.setValidators(absPathValidator); // we will "turn this on" when needed - this is to ensure we create paths properly and it doesn't go in places user isn't expecting

        findAgentInstallPathButton = new ButtonItem("findAgentInstallPathButton",
            MSG.view_remoteAgentInstall_buttonFindAgent());
        findAgentInstallPathButton.setStartRow(false);
        findAgentInstallPathButton.setEndRow(true);
        if (findAgentInstallPathButton.getTitle().length() < 15) { //i18n may prolong the title
            findAgentInstallPathButton.setWidth(100);
        }
        findAgentInstallPathButton.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
            public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent clickEvent) {
                // we only want to validate host
                if (connectionForm.getValueAsString("host") == null
                    || connectionForm.getValueAsString("host").trim().isEmpty()) {
                    final HashMap<String, String> errors = new HashMap<String, String>(1);
                    errors.put("host", CoreGUI.getSmartGwtMessages().validator_requiredField());
                    connectionForm.setErrors(errors, true);
                    return;
                }

                new CheckSSHConnectionCallback() {
                    @Override
                    protected void doActualWork() {
                        findAgentInstallPath();
                    }
                }.execute();
            }
        });

        createAgentStatusTextItem();

        statusCheckButton = new ButtonItem("updateStatus", MSG.common_title_updateStatus());
        statusCheckButton.setStartRow(false);
        statusCheckButton.setEndRow(true);
        if (findAgentInstallPathButton.getTitle().length() < 15) { //i18n may prolong the title
            statusCheckButton.setWidth(100);
        }
        statusCheckButton.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
            public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent clickEvent) {
                if (connectionForm.validate()) {
                    new CheckSSHConnectionCallback() {
                        @Override
                        protected void doActualWork() {
                            agentStatusCheck();
                        }
                    }.execute();
                }
            }
        });

        if (initialAgentInstall != null) {
            host.setValue(initialAgentInstall.getSshHost());
            if (initialAgentInstall.getSshPort() != null) {
                port.setValue(String.valueOf(initialAgentInstall.getSshPort()));
            }
            username.setValue(initialAgentInstall.getSshUsername());
            password.setValue(initialAgentInstall.getSshPassword());
            agentInstallPath.setValue(initialAgentInstall.getInstallLocation());
            // if it was already saved, assume they want it to stay remembered
            // however, because the uninstall page is getting rid of the agent, we don't need or want to remember the credentials anymore
            if (!this.showUninstallButton) {
View Full Code Here

        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();
            }
        });

View Full Code Here

        form.setNumCols(2);

        StaticTextItem nameItem = new StaticTextItem(FIELD_NAME.propertyName(), FIELD_NAME.title());
        nameItem.setValue("<b>" + server.getName() + "</b>");

        final TextItem addressItem = new TextItem(FIELD_ADDRESS.propertyName(), FIELD_ADDRESS.title());
        addressItem.setRequired(true);
        addressItem.setValue(server.getAddress());

        IntegerRangeValidator portValidator = new IntegerRangeValidator();
        portValidator.setMin(0);
        portValidator.setMax(65535);
        final TextItem portItem = new TextItem(FIELD_PORT.propertyName(), FIELD_PORT.title());
        portItem.setRequired(true);
        portItem.setValidators(portValidator);
        portItem.setValue(server.getPort());

        final TextItem securePortItem = new TextItem(FIELD_SECURE_PORT.propertyName(), FIELD_SECURE_PORT.title());
        securePortItem.setRequired(true);
        securePortItem.setValidators(portValidator);
        securePortItem.setValue(server.getSecurePort());

        final SelectItem operationModeItem = new SelectItem(FIELD_OPERATION_MODE.propertyName(),
            MSG.view_adminTopology_serverDetail_operationMode());
        operationModeItem.setValueMap("NORMAL", "MAINTENANCE");
        operationModeItem.setValue(server.getOperationMode());

        // make clickable link for affinity group
        StaticTextItem affinityGroupItem = new StaticTextItem(FIELD_AFFINITY_GROUP.propertyName(),
            FIELD_AFFINITY_GROUP.title());
        String affinityGroupItemText = "";
        AffinityGroup ag = server.getAffinityGroup();
        if (ag != null && ag.getName() != null && !ag.getName().isEmpty()) {
            String detailsUrl = "#" + AffinityGroupTableView.VIEW_PATH + "/" + ag.getId();
            String formattedValue = StringUtility.escapeHtml(ag.getName());
            affinityGroupItemText = LinkManager.getHref(detailsUrl, formattedValue);
        }
        affinityGroupItem.setValue(affinityGroupItemText);

        StaticTextItem installationDateItem = new StaticTextItem(FIELD_CTIME.propertyName(), FIELD_CTIME.title());
        installationDateItem.setValue(TimestampCellFormatter.format(Long.valueOf(server.getCtime()),
            TimestampCellFormatter.DATE_TIME_FORMAT_LONG));

        StaticTextItem lastUpdateItem = new StaticTextItem(FIELD_MTIME.propertyName(), FIELD_MTIME.title());
        lastUpdateItem.setValue(TimestampCellFormatter.format(Long.valueOf(server.getMtime()),
            TimestampCellFormatter.DATE_TIME_FORMAT_LONG));

        IButton saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        saveButton.setOverflow(Overflow.VISIBLE);
        saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                if (form.validate()) {
                    server.setAddress(addressItem.getValueAsString());
                    server.setPort(Integer.parseInt(portItem.getValueAsString()));
                    server.setSecurePort(Integer.parseInt(securePortItem.getValueAsString()));
                    server.setOperationMode(OperationMode.valueOf(operationModeItem.getValueAsString()));
                    GWTServiceLookup.getTopologyService().updateServer(server, new AsyncCallback<Void>() {
                        public void onSuccess(Void result) {
                            Message msg = new Message(MSG.view_adminTopology_message_serverUpdated(server.getName()),
                                Message.Severity.Info);
View Full Code Here

TOP

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

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.