this.valueItem = new TextItem("value", MSG.common_title_value());
this.valueItem.setTooltip(MSG.view_dynagroup_exprBuilder_value_tooltip());
this.valueItem.setWidth(200);
this.valueItem.setHoverWidth(250);
this.valueItem.setDefaultValue("");
this.valueItem.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
buildExpressionValue();
}
});
this.compareTypeItem = new SortedSelectItem("compareType", MSG.view_dynagroup_exprBuilder_comparisonType());
this.compareTypeItem.setTooltip(MSG.view_dynagroup_exprBuilder_comparisonType_tooltip());
this.compareTypeItem.setHoverWidth(250);
this.compareTypeItem.setRedrawOnChange(true);
this.compareTypeItem.setWidth("*");
this.compareTypeItem.setDefaultToFirstOption(true);
this.compareTypeItem.setValueMap(MSG.view_dynagroup_exprBuilder_comparisonType_equals(), //
MSG.view_dynagroup_exprBuilder_comparisonType_startsWith(), //
MSG.view_dynagroup_exprBuilder_comparisonType_endsWith(), //
MSG.view_dynagroup_exprBuilder_comparisonType_contains());
this.compareTypeItem.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
buildExpressionValue();
}
});
this.unsetItem = new RadioGroupItem("unset", MSG.view_dynagroup_exprBuilder_unset());
this.unsetItem.setTooltip(MSG.view_dynagroup_exprBuilder_unset_tooltip());
this.unsetItem.setHoverWidth(250);
this.unsetItem.setDefaultValue(MSG.common_val_no());
this.unsetItem.setValueMap(MSG.common_val_yes(), MSG.common_val_no());
this.unsetItem.setVertical(false);
this.unsetItem.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
enableDisableComponents();
buildExpressionValue();
}
});
this.propertyNameItem = new SelectItem("propertyName", MSG.view_dynagroup_exprBuilder_propertyName());
this.propertyNameItem.setTooltip(MSG.view_dynagroup_exprBuilder_propertyName_tooltip());
this.propertyNameItem.setHoverWidth(250);
this.propertyNameItem.setRedrawOnChange(true);
this.propertyNameItem.setWidth("*");
this.propertyNameItem.setDefaultToFirstOption(true);
this.propertyNameItem.setEmptyDisplayValue(MSG.view_dynagroup_exprBuilder_noProperties());
this.propertyNameItem.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
buildExpressionValue();
}
});
this.resourceTypeItem = new SortedSelectItem("resourceType", MSG.view_dynagroup_exprBuilder_resourceType());
this.resourceTypeItem.setTooltip(MSG.view_dynagroup_exprBuilder_resourceType_tooltip());
this.resourceTypeItem.setHoverWidth(250);
this.resourceTypeItem.setRedrawOnChange(true);
this.resourceTypeItem.setWidth("*");
this.resourceTypeItem.setDefaultToFirstOption(true);
this.resourceTypeItem.setEmptyDisplayValue(MSG.view_dynagroup_exprBuilder_noResourceTypes());
this.resourceTypeItem.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
loadPropertyNameDropDown();
}
});
this.pluginItem = new SortedSelectItem("plugin", MSG.view_dynagroup_exprBuilder_definingPlugin());
this.pluginItem.setTooltip(MSG.view_dynagroup_exprBuilder_definingPlugin_tooltip());
this.pluginItem.setHoverWidth(250);
this.pluginItem.setRedrawOnChange(true);
this.pluginItem.setWidth("*");
this.pluginItem.setDefaultToFirstOption(true);
this.pluginItem.setEmptyDisplayValue(MSG.view_dynagroup_exprBuilder_noPlugins());
this.pluginItem.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
Object newValue = event.getValue();
if (newValue != null) {
loadResourceTypeDropDown(newValue.toString());
}
}
});
GWTServiceLookup.getPluginService().getAgentPlugins(false, new AsyncCallback<ArrayList<Plugin>>() {
@Override
public void onSuccess(ArrayList<Plugin> result) {
plugins.clear();
for (Plugin plugin : result) {
if (plugin.isEnabled()) {
plugins.add(plugin.getName());
}
}
Collections.sort(plugins);
pluginItem.setValueMap(plugins.toArray(new String[plugins.size()]));
pluginItem.clearValue();
// do the initial population of the resource type drop down
if (!plugins.isEmpty()) {
loadResourceTypeDropDown(plugins.get(0));
}
markForRedraw();
}
@Override
public void onFailure(Throwable caught) {
CoreGUI.getErrorHandler().handleError(MSG.view_dynagroup_exprBuilder_pluginLoadFailure(), caught);
}
});
this.expressionTypeItem = new SortedSelectItem("expressionType",
MSG.view_dynagroup_exprBuilder_expressionType());
this.expressionTypeItem.setTooltip(MSG.view_dynagroup_exprBuilder_expressionType_tooltip());
this.expressionTypeItem.setHoverWidth(250);
this.expressionTypeItem.setRedrawOnChange(true);
this.expressionTypeItem.setWidth("*");
this.expressionTypeItem.setDefaultToFirstOption(true);
this.expressionTypeItem.setValueMap(MSG.view_dynagroup_exprBuilder_expressionType_resource(), //
MSG.view_dynagroup_exprBuilder_expressionType_resourceType(), //
MSG.view_dynagroup_exprBuilder_expressionType_resourceCategory(), //
MSG.view_dynagroup_exprBuilder_expressionType_trait(), //
MSG.view_dynagroup_exprBuilder_expressionType_pluginConfig(), //
MSG.view_dynagroup_exprBuilder_expressionType_resourceConfig());
this.expressionTypeItem.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
enableDisableComponents();
loadPropertyNameDropDown();
}
});
this.resourceItem = new SortedSelectItem("resource", MSG.view_dynagroup_exprBuilder_resource());
this.resourceItem.setTooltip(MSG.view_dynagroup_exprBuilder_resource_tooltip());
this.resourceItem.setHoverWidth(250);
this.resourceItem.setRedrawOnChange(true);
this.resourceItem.setWidth("*");
this.resourceItem.setDefaultToFirstOption(true);
this.resourceItem.setValueMap(MSG.view_dynagroup_exprBuilder_resource_resource(), //
MSG.view_dynagroup_exprBuilder_resource_child(), //
MSG.view_dynagroup_exprBuilder_resource_parent(), //
MSG.view_dynagroup_exprBuilder_resource_grandparent(), //
MSG.view_dynagroup_exprBuilder_resource_greatGrandparent(), //
MSG.view_dynagroup_exprBuilder_resource_greatGreatGrandparent());
this.resourceItem.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
buildExpressionValue();
}
});
this.memberOfItem = new RadioGroupItem("memberOf", MSG.view_dynagroup_exprBuilder_memberOf());
this.memberOfItem.setTooltip(MSG.view_dynagroup_exprBuilder_memberOf_tooltip());
this.memberOfItem.setHoverWidth(250);
this.memberOfItem.setDefaultValue(MSG.common_val_no());
this.memberOfItem.setValueMap(MSG.common_val_yes(), MSG.common_val_no());
this.memberOfItem.setVertical(false);
this.memberOfItem.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
enableDisableComponents();
buildExpressionValue();
}
});
this.memberOfGroupItem = new SingleResourceGroupSelectorItem("memberOfGroup", MSG.common_title_group(), null);
this.memberOfGroupItem.setTooltip(MSG.view_dynagroup_exprBuilder_groupBy_tooltip());
this.memberOfGroupItem.setHoverWidth(250);
this.memberOfGroupItem.setRedrawOnChange(true);
this.memberOfGroupItem.setWidth("*");
this.memberOfGroupItem.setDefaultToFirstOption(true);
this.memberOfGroupItem.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
buildExpressionValue();
}
});
this.groupByItem = new RadioGroupItem("groupBy", MSG.view_dynagroup_exprBuilder_groupBy());
this.groupByItem.setTooltip(MSG.view_dynagroup_exprBuilder_groupBy_tooltip());
this.groupByItem.setHoverWidth(250);
this.groupByItem.setDefaultValue(MSG.common_val_no());
this.groupByItem.setValueMap(MSG.common_val_yes(), MSG.common_val_no());
this.groupByItem.setVertical(false);
this.groupByItem.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
enableDisableComponents();
buildExpressionValue();
}