use of com.extjs.gxt.ui.client.widget.form.LabelField in project activityinfo by bedatadriven.
the class PolygonLayerOptions method createColorPicker.
private void createColorPicker() {
colorPicker.setValue("000000");
// Set the selected color to the maplayer
colorPicker.addListener(Events.Select, new Listener<ColorPaletteEvent>() {
@Override
public void handleEvent(ColorPaletteEvent be) {
if (!Objects.equal(layer.getMaxColor(), colorPicker.getValue())) {
layer.setMaxColor(colorPicker.getValue());
ValueChangeEvent.fire(PolygonLayerOptions.this, layer);
}
}
});
LabelField labelColor = new LabelField(I18N.CONSTANTS.color());
add(labelColor);
add(colorPicker);
}
use of com.extjs.gxt.ui.client.widget.form.LabelField in project activityinfo by bedatadriven.
the class BubbleLayerOptions method createMinMaxSliders.
private void createMinMaxSliders() {
setSliderDefaults(sliderMinSize);
setSliderDefaults(sliderMaxSize);
sliderMinSize.setValue(16);
sliderMaxSize.setValue(48);
LabelField labelMin = new LabelField(I18N.CONSTANTS.radiusMinimum());
LabelField labelMax = new LabelField(I18N.CONSTANTS.radiusMaximum());
add(labelMin);
add(sliderMinSize);
add(labelMax);
add(sliderMaxSize);
// Ensure min can't be more then max, and max can't be less then min
sliderMinSize.addListener(Events.Change, new Listener<SliderEvent>() {
@Override
public void handleEvent(SliderEvent be) {
timerMinSlider.cancel();
timerMinSlider.schedule(250);
}
});
sliderMaxSize.addListener(Events.Change, new Listener<SliderEvent>() {
@Override
public void handleEvent(SliderEvent be) {
timerMaxSlider.cancel();
timerMaxSlider.schedule(250);
}
});
timerMinSlider = new Timer() {
@Override
public void run() {
if (sliderMinSize.getValue() > sliderMaxSize.getValue()) {
sliderMinSize.setValue(sliderMaxSize.getValue());
}
bubbleMapLayer.setMinRadius(sliderMinSize.getValue());
ValueChangeEvent.fire(BubbleLayerOptions.this, bubbleMapLayer);
}
};
timerMaxSlider = new Timer() {
@Override
public void run() {
if (sliderMaxSize.getValue() < sliderMinSize.getValue()) {
sliderMaxSize.setValue(sliderMinSize.getValue());
}
bubbleMapLayer.setMaxRadius(sliderMaxSize.getValue());
ValueChangeEvent.fire(BubbleLayerOptions.this, bubbleMapLayer);
}
};
}
use of com.extjs.gxt.ui.client.widget.form.LabelField in project activityinfo by bedatadriven.
the class WarningBar method initializeComponent.
private void initializeComponent() {
panelMain = new HorizontalPanel();
add(panelMain);
imageLocked = IconImageBundle.ICONS.lockedPeriod().createImage();
panelMain.add(imageLocked);
labelMessage = new LabelField();
panelMain.add(labelMessage);
setStyleAttribute("padding", "0.25em");
setStyleAttribute("background-color", "#F5A9A9");
}
use of com.extjs.gxt.ui.client.widget.form.LabelField in project activityinfo by bedatadriven.
the class AddLockedPeriodDialog method initializeComponent.
private void initializeComponent() {
setWidth(400);
setHeight(280);
setHeaderVisible(false);
fieldsetContainer = new FieldSet();
fieldsetContainer.setHeading(I18N.CONSTANTS.type());
comboboxProjects = new ComboBox<ProjectDTO>();
storeProjects = new ListStore<ProjectDTO>();
comboboxProjects.setStore(storeProjects);
comboboxProjects.setDisplayField("name");
comboboxProjects.setForceSelection(true);
comboboxProjects.setTriggerAction(TriggerAction.ALL);
comboboxProjects.setEditable(false);
comboboxActivities = new ComboBox<ActivityDTO>();
storeActivities = new ListStore<ActivityDTO>();
comboboxActivities.setStore(storeActivities);
comboboxActivities.setDisplayField("name");
comboboxActivities.setForceSelection(true);
comboboxActivities.setTriggerAction(TriggerAction.ALL);
comboboxActivities.setEditable(false);
radiogroupContainer = new RadioGroup();
radiogroupContainer.setFieldLabel(I18N.CONSTANTS.type());
labelDatabase = new LabelField(I18N.CONSTANTS.database());
labelDatabase.setWidth(100);
labelDatabaseName = new LabelField();
radioDatabase = new Radio();
radioDatabase.setFieldLabel(I18N.CONSTANTS.database());
radioDatabase.addListener(Events.Change, new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent be) {
}
});
radiogroupContainer.add(radioDatabase);
panelDatabase = new HorizontalPanel();
panelDatabase.add(labelDatabase);
panelDatabase.add(radioDatabase);
panelDatabase.add(labelDatabaseName);
fieldsetContainer.add(panelDatabase);
radioActivity = new Radio();
radioActivity.setFieldLabel(I18N.CONSTANTS.activity());
labelActivity = new LabelField(I18N.CONSTANTS.activity());
labelActivity.setWidth(100);
panelActivity = new HorizontalPanel();
panelActivity.add(labelActivity);
panelActivity.add(radioActivity);
panelActivity.add(comboboxActivities);
fieldsetContainer.add(panelActivity);
radiogroupContainer.add(radioActivity);
radioProject = new Radio();
radioProject.setFieldLabel(I18N.CONSTANTS.project());
radioProject.addListener(Events.Change, new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent be) {
comboboxProjects.setEnabled(radioProject.getValue());
}
});
labelProject = new LabelField(I18N.CONSTANTS.project());
labelProject.setWidth(100);
panelProject = new HorizontalPanel();
panelProject.add(labelProject);
panelProject.add(radioProject);
panelProject.add(comboboxProjects);
fieldsetContainer.add(panelProject);
radiogroupContainer.add(radioProject);
add(fieldsetContainer);
textfieldName = new TextField<String>();
textfieldName.setFieldLabel(I18N.CONSTANTS.name());
textfieldName.setAllowBlank(false);
add(textfieldName);
checkboxEnabled = new CheckBox();
checkboxEnabled.setFieldLabel(I18N.CONSTANTS.enabledColumn());
add(checkboxEnabled);
datefieldFromDate = new DateField();
datefieldFromDate.setFieldLabel(I18N.CONSTANTS.fromDate());
datefieldFromDate.setAllowBlank(false);
add(datefieldFromDate);
datefieldToDate = new DateField();
datefieldToDate.setFieldLabel(I18N.CONSTANTS.toDate());
datefieldFromDate.setAllowBlank(false);
add(datefieldToDate);
radiogroupContainer.addListener(Events.Change, new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent be) {
comboboxActivities.setAllowBlank(!radioActivity.getValue());
comboboxProjects.setAllowBlank(!radioProject.getValue());
comboboxActivities.clearInvalid();
comboboxProjects.clearInvalid();
}
});
}
use of com.extjs.gxt.ui.client.widget.form.LabelField in project activityinfo by bedatadriven.
the class WarningBar method initializeComponent.
private void initializeComponent() {
panelMain = new HorizontalPanel();
add(panelMain);
imageLocked = IconImageBundle.ICONS.lockedPeriod().createImage();
panelMain.add(imageLocked);
labelMessage = new LabelField();
panelMain.add(labelMessage);
setStyleAttribute("padding", "0.25em");
setStyleAttribute("background-color", "#F5A9A9");
}
Aggregations