Пример #1
0
  private Tab createRecipeTab() {
    Tab tab = new Tab(MSG.view_bundle_recipe());
    DynamicForm form = new DynamicForm();

    TextAreaItem recipeCanvas = new TextAreaItem("recipe", MSG.view_bundle_recipe());
    recipeCanvas.setShowTitle(false);
    recipeCanvas.setColSpan(2);
    recipeCanvas.setWidth("100%");
    recipeCanvas.setHeight("100%");
    recipeCanvas.setValue(version.getRecipe());
    recipeCanvas.addChangeHandler(
        new ChangeHandler() {
          @Override
          public void onChange(ChangeEvent event) {
            // makes this read-only; however, since its not disabled, user can still select/copy the
            // text
            event.cancel();
          }
        });

    form.setHeight100();
    form.setWidth100();
    form.setItems(recipeCanvas);
    tab.setPane(form);
    return tab;
  }
Пример #2
0
  private DynamicForm createSummaryForm() {

    DynamicForm form = new DynamicForm();
    form.setWidth100();
    form.setColWidths("20%", "40%", "40%");
    form.setNumCols(3);
    form.setAutoHeight();
    form.setWrapItemTitles(false);
    form.setExtraSpace(10);
    form.setIsGroup(true);
    form.setGroupTitle(MSG.common_title_summary());
    form.setPadding(5);

    CanvasItem actionItem = new CanvasItem("actions");
    actionItem.setColSpan(1);
    actionItem.setRowSpan(4);
    actionItem.setShowTitle(false);
    actionItem.setCanvas(getActionLayout());

    StaticTextItem versionItem = new StaticTextItem("version", MSG.common_title_version());
    versionItem.setValue(version.getVersion());

    StaticTextItem liveDeploymentsItem =
        new StaticTextItem("deployments", MSG.view_bundle_deployments());
    liveDeploymentsItem.setValue(version.getBundleDeployments().size());

    StaticTextItem filesItems = new StaticTextItem("files", MSG.view_bundle_files());
    filesItems.setValue(version.getBundleFiles().size());

    StaticTextItem descriptionItem =
        new StaticTextItem("description", MSG.common_title_description());
    descriptionItem.setValue(version.getDescription());

    form.setFields(versionItem, actionItem, liveDeploymentsItem, filesItems, descriptionItem);
    return form;
  }
  public Canvas getSearchCanvas() {
    final VLayout mainLayout = new VLayout(20);
    mainLayout.setWidth100();
    mainLayout.setHeight100();
    mainLayout.setPadding(5);

    Label titleBar = new Label(MESSAGES.geometricSearchWidgetFreeDrawingSearchTitle());
    titleBar.setBackgroundColor("#E0E9FF");
    titleBar.setWidth100();
    titleBar.setHeight(20);
    titleBar.setPadding(5);

    HLayout geomsButtonBar = new HLayout();
    geomsButtonBar.setWidth100();
    geomsButtonBar.setAutoHeight();
    geomsButtonBar.setMembersMargin(10);
    HLayout actionsButtonBar = new HLayout();
    actionsButtonBar.setWidth100();
    actionsButtonBar.setAutoHeight();
    actionsButtonBar.setMembersMargin(10);

    btnPoint = new IButton(MESSAGES.geometricSearchWidgetFreeDrawingPoint());
    btnPoint.setIcon(WidgetLayout.iconPointCreate);
    btnPoint.setWidth(
        btnPoint.getTitle().length() * GsfLayout.buttonFontWidth + GsfLayout.buttonOffset);
    btnPoint.setActionType(SelectionType.RADIO);
    btnPoint.setRadioGroup("drawType");
    btnPoint.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onDrawPoint();
          }
        });

    btnLine = new IButton(MESSAGES.geometricSearchWidgetFreeDrawingLine());
    btnLine.setIcon(WidgetLayout.iconLineCreate);
    btnLine.setWidth(
        btnLine.getTitle().length() * GsfLayout.buttonFontWidth + GsfLayout.buttonOffset);
    btnLine.setActionType(SelectionType.RADIO);
    btnLine.setRadioGroup("drawType");
    btnLine.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onDrawLine();
          }
        });

    btnPolygon = new IButton(MESSAGES.geometricSearchWidgetFreeDrawingPolygon());
    btnPolygon.setIcon(WidgetLayout.iconPolygonCreate);
    btnPolygon.setWidth(
        btnPolygon.getTitle().length() * GsfLayout.buttonFontWidth + GsfLayout.buttonOffset);
    btnPolygon.setActionType(SelectionType.RADIO);
    btnPolygon.setRadioGroup("drawType");
    btnPolygon.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onDrawPolygon();
          }
        });

    btnUndo = new IButton(MESSAGES.geometricSearchWidgetFreeDrawingUndo());
    btnUndo.setIcon(WidgetLayout.iconUndo);
    btnUndo.setWidth(
        btnUndo.getTitle().length() * GsfLayout.buttonFontWidth + GsfLayout.buttonOffset);
    btnUndo.setDisabled(true);
    btnUndo.setShowDisabledIcon(false);
    btnUndo.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onUndo();
          }
        });

    btnRedo = new IButton(MESSAGES.geometricSearchWidgetFreeDrawingRedo());
    btnRedo.setIcon(WidgetLayout.iconRedo);
    btnRedo.setWidth(
        btnRedo.getTitle().length() * GsfLayout.buttonFontWidth + GsfLayout.buttonOffset);
    btnRedo.setDisabled(true);
    btnRedo.setShowDisabledIcon(false);
    btnRedo.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onRedo();
          }
        });

    frmBuffer = new DynamicForm();
    frmBuffer.setWidth100();
    spiBuffer = new SpinnerItem();
    spiBuffer.setTitle(MESSAGES.geometricSearchWidgetBufferLabel());
    spiBuffer.setDefaultValue(5);
    spiBuffer.setMin(0);
    spiBuffer.setWidth(60);
    spiBuffer.addChangedHandler(
        new ChangedHandler() {
          public void onChanged(ChangedEvent event) {
            updateView();
          }
        });
    frmBuffer.setFields(spiBuffer);

    // ----------------------------------------------------------

    geomsButtonBar.addMember(btnPoint);
    geomsButtonBar.addMember(btnLine);
    geomsButtonBar.addMember(btnPolygon);

    actionsButtonBar.addMember(btnUndo);
    actionsButtonBar.addMember(btnRedo);

    mainLayout.addMember(titleBar);
    mainLayout.addMember(geomsButtonBar);
    mainLayout.addMember(actionsButtonBar);
    mainLayout.addMember(frmBuffer);

    return mainLayout;
  }
  private void initComponents() {
    HLayout formsHLayout = new HLayout();
    formsHLayout.setWidth100();
    formsHLayout.setHeight("*");
    formsHLayout.setMembersMargin(5);

    DynamicForm jobNamesForm = new DynamicForm();
    jobNamesForm.setWidth100();
    jobNamesForm.setHeight100();
    jobNamesForm.setGroupTitle("Filter Jobs");
    jobNamesForm.setIsGroup(true);
    jobNamesForm.setTitleOrientation(TitleOrientation.TOP);
    jobNamesForm.setNumCols(2);
    jobNamesForm.setValuesManager(valuesManager);

    jobNamesForm.setDataFetchMode(FetchMode.BASIC);

    CheckboxItem selectAllJobNamesChkItem = new CheckboxItem();
    selectAllJobNamesChkItem.setValue(true);
    selectAllJobNamesChkItem.setTitle("Select All Jobs");
    selectAllJobNamesChkItem.setWidth("*");
    selectAllJobNamesChkItem.setName("selectAllJobNames");
    selectAllJobNamesChkItem.addChangedHandler(
        new ChangedHandler() {

          @Override
          public void onChanged(ChangedEvent event) {
            if ((Boolean) event.getValue()) {
              selectJobNameGrid.setDisabled(true);
              selectJobNameGrid.setCriterion(null);
            } else {
              selectJobNameGrid.setDisabled(false);
              // selectJobNameGrid.setCriterion(new Criterion().seta);
            }
          }
        });

    selectJobNameGrid.setTitle("Select Jobs");
    selectJobNameGrid.setWidth(280);
    selectJobNameGrid.setMultiple(true);
    selectJobNameGrid.setMultipleAppearance(MultipleAppearance.GRID);
    selectJobNameGrid.setValueMap("job", "job1", "job2", "Goat", "Marmoset", "Mouse");
    selectJobNameGrid.setName("selectedJobNames");
    selectJobNameGrid.setCriteriaField("selectedJobNames");
    /*selectJobNameGrid.addClickHandler(new ClickHandler() {
    	@Override
    	public void onClick(ClickEvent event) {
    		if(event.getSource().equals(selectJobNameGrid)){
    			String[] values = selectJobNameGrid.getValues();
    			valuesManager.setAttribute("selectedJobNames", values, true);
    		}
    	}
    });*/

    executionStartDate.setName("executionStartDate");
    executionStartDate.setTitle("Exceution Start Date");
    executionStartDate.setRequired(true);

    executionEndDate.setName("executionEndDate");
    executionEndDate.setTitle("Exceution End Date");
    executionEndDate.setRequired(true);

    executionStartTime.setName("executionStartTime");
    executionStartTime.setTitle("Exceution Start Time");
    executionStartTime.setRequired(true);

    executionEndTime.setName("executionEndTime");
    executionEndTime.setTitle("Exceution End Time");
    executionEndTime.setRequired(true);

    FormItem[] formItems =
        new FormItem[] {
          selectAllJobNamesChkItem,
          selectJobNameGrid,
          executionStartDate,
          executionStartTime,
          executionEndDate,
          executionEndTime
        };
    jobNamesForm.setDataSource(HistoricalJobMonitorDataSource.getInstance(), formItems);
    jobNamesForm.setFields(formItems);
    formsHLayout.addMember(jobNamesForm);

    addMember(formsHLayout);

    addMember(searchButton);
  }
Пример #5
0
  public ReferralLayerBlock(Layer<?> referral) {
    super(referral);
    this.layer = (VectorLayer) referral;

    final ChangedHandler filterChangedHandler = new FilterChangedHandler();
    dateForm1 = new ReferralDateFilterForm(filterChangedHandler);
    dateForm2 = new ReferralDateFilterForm(filterChangedHandler);

    FeatureInfo featureInfo = layer.getLayerInfo().getFeatureInfo();

    AssociationAttributeInfo statusInfo =
        (AssociationAttributeInfo)
            featureInfo.getAttributesMap().get(KtunaxaConstant.ATTRIBUTE_STATUS);
    AssociationAttributeInfo agencyTypeInfo =
        (AssociationAttributeInfo)
            featureInfo.getAttributesMap().get(KtunaxaConstant.ATTRIBUTE_EXTERNAL_AGENCY_TYPE);
    AssociationAttributeInfo typeInfo =
        (AssociationAttributeInfo)
            featureInfo.getAttributesMap().get(KtunaxaConstant.ATTRIBUTE_TYPE);

    clearStatus.setStartRow(false);
    clearStatus.setEndRow(false);
    clearStatus.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            status.clearValue();
            filterChangedHandler.onChanged(null);
          }
        });
    clearAgency.setStartRow(false);
    clearAgency.setEndRow(false);
    clearAgency.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            agency.clearValue();
            filterChangedHandler.onChanged(null);
          }
        });
    clearType.setStartRow(false);
    clearType.setEndRow(false);
    clearType.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            type.clearValue();
            filterChangedHandler.onChanged(null);
          }
        });

    form.setWidth100();
    status.getItem().setTitle("Status");
    status.getItem().addChangedHandler(filterChangedHandler);
    status.init(statusInfo, new DefaultAttributeProvider(layer, statusInfo.getName()));
    agency.getItem().setTitle("External Agency Type");
    agency.getItem().addChangedHandler(filterChangedHandler);
    agency.init(agencyTypeInfo, new DefaultAttributeProvider(layer, agencyTypeInfo.getName()));
    type.getItem().setTitle("Type");
    type.getItem().addChangedHandler(filterChangedHandler);
    type.init(typeInfo, new DefaultAttributeProvider(layer, typeInfo.getName()));
    form.setNumCols(4);
    form.setFields(
        status.getItem(), clearStatus, agency.getItem(), clearAgency, type.getItem(), clearType);
    addMember(form);
    addMember(dateForm1);
    addMember(dateForm2);
  }
Пример #6
0
  private void buildInstallInfoCanvas(AgentInstallInfo info) {
    DynamicForm infoForm = new DynamicForm();
    infoForm.setMargin(20);
    infoForm.setWidth100();
    infoForm.setHeight100();

    HeaderItem infoHeader = new HeaderItem();
    infoHeader.setValue(MSG.view_remoteAgentInstall_installInfo());

    StaticTextItem version = new StaticTextItem("version", MSG.common_title_version());
    version.setValue(info.getVersion());

    StaticTextItem path = new StaticTextItem("path", MSG.common_title_path());
    path.setValue(info.getPath());

    StaticTextItem owner = new StaticTextItem("owner", MSG.common_title_owner());
    owner.setValue(info.getOwner());

    StaticTextItem config = new StaticTextItem("config", MSG.common_title_configuration());
    config.setValue(info.getConfigurationStartString());

    CanvasItem listCanvas = new CanvasItem();
    listCanvas.setShowTitle(false);
    listCanvas.setColSpan(2);

    VLayout listLayout = new VLayout(0);
    listLayout.setWidth100();
    listLayout.setHeight100();

    ListGrid listGrid =
        new ListGrid() {
          @Override
          protected Canvas getExpansionComponent(ListGridRecord record) {
            Canvas canvas = super.getExpansionComponent(record);
            canvas.setPadding(5);
            return canvas;
          }
        };
    listGrid.setWidth100();
    listGrid.setHeight100();
    listGrid.setCanExpandRecords(true);
    listGrid.setExpansionMode(ExpansionMode.DETAIL_FIELD);
    listGrid.setDetailField("result");
    ListGridField step = new ListGridField("description", MSG.view_remoteAgentInstall_step());
    ListGridField result = new ListGridField("result", MSG.view_remoteAgentInstall_result());
    ListGridField resultCode =
        new ListGridField("resultCode", MSG.view_remoteAgentInstall_resultCode(), 90);
    ListGridField duration = new ListGridField("duration", MSG.common_title_duration(), 90);
    listGrid.setFields(step, result, resultCode, duration);
    listGrid.setData(getStepRecords(info));

    listLayout.addMember(listGrid);
    listCanvas.setCanvas(listLayout);

    // Replace the current info with just the install steps
    for (Canvas canvas : this.getChildren()) {
      canvas.markForDestroy();
    }

    createAgentStatusTextItem();
    infoForm.setFields(infoHeader, version, path, owner, config, agentStatusText, listCanvas);

    addMember(infoForm);

    this.setMembersMargin(1);
    this.markForRedraw();
  }
  private void prepareDetailsSection(SectionStack stack, ServerPlugin plugin) {
    DynamicForm form = new DynamicForm();
    form.setMargin(10);
    form.setWidth100();
    form.setWrapItemTitles(false);
    form.setNumCols(4);

    StaticTextItem nameItem = new StaticTextItem("name", MSG.common_title_name());
    nameItem.setValue(plugin.getName());

    StaticTextItem displayNameItem =
        new StaticTextItem("displayName", MSG.common_title_display_name());
    displayNameItem.setValue(plugin.getDisplayName());

    StaticTextItem versionItem = new StaticTextItem("version", MSG.common_title_version());
    versionItem.setValue(plugin.getVersion());

    StaticTextItem md5Item = new StaticTextItem("MD5", "MD5");
    md5Item.setValue(plugin.getMD5());

    StaticTextItem pathItem = new StaticTextItem("path", MSG.common_title_path());
    pathItem.setValue(plugin.getPath());

    StaticTextItem ampsItem =
        new StaticTextItem("ampsVersion", "AMPS " + MSG.common_title_version());
    ampsItem.setValue(plugin.getAmpsVersion());

    StaticTextItem descItem = new StaticTextItem("desc", MSG.common_title_description());
    descItem.setValue(plugin.getDescription());

    StaticTextItem mtimeItem = new StaticTextItem("mtime", MSG.common_title_lastUpdated());
    mtimeItem.setValue(
        TimestampCellFormatter.format(
            Long.valueOf(plugin.getMtime()), TimestampCellFormatter.DATE_TIME_FORMAT_MEDIUM));

    StaticTextItem kindItem = new StaticTextItem("kind", MSG.common_title_kind());
    switch (plugin.getDeployment()) {
      case AGENT:
        kindItem.setValue(MSG.view_admin_plugins_agent());
        break;
      case SERVER:
        kindItem.setValue(MSG.view_admin_plugins_server());
        break;
    }

    CanvasItem enabledItem = new CanvasItem("enabled", MSG.common_title_enabled());
    Img img = new Img(ImageManager.getAvailabilityIcon(plugin.isEnabled()), 16, 16);
    enabledItem.setCanvas(img);

    StaticTextItem typeItem = new StaticTextItem("type", MSG.common_title_type());
    typeItem.setValue(plugin.getType());

    form.setItems(
        displayNameItem,
        nameItem,
        versionItem,
        ampsItem,
        md5Item,
        kindItem,
        descItem,
        pathItem,
        mtimeItem,
        enabledItem,
        typeItem);

    SectionStackSection section = new SectionStackSection(MSG.common_title_details());
    section.setExpanded(true);
    section.setItems(form);

    detailsSection = section;
    ++initSectionCount;

    return;
  }
Пример #8
0
  public SmsQueueWindow(final Integer smsInfoId, String sms, String name) {
    setTitle(TicketMaster.constants.sms_numbers());
    setWidth(600);
    setHeight(500);
    setIsModal(true);
    setShowModalMask(true);
    setShowMaximizeButton(true);
    setShowMinimizeButton(false);
    setShowCloseButton(true);
    setAutoDraw(true);
    centerInPage();

    VLayout vLayout = new VLayout();
    vLayout.setWidth100();
    vLayout.setHeight100();
    form = new DynamicForm();
    form.setPadding(15);
    form.setWidth100();
    form.setNumCols(2);
    smsField = new StaticTextItem("sms", TicketMaster.constants.sms_sms());
    smsField.setValue(sms);
    smsField.setTitleVAlign(VerticalAlignment.TOP);

    StaticTextItem nameField = new StaticTextItem("name", TicketMaster.constants.name());
    nameField.setValue(name);
    form.setFields(nameField, smsField);

    Criteria c = new Criteria();
    c.setAttribute("timestamp", new Date().getTime());
    c.setAttribute("sms_info_id", smsInfoId);

    grid = new ListGrid();
    grid.setWidth100();
    grid.setHeight100();
    grid.setDataSource(DataSource.get("SMSBroadcastDS"));
    grid.setFetchOperation("getNumbers");
    grid.setCriteria(c);
    grid.setAutoFetchData(true);
    ListGridField sendDateField =
        new ListGridField("send_date", TicketMaster.constants.sms_sendDate(), 120);
    sendDateField.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATETIME);
    ListGridField deliveryDateField =
        new ListGridField("delivery_date", TicketMaster.constants.sms_deliveryDate(), 120);
    deliveryDateField.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATETIME);
    grid.setFields(
        new ListGridField("id", "ID", 60),
        new ListGridField("phone_number", TicketMaster.constants.sms_number()),
        new ListGridField("state", TicketMaster.constants.sms_state()),
        sendDateField,
        deliveryDateField);

    IButton exportBtn = new IButton(TicketMaster.constants.sms_export());
    exportBtn.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent clickEvent) {
            com.google.gwt.user.client.Window.open(
                "./SMSBroadcast/ExportNumbers?sms_info_id=" + smsInfoId, "_self", "");
          }
        });
    exportBtn.setIcon("excel.gif");

    HLayout bbar = new HLayout();
    bbar.setAlign(Alignment.RIGHT);
    bbar.setMembersMargin(5);
    bbar.setPadding(5);
    bbar.addMembers(exportBtn);
    vLayout.addMembers(form, grid, bbar);

    addItem(vLayout);
  }
Пример #9
0
  //    private final MapServiceInfoAsync mapServiceInfo = GWT.create(MapServiceInfo.class);
  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  public Authorization(final AsyncCallback<String> callback) {
    super(WINDOW_TITLE, WIDTH, HEIGHT, callback);

    this.setShowMinimizeButton(false);

    VLayout layout = new VLayout();
    layout.layoutChildren(null);

    accountForm = new DynamicForm();
    accountForm.setWidth100();
    accountForm.setPadding(5);
    //        backGround.setBorder("1px solid #ff0");
    TextItem login = new TextItem(CONTROL_LOGIN);
    login.setTitle(CAPTION_LOGIN);
    PasswordItem password = new PasswordItem(CONTROL_PASSWORD);
    password.setTitle(CAPTION_PASSWORD);

    password.addKeyPressHandler(
        new KeyPressHandler() {
          public void onKeyPress(KeyPressEvent keyPressEvent) {
            //                com.google.gwt.user.client.Window.alert("" +
            // keyPressEvent.getKeyName());
            if (keyPressEvent.getKeyName().equalsIgnoreCase("ENTER")) onOkClick();
          }
        });

    accountForm.setFields(login, password);

    Label linkRegistration = null;
    if (GWTViewer.config.withRegistration()) {
      linkRegistration = new Label();
      linkRegistration.setAlign(Alignment.RIGHT);
      linkRegistration.setStyleName(CSS_LABEL_LINK);
      linkRegistration.setHeight(20);
      linkRegistration.setWidth(265);
      linkRegistration.setContents(REGISTRATION);

      linkRegistration.addClickHandler(
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              callback.onSuccess(CMD_REGISTRATION);
              closeForm();
            }
          });
    }
    labelException = new Label();
    labelException.setAlign(Alignment.CENTER);
    labelException.setStyleName(CSS_LABEL_ERROR);
    labelException.setHeight(35);
    labelException.setWidth100();
    labelException.setMargin(5);
    //       labelException.setBorder("1px solid #0aa");
    labelException.setContents("");

    HLayout controlPanel = new HLayout();
    controlPanel.setHeight("30px");
    controlPanel.setLayoutLeftMargin(55);

    Button btnOk = null;
    btnOk = new Button("Ok");
    btnOk.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onOkClick();
          }
        });
    Button btnClose = new Button(CAPTION_CLOSE);
    btnClose.setTop(10);
    btnClose.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            closeForm();
          }
        });
    controlPanel.addMember(btnOk);
    controlPanel.addMember(btnClose);

    layout.addMember(accountForm);
    if (linkRegistration != null) layout.addMember(linkRegistration);
    layout.addMember(labelException);
    layout.addMember(controlPanel);
    addItem(layout);
  }
Пример #10
0
  private DynamicForm getServerDetails() {
    final DynamicForm form = new LocatableDynamicForm(extendLocatorId("serverDetails"));
    form.setWidth100();
    form.setExtraSpace(15);
    form.setIsGroup(true);
    form.setGroupTitle(MSG.view_admin_systemSettings_serverDetails());

    final StaticTextItem productName = new StaticTextItem("productname", MSG.common_title_name());
    final StaticTextItem productVersion =
        new StaticTextItem("productversion", MSG.common_title_version());
    final StaticTextItem productBuildNumber =
        new StaticTextItem(
            "productbuild", MSG.view_admin_systemSettings_serverDetails_buildNumber());

    final StaticTextItem serverTimezone =
        new StaticTextItem("timezone", MSG.view_admin_systemSettings_serverDetails_tz());
    final StaticTextItem serverTime =
        new StaticTextItem("localtime", MSG.view_admin_systemSettings_serverDetails_time());
    final StaticTextItem serverInstallDir =
        new StaticTextItem("installdir", MSG.view_admin_systemSettings_serverDetails_installDir());
    final StaticTextItem dbUrl =
        new StaticTextItem("dbUrl", MSG.view_admin_systemSettings_serverDetails_dbUrl());
    final StaticTextItem dbProductName =
        new StaticTextItem("dbProductName", MSG.view_admin_systemSettings_serverDetails_dbName());
    final StaticTextItem dbProductVersion =
        new StaticTextItem(
            "dbProductVersion", MSG.view_admin_systemSettings_serverDetails_dbVersion());
    final StaticTextItem dbDriverName =
        new StaticTextItem(
            "dbDriverName", MSG.view_admin_systemSettings_serverDetails_dbDriverName());
    final StaticTextItem dbDriverVersion =
        new StaticTextItem(
            "dbDriverVersion", MSG.view_admin_systemSettings_serverDetails_dbDriverVersion());
    final StaticTextItem currentMeasRawTable =
        new StaticTextItem(
            "currentMeasRawTable", MSG.view_admin_systemSettings_serverDetails_currentTable());
    final StaticTextItem nextMeasTableRotation =
        new StaticTextItem(
            "nextMeasTableRotation", MSG.view_admin_systemSettings_serverDetails_nextRotation());

    productName.setWrapTitle(false);
    productVersion.setWrapTitle(false);
    productBuildNumber.setWrapTitle(false);
    serverTimezone.setWrapTitle(false);
    serverTime.setWrapTitle(false);
    serverInstallDir.setWrapTitle(false);
    dbUrl.setWrapTitle(false);
    dbProductName.setWrapTitle(false);
    dbProductVersion.setWrapTitle(false);
    dbDriverName.setWrapTitle(false);
    dbDriverVersion.setWrapTitle(false);
    currentMeasRawTable.setWrapTitle(false);
    nextMeasTableRotation.setWrapTitle(false);

    form.setItems(
        productName,
        productVersion,
        productBuildNumber,
        serverTimezone,
        serverTime,
        serverInstallDir,
        dbUrl,
        dbProductName,
        dbProductVersion,
        dbDriverName,
        dbDriverVersion,
        currentMeasRawTable,
        nextMeasTableRotation);

    GWTServiceLookup.getSystemService()
        .getServerDetails(
            new AsyncCallback<ServerDetails>() {

              @Override
              public void onSuccess(ServerDetails result) {
                ProductInfo productInfo = result.getProductInfo();
                form.setValue(productName.getName(), productInfo.getName());
                form.setValue(productVersion.getName(), productInfo.getVersion());
                form.setValue(productBuildNumber.getName(), productInfo.getBuildNumber());

                Map<Detail, String> details = result.getDetails();
                form.setValue(
                    serverTimezone.getName(), details.get(ServerDetails.Detail.SERVER_TIMEZONE));
                form.setValue(
                    serverTime.getName(), details.get(ServerDetails.Detail.SERVER_LOCAL_TIME));
                form.setValue(
                    serverInstallDir.getName(),
                    details.get(ServerDetails.Detail.SERVER_INSTALL_DIR));
                form.setValue(
                    dbUrl.getName(), details.get(ServerDetails.Detail.DATABASE_CONNECTION_URL));
                form.setValue(
                    dbProductName.getName(),
                    details.get(ServerDetails.Detail.DATABASE_PRODUCT_NAME));
                form.setValue(
                    dbProductVersion.getName(),
                    details.get(ServerDetails.Detail.DATABASE_PRODUCT_VERSION));
                form.setValue(
                    dbDriverName.getName(), details.get(ServerDetails.Detail.DATABASE_DRIVER_NAME));
                form.setValue(
                    dbDriverVersion.getName(),
                    details.get(ServerDetails.Detail.DATABASE_DRIVER_VERSION));
                form.setValue(
                    currentMeasRawTable.getName(),
                    details.get(ServerDetails.Detail.CURRENT_MEASUREMENT_TABLE));
                form.setValue(
                    nextMeasTableRotation.getName(),
                    details.get(ServerDetails.Detail.NEXT_MEASUREMENT_TABLE_ROTATION));
              }

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

    return form;
  }
Пример #11
0
  public DlgAddEditTown(ListGrid cityGrid, ListGridRecord cityRecord) {
    super();
    this.lCityRecord = cityRecord;
    this.cityGrid = cityGrid;

    setTitle(cityRecord == null ? "ახალი ქალაქის დამატება" : "ქალაქის მოდიფიცირება");

    setHeight(310);
    setWidth(520);
    setShowMinimizeButton(false);
    setIsModal(true);
    setShowModalMask(true);
    setCanDrag(false);
    setCanDragReposition(false);
    setCanDragResize(false);
    setCanDragScroll(false);
    centerInPage();

    hLayout = new VLayout(5);
    hLayout.setWidth100();
    hLayout.setHeight100();
    hLayout.setPadding(10);

    dynamicForm = new DynamicForm();
    dynamicForm.setAutoFocus(true);
    dynamicForm.setWidth100();
    dynamicForm.setTitleWidth(200);
    dynamicForm.setNumCols(2);
    hLayout.addMember(dynamicForm);

    cityNameGeoItem = new TextItem();
    cityNameGeoItem.setTitle("დასახელება");
    cityNameGeoItem.setWidth(300);
    cityNameGeoItem.setName("town_name");

    cityCodeItem = new TextItem();
    cityCodeItem.setTitle("ქალაქის კოდი");
    cityCodeItem.setWidth(300);
    cityCodeItem.setName("town_code");

    cityNewCodeItem = new TextItem();
    cityNewCodeItem.setTitle("ქალაქის კოდი (ახალი)");
    cityNewCodeItem.setWidth(300);
    cityNewCodeItem.setName("town_new_code");

    ofGmtItem = new TextItem();
    ofGmtItem.setTitle("დრო");
    ofGmtItem.setWidth(300);
    ofGmtItem.setName("normal_gmt");

    ofGmtWinterItem = new TextItem();
    ofGmtWinterItem.setTitle("ზამთრის დრო");
    ofGmtWinterItem.setWidth(300);
    ofGmtWinterItem.setName("winter_gmt");

    countryItem = new ComboBoxItem();
    countryItem.setWidth(300);
    countryItem.setTitle("ქვეყანა");
    countryItem.setName("country_id");
    countryItem.setFetchMissingValues(true);
    countryItem.setFilterLocally(false);
    countryItem.setAddUnknownValues(false);

    townTypeItem = new ComboBoxItem();
    townTypeItem.setTitle("ქალაქის ტიპი");
    townTypeItem.setWidth(300);
    townTypeItem.setName("townTypeItem");
    townTypeItem.setFetchMissingValues(true);
    townTypeItem.setFilterLocally(false);
    townTypeItem.setAddUnknownValues(false);

    DataSource DescriptionsDS = DataSource.get("DescriptionsDS");
    townTypeItem.setOptionOperationId("searchDescriptionsOrderById");
    townTypeItem.setOptionDataSource(DescriptionsDS);
    townTypeItem.setValueField("description_id");
    townTypeItem.setDisplayField("description");

    Criteria criteria = new Criteria();
    criteria.setAttribute("description_type_id", "59000");
    townTypeItem.setOptionCriteria(criteria);
    townTypeItem.setAutoFetchData(false);

    townTypeItem.addKeyPressHandler(
        new KeyPressHandler() {
          @Override
          public void onKeyPress(KeyPressEvent event) {
            Criteria criteria = townTypeItem.getOptionCriteria();
            if (criteria != null) {
              String oldAttr = criteria.getAttribute("town_type_id");
              if (oldAttr != null) {
                Object nullO = null;
                criteria.setAttribute("town_type_id", nullO);
              }
            }
          }
        });

    countryItem.addKeyPressHandler(
        new KeyPressHandler() {
          @Override
          public void onKeyPress(KeyPressEvent event) {
            Criteria criteria = countryItem.getOptionCriteria();
            if (criteria != null) {
              String oldAttr = criteria.getAttribute("country_id");
              if (oldAttr != null) {
                Object nullO = null;
                criteria.setAttribute("country_id", nullO);
              }
            }
          }
        });

    isCapitalItem = new ComboBoxItem();
    isCapitalItem.setTitle("დედაქალაქი");
    isCapitalItem.setWidth(300);
    isCapitalItem.setName("capital_town");
    isCapitalItem.setValueMap(ClientMapUtil.getInstance().getIsCapital());

    dynamicForm.setFields(
        cityNameGeoItem,
        cityCodeItem,
        cityNewCodeItem,
        ofGmtItem,
        ofGmtWinterItem,
        countryItem,
        townTypeItem,
        isCapitalItem);

    HLayout hLayoutItem = new HLayout(5);
    hLayoutItem.setWidth100();
    hLayoutItem.setAlign(Alignment.RIGHT);

    IButton saveItem = new IButton();
    saveItem.setTitle("შენახვა");
    saveItem.setWidth(100);

    IButton cancItem = new IButton();
    cancItem.setTitle("დახურვა");
    cancItem.setWidth(100);

    hLayoutItem.setMembers(saveItem, cancItem);

    hLayout.addMember(hLayoutItem);

    cancItem.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            destroy();
          }
        });
    saveItem.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            saveCountry();
          }
        });

    addItem(hLayout);
    fillFields();
  }