com.smartgwt.client.widgets.form.fields.events.ChangedEvent Java Examples

The following examples show how to use com.smartgwt.client.widgets.form.fields.events.ChangedEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SubscriptionListGrid.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
protected ChangedHandler createActivateChangedHandler(final ListGridRecord ruleRecord) {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            CheckboxItem checkbox = (CheckboxItem) event.getSource();
            boolean checked = checkbox.getValueAsBoolean().booleanValue();
            String uuid = ruleRecord.getAttribute(UUID);
            String medium = ruleRecord.getAttribute(MEDIUM);
            String format = ruleRecord.getAttribute(FORMAT);
            ruleRecord.setAttribute(SUBSCRIBED, checked);
            if(checked) {
                getMainEventBus().fireEvent(new SubscribeEvent(currentSession(), uuid, medium, format));
            } else {
                getMainEventBus().fireEvent(new UnsubscribeEvent(currentSession(), uuid, medium, format));
            }
        }
    };
}
 
Example #2
Source File: DigitalObjectPreview.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Gets widget to zoom image in the window.
 * @return
 */
public Canvas getWindowZoomer() {
    SelectItem zoomItem = createZoomForm();
    zoomItem.setHeight(15);
    zoomItem.setPickerIconSrc("[SKIN]/headerIcons/zoom.png");
    zoomItem.setPickerIconHeight(15);
    zoomItem.setPickerIconWidth(15);
    zoomItem.addChangedHandler(new ChangedHandler() {

        @Override
        public void onChanged(ChangedEvent event) {
            onZoomChange(event);
        }
    });
    DynamicForm form = new DynamicForm();
    form.setValuesManager(zoomValues);
    form.setFields(zoomItem);
    form.setLayoutAlign(Alignment.CENTER);
    return form;
}
 
Example #3
Source File: SyndicationDetailsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void refresh() {
	tabSet.hideSave();

	/*
	 * Prepare the standard properties tab
	 */
	if (standardPanel != null) {
		standardPanel.destroy();
		if (standardTabPanel.contains(standardPanel))
			standardTabPanel.removeMember(standardPanel);
	}

	ChangedHandler changeHandler = new ChangedHandler() {
		@Override
		public void onChanged(ChangedEvent event) {
			onModified();
		}
	};
	standardPanel = new SyndicationStandardProperties(syndication, changeHandler);
	standardTabPanel.addMember(standardPanel);

}
 
Example #4
Source File: ImportDetailsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void refresh() {
	ChangedHandler changeHandler = new ChangedHandler() {
		@Override
		public void onChanged(ChangedEvent event) {
			onModified();
		}
	};

	/*
	 * Prepare the import settings tab
	 */
	if (settingsPanel != null) {
		settingsPanel.destroy();
		if (settingsTabPanel.contains(settingsPanel))
			settingsTabPanel.removeMember(settingsPanel);
	}
	settingsPanel = new ImportSettingsPanel(archive, changeHandler);
	settingsTabPanel.addMember(settingsPanel);
}
 
Example #5
Source File: IncrementalDetailsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void refresh() {
	if (savePanel != null)
		savePanel.setVisible(false);

	ChangedHandler changeHandler = new ChangedHandler() {
		@Override
		public void onChanged(ChangedEvent event) {
			onModified();
		}
	};

	/*
	 * Prepare the versions tab
	 */
	if (settingsPanel != null) {
		settingsPanel.destroy();
		if (settingsTabPanel.contains(settingsPanel))
			settingsTabPanel.removeMember(settingsPanel);
	}
	settingsPanel = new IncrementalSettingsPanel(incremental, changeHandler, this);
	settingsTabPanel.addMember(settingsPanel);
}
 
Example #6
Source File: DigitalObjectPreview.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Gets widget to zoom image in the preview panel.
 * @return
 */
public Canvas getPreviewZoomer() {
    SelectItem zoomItem = createZoomForm();
    zoomItem.addChangedHandler(new ChangedHandler() {

        @Override
        public void onChanged(ChangedEvent event) {
            onZoomChange(event);
        }
    });
    DynamicForm form = new DynamicForm();
    form.setValuesManager(zoomValues);
    form.setFields(zoomItem);
    form.setLayoutAlign(Alignment.CENTER);
    return form;
}
 
Example #7
Source File: MainMenu.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
private SelectItem getDensitySelector() {
	SelectItem density = ItemFactory.newDensitySelector();
	density.setShowTitle(false);
	String dens = Session.get().getInfo().getConfig("gui.density");
	if (CookiesManager.get(CookiesManager.COOKIE_DENSITY) != null)
		dens = CookiesManager.get(CookiesManager.COOKIE_DENSITY);
	density.setValue(dens);
	density.addChangedHandler(new ChangedHandler() {

		@Override
		public void onChanged(ChangedEvent event) {
			String newDensity = event.getValue().toString();
			Session.get().getInfo().setConfig(Session.get().getTenantName() + ".gui.density", newDensity);
			CookiesManager.save(CookiesManager.COOKIE_DENSITY, newDensity);
			Util.setupDensity(Session.get().getInfo());
			com.google.gwt.user.client.Window.Location.reload();
		}
	});
	return density;
}
 
Example #8
Source File: CatalogBrowser.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onChanged(ChangedEvent event) {
    ListGridRecord r = selectCatalog.getSelectedRecord();
    String lastFieldSelection = selectField.getValueAsString();
    Record[] fields = r.getAttributeAsRecordArray(BibliographicCatalogResourceApi.CATALOG_FIELDS);
    LinkedHashMap<String, String> fieldMap = new LinkedHashMap<String, String>();
    for (Record field : fields) {
        String fId = field.getAttribute(BibliographicCatalogResourceApi.CATALOG_FIELD_ID);
        String fTitle = field.getAttribute(BibliographicCatalogResourceApi.CATALOG_FIELD_TITLE);
        fTitle = fTitle == null || fId.equals(fTitle) ? FIELD_TYPE_TITLES.get(fId) : fTitle;
        fTitle = fTitle == null ? fId : fTitle;
        fieldMap.put(fId, fTitle);
    }
    if (!fieldMap.containsKey(lastFieldSelection)) {
        if (fieldMap.isEmpty()) {
            lastFieldSelection = null;
        } else {
            lastFieldSelection = fieldMap.keySet().iterator().next();
        }
    }
    selectField.setValueMap(fieldMap);
    selectField.setValue(lastFieldSelection);
}
 
Example #9
Source File: AutomationTriggerDetailsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void refresh() {
	tabSet.hideSave();

	/*
	 * Prepare the standard properties tab
	 */
	if (standardPanel != null) {
		standardPanel.destroy();
		if (standardTabPanel.contains(standardPanel))
			standardTabPanel.removeMember(standardPanel);
	}

	ChangedHandler changeHandler = new ChangedHandler() {
		@Override
		public void onChanged(ChangedEvent event) {
			onModified();
		}
	};
	standardPanel = new AutomationTriggerProperties(trigger, changeHandler);
	standardTabPanel.addMember(standardPanel);
}
 
Example #10
Source File: BrandingPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void initGUI() {
	tenantBranding = new TenantBrandingPanel(tenant, new ChangedHandler() {

		@Override
		public void onChanged(ChangedEvent event) {

		}
	});

	IButton save = new IButton(I18N.message("save"));
	save.setMinWidth(80);
	save.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(ClickEvent event) {
			if (tenantBranding.validate())
				onSave();
		}
	});

	body.setMembers(tenantBranding);
	addMember(save);
}
 
Example #11
Source File: CreateSimpleRuleLayout.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private void setEntryOperatorRuleItem() {
    this.entryOperatorItem = new SelectItem();
    this.entryOperatorItem.setWidth(this.entryItemWidth);
    this.entryOperatorItem.setTitle(i18n.operator());
    this.entryOperatorItem.setTitleOrientation(TitleOrientation.TOP);
    this.entryOperatorItem.setValueMap(getMathSymbols());
    this.entryOperatorItem.setDefaultValue(">");
    this.entryOperatorItem.setTextAlign(Alignment.CENTER);
    this.entryOperatorItem.addChangedHandler(new ChangedHandler() {
        public void onChanged(ChangedEvent event) {
            if (exitOperatorItem != null) {
                TextItem exitOperatorTextItem = (TextItem) event.getSource();
                exitOperatorItem.setValue(getInverse(exitOperatorTextItem.getValueAsString()));
            }
        }
    });
}
 
Example #12
Source File: StationSelector.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createInformationFieldForSelectedStation() {
        VLayout layout = new VLayout();
        timeseriesInfoHTMLPane = new HTMLPane();
        phenomenonBox = new SelectItem(i18n.phenomenonLabel());
        phenomenonBox.addChangedHandler(new ChangedHandler() {
			@Override
			public void onChanged(ChangedEvent event) {
				String category = (String) event.getItem().getValue();
				controller.loadTimeseriesByCategory(category);
			}
		});
        DynamicForm form = new DynamicForm();
        form.setItems(phenomenonBox);
//        phenomenonInfoLabel = new Label();
//        phenomenonInfoLabel.setAutoHeight();
        stationInfoLabel = new Label();
        stationInfoLabel.setAutoHeight();
//        layout.addMember(phenomenonInfoLabel);
        layout.addMember(form);
        layout.addMember(stationInfoLabel);
        layout.addMember(timeseriesInfoHTMLPane);
        return layout;
    }
 
Example #13
Source File: AttributeSetDetailsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void refresh() {
	disableSave();

	/*
	 * Prepare the standard properties tab
	 */
	if (propertiesPanel != null) {
		propertiesPanel.destroy();
		if (propertiesTabPanel.contains(propertiesPanel))
			propertiesTabPanel.removeMember(propertiesPanel);
	}

	ChangedHandler changeHandler = new ChangedHandler() {
		@Override
		public void onChanged(ChangedEvent event) {
			onModified();
		}
	};

	propertiesPanel = new AttributeSetPropertiesPanel(attributeSet, changeHandler, this);
	propertiesTabPanel.addMember(propertiesPanel);
}
 
Example #14
Source File: TemplateDetailsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void refresh() {
	disableSave();

	/*
	 * Prepare the standard properties tab
	 */
	if (propertiesPanel != null) {
		propertiesPanel.destroy();
		if (propertiesTabPanel.contains(propertiesPanel))
			propertiesTabPanel.removeMember(propertiesPanel);
	}

	ChangedHandler changeHandler = new ChangedHandler() {
		@Override
		public void onChanged(ChangedEvent event) {
			onModified();
		}
	};

	propertiesPanel = new TemplatePropertiesPanel(template, changeHandler, this);
	propertiesTabPanel.addMember(propertiesPanel);
}
 
Example #15
Source File: StationSelector.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
FormItem createFilterCategorySelectionGroup(String serviceUrl) {
	if (stationFilterGroups.containsKey(serviceUrl)) {
		RadioGroupItem selector = stationFilterGroups.get(serviceUrl);
		return selector;
	}
	RadioGroupItem radioGroup = new RadioGroupItem("sosDataSource");
	radioGroup.setShowTitle(false);
	radioGroup.addChangedHandler(new ChangedHandler() {
		@Override
		public void onChanged(ChangedEvent event) {
			Object value = event.getValue();
			if (value != null) {
				hideInfoWindow();
				controller.setStationFilter(value.toString());
				controller.updateContentUponStationFilter();
			}
		}
	});

	stationFilterGroups.put(serviceUrl, radioGroup);
	return radioGroup;
}
 
Example #16
Source File: OverUndershootRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createEntryValueChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            TextItem valueItem = (TextItem) event.getSource();
            String value = valueItem.getValueAsString();
            controller.getOverUndershootEntryConditions().setValue(value);
            
            exitValueItem.setValue(value);
            // setting exit value does not invoke ChangedHandler :(
            controller.getOverUndershootExitConditions().setValue(value);
        }
    };
}
 
Example #17
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newAutomationRoutineSelector(String name, Long value, final ChangedHandler handler,
		boolean showEmpty) {
	final SelectItem select = newSelectItem(filterItemName(name), "routine");
	select.setValueField("id");
	select.setDisplayField("name");
	select.setEmptyDisplayValue(I18N.message("customcode"));

	ListGridField id = new ListGridField("id", I18N.message("id"));
	id.setHidden(true);
	ListGridField _name = new ListGridField("name", I18N.message("name"));
	ListGridField description = new ListGridField("description", I18N.message("description"));
	select.setPickListFields(id, _name, description);
	select.setPickListWidth(250);
	select.setOptionDataSource(new AutomationRoutinesDS(showEmpty));
	select.setValue(value);

	ChangedHandler setNullOnEmpty = new ChangedHandler() {

		@Override
		public void onChanged(ChangedEvent event) {
			if (event != null && event.getValue().equals("")) {
				select.setValue((String) null);
				select.clearValue();
			}
		}
	};
	select.addChangedHandler(setNullOnEmpty);
	if (handler != null)
		select.addChangedHandler(handler);

	return select;
}
 
Example #18
Source File: OverUndershootRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createExitValueChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            TextItem valueItem = (TextItem) event.getSource();
            String value = valueItem.getValueAsString();
            controller.getOverUndershootExitConditions().setValue(value);
        }
    };
}
 
Example #19
Source File: OverUndershootRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createExitOperatorChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            SelectItem selectItem = (SelectItem) event.getSource();
            String operator = selectItem.getValueAsString();
            controller.getOverUndershootExitConditions().setOperator(operator);
        }
    };
}
 
Example #20
Source File: SensorLossRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createValueChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            TextItem valueItem = (TextItem) event.getSource();
            String thresholdValue = valueItem.getValueAsString();
            controller.getSensorLossConditions().setValue(thresholdValue);
        }
    };
}
 
Example #21
Source File: OverUndershootRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createEntryOperatorChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            SelectItem selectItem = (SelectItem) event.getSource();
            String operator = selectItem.getValueAsString();
            String inverseOperator = getInverse(operator);
            controller.getOverUndershootEntryConditions().setOperator(operator);
            exitOperatorItem.setValue(inverseOperator);
            controller.getOverUndershootExitConditions().setOperator(inverseOperator);
        }
    };
}
 
Example #22
Source File: PageMetadataEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private void createApplyToUi() {
    formApply = createForm();

    applyTo = new ComboBoxItem("applyTo", i18n.PageMetadataEditor_ApplyTo_Title());
    applyTo.setPrompt(i18n.PageMetadataEditor_ApplyTo_Hint());
    applyTo.setRequired(true);

    LinkedHashMap<String, String> vals = new LinkedHashMap<String, String>();
    vals.put("1", i18n.PageMetadataEditor_ApplyToEachItem_Title());
    for (int i = 2; i <= 20; i++) {
        String nth = String.valueOf(i);
        vals.put(nth, i18n.PageMetadataEditor_ApplyToEachNthItem_Title(nth));
    }
    applyTo.setValueMap(vals);
    applyTo.setDefaultValue(1);
    applyTo.setValue(1);

    applyToValidator = new IntegerRangeValidator();
    applyToValidator.setMin(1);
    applyToValidator.setMax(applyToMaxValue);
    applyTo.setValidators(new IsIntegerValidator(), applyToValidator);

    applyFromFirst = new CheckboxItem("applyFromFirst", i18n.PageMetadataEditor_ApplyFromFirst_Title());
    applyFromFirst.setPrompt(i18n.PageMetadataEditor_ApplyFromFirst_Hint());

    formApply.setItems(applyTo, applyFromFirst);

    applyTo.addChangedHandler(new ChangedHandler() {

        @Override
        public void onChanged(ChangedEvent event) {
            applyFromFirst.setDisabled("1".equals(applyTo.getValueAsString()));
        }
    });
}
 
Example #23
Source File: PageMetadataEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onChanged(ChangedEvent event) {
    boolean enabled = (Boolean) event.getValue();
    for (FormItem item : items) {
        item.setDisabled(!enabled);
    }
    if (enabled && items.length > 0) {
        items[0].focusInItem();
    }
}
 
Example #24
Source File: OverUndershootRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createUnitSelectionChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            // TODO Auto-generated method stub
        }
    };
}
 
Example #25
Source File: ConverterAssociationsDialog.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ConverterAssociationsDialog(final ListGrid srcGrid) {
	this.srcGrid = srcGrid;

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("associations"));
	setWidth(320);
	setHeight(360);
	
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

	converter = ItemFactory.newFormatConverterSelector();
	converter.setWidth(290);
	converter.setRequired(true);
	converter.setValue(DEFAULT_CONVERTER);
	converter.addChangedHandler(new ChangedHandler() {

		@Override
		public void onChanged(ChangedEvent event) {
			refresh();
		}
	});

	DynamicForm form = new DynamicForm();
	form.setTitleOrientation(TitleOrientation.TOP);
	form.setNumCols(1);
	form.setItems(converter);

	addItem(form);

	refresh();
}
 
Example #26
Source File: SensorLossRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createEntryUnitChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            SelectItem valueItem = (SelectItem) event.getSource();
            String unitValue = valueItem.getValueAsString();
            controller.getSensorLossConditions().setUnit(unitValue);
        }
    };
}
 
Example #27
Source File: ImportFolderDetailsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void refresh() {
	tabSet.hideSave();

	/*
	 * Prepare the standard properties tab
	 */
	if (standardPanel != null) {
		standardPanel.destroy();
		if (standardTabPanel.contains(standardPanel))
			standardTabPanel.removeMember(standardPanel);
	}

	ChangedHandler changeHandler = new ChangedHandler() {
		@Override
		public void onChanged(ChangedEvent event) {
			onModified();
		}
	};
	standardPanel = new ImportFolderStandardProperties(importFolder, changeHandler);
	standardTabPanel.addMember(standardPanel);

	/*
	 * Prepare the extended properties tab
	 */
	if (advancedPanel != null) {
		advancedPanel.destroy();
		if (advancedTabPanel.contains(advancedPanel))
			advancedTabPanel.removeMember(advancedPanel);
	}
	advancedPanel = new ImportFolderAdvancedProperties(importFolder, changeHandler);
	advancedTabPanel.addMember(advancedPanel);
}
 
Example #28
Source File: SensorLossRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ChangedHandler createUnitSelectionChangedHandler() {
    return new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            // TODO Auto-generated method stub
        }
    };
}
 
Example #29
Source File: ComparatorAssociationsDialog.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ComparatorAssociationsDialog(final ListGrid srcGrid) {
	this.srcGrid = srcGrid;

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("associations"));
	setWidth(320);
	setHeight(360);

	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

	comparator = ItemFactory.newComparatorSelector();
	comparator.setWidth(290);
	comparator.setRequired(true);
	comparator.setValue(DEFAULT_COMPARATOR);
	comparator.addChangedHandler(new ChangedHandler() {

		@Override
		public void onChanged(ChangedEvent event) {
			refresh();
		}
	});

	DynamicForm form = new DynamicForm();
	form.setTitleOrientation(TitleOrientation.TOP);
	form.setNumCols(1);
	form.setItems(comparator);

	addItem(form);

	refresh();
}
 
Example #30
Source File: QuotaPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void initGUI() {
	tenantQuota = new TenantQuotaPanel(tenant, new ChangedHandler() {

		@Override
		public void onChanged(ChangedEvent event) {

		}
	});

	IButton save = new IButton(I18N.message("save"));
	save.setMinWidth(80);
	save.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(ClickEvent event) {
			if (tenantQuota.validate())
				TenantService.Instance.get().save(tenant, new AsyncCallback<GUITenant>() {

					@Override
					public void onFailure(Throwable caught) {
						Log.serverError(caught);
					}

					@Override
					public void onSuccess(GUITenant ten) {
						QuotaPanel.this.tenant = ten;
						Log.info(I18N.message("settingssaved"), null);
					}
				});
		}
	});

	body.setMembers(tenantQuota);
	addMember(save);
}