HorizontalPanel parameterPanel0 = new HorizontalPanel();
parameterPanel0.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_id + "=\"")));
String id = param.getId();
final TextBox parameterId = new TextBox();
parameterId.setText(id);
parameterId.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
param.updateId(param.getId(), parameterId.getText());
}
});
parameterPanel0.add(parameterId);
parameterPanel0.add(new HTML(SyntaxHighlighter.highlight("\"")));
parameterPanelRight.add(parameterPanel0);
}
HorizontalPanel parameterPanel1 = new HorizontalPanel();
parameterPanel1.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_name + "=\"")));
String name = param.getName();
final TextBox parameterName = new TextBox();
parameterName.setText(name);
parameterName.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
requestString = param.getApplication().getAnalyzer().getRequestString();
updateParamName(parameterName.getText());
param.getApplication().getAnalyzer().setRequestString(requestString);
}
});
parameterName.addKeyboardListener(new KeyboardListener() {
public void onKeyDown(Widget sender, char keyCode, int modifiers) {
}
public void onKeyPress(Widget sender, char keyCode, int modifiers) {
}
public void onKeyUp(Widget sender, char keyCode, int modifiers) {
requestString = param.getApplication().getAnalyzer().getRequestString();
updateParamName(parameterName.getText());
param.getApplication().getAnalyzer().setRequestString(requestString);
}
});
parameterPanel1.add(parameterName);
parameterPanel1.add(new HTML(SyntaxHighlighter.highlight("\"")));
parameterPanelRight.add(parameterPanel1);
HorizontalPanel parameterPanel2 = new HorizontalPanel();
parameterPanel2.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_type + "=\"")));
final ListBox parameterType = new ListBox();
parameterType.setVisibleItemCount(1);
addTypes(parameterType);
String supposedType = param.getType();
parameterType.setSelectedIndex(indexOfValue(supposedType));
parameterPanel2.add(parameterType);
parameterPanel2.add(new HTML(SyntaxHighlighter.highlight("\"")));
if (param.getEstimateQuality().equals(TypeEstimator.sure)) {
estimationQualityHtml = sureHtml;
}
else if (param.getEstimateQuality().equals(TypeEstimator.supposed)) {
estimationQualityHtml = believedHtml;
}
else if (param.getEstimateQuality().equals(TypeEstimator.unsure)) {
estimationQualityHtml = unsureHtml;
}
else if (param.getEstimateQuality().equals(TypeEstimator.manual)) {
estimationQualityHtml = manualHtml;
}
else {
estimationQualityHtml = new HTML();
}
parameterPanel2.add(estimationQualityHtml);
parameterType.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
String selectedType = parameterType.getItemText(parameterType.getSelectedIndex());
if (selectedType.equals(GuiFactory.strings.newCustomType())) {
CustomTypesDialog.show(parameterType, param, (GenericNode) parentNode, parentTreeItem, paramCounter, estimationQualityHtml);
}
else {
updateParam(selectedType);
}
}
});
parameterPanelRight.add(parameterPanel2);
HorizontalPanel parameterPanel4 = new HorizontalPanel();
parameterPanel4.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_style + "=\"")));
final ListBox parameterStyle = new ListBox();
parameterStyle.setVisibleItemCount(1);
if (parentNode instanceof ResourceTypeNode) {
addResourceTypeStyles(parameterStyle);
}
else if (parentNode instanceof ResourceNode) {
addResourceStyles(parameterStyle);
}
else if (parentNode instanceof RequestNode) {
addRequestStyles(parameterStyle);
}
else if (parentNode instanceof ResponseNode) {
addResponseStyles(parameterStyle);
}
else if (parentNode instanceof RepresentationNode) {
addRepresentationStyles(parameterStyle);
}
else if (parentNode instanceof FaultNode) {
addFaultStyles(parameterStyle);
}
else {
addStyles(parameterStyle);
}
parameterStyle.setSelectedIndex(indexOfStyle(param.getStyle(), parameterStyle));
parameterStyle.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
param.updateStyle(param.getStyle(), parameterStyle.getItemText(parameterStyle.getSelectedIndex()));
}
});
parameterPanel4.add(parameterStyle);
parameterPanel4.add(new HTML(SyntaxHighlighter.highlight("\"")));
parameterPanelRight.add(parameterPanel4);
final VerticalPanel detailsPanel = new VerticalPanel();
detailsPanel.setVisible(SettingsDialog.alwaysShowDetails);
parameterPanel4.add(new HTML("<img align=\"absmiddle\" src=\"./images/details.png\" style=\"margin-left:10em;\" hspace=\"2\" />"));
final Hyperlink showDetails;
if (SettingsDialog.alwaysShowDetails) {
showDetails = new Hyperlink(GuiFactory.strings.hideDetails(), true, "");
}
else {
showDetails = new Hyperlink(GuiFactory.strings.showDetails(), true, "");
}
showDetails.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
if (detailsPanel.isVisible()) {
detailsPanel.setVisible(false);
showDetails.setText(GuiFactory.strings.showDetails());
}
else {
detailsPanel.setVisible(true);
showDetails.setText(GuiFactory.strings.hideDetails());
}
}
});
parameterPanel4.add(showDetails);
HorizontalPanel parameterPanel5 = new HorizontalPanel();
parameterPanel5.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_default + "=\"")));
final TextBox parameterDefault = new TextBox();
parameterDefault.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
param.updateDefaultValue(param.getDefaultValue(), parameterDefault.getText());
}
});
parameterDefault.setText(param.getDefaultValue());
parameterPanel5.add(parameterDefault);
parameterPanel5.add(new HTML(SyntaxHighlighter.highlight("\"")));
detailsPanel.add(parameterPanel5);
HorizontalPanel parameterPanel9 = new HorizontalPanel();
parameterPanel9.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_path + "=\"")));
final TextBox parameterPath = new TextBox();
parameterPath.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
param.updatePath(param.getPath(), parameterPath.getText());
}
});
parameterPath.setText(param.getPath());
parameterPanel9.add(parameterPath);
parameterPanel9.add(new HTML(SyntaxHighlighter.highlight("\"")));
detailsPanel.add(parameterPanel9);
HorizontalPanel parameterPanel6 = new HorizontalPanel();
parameterPanel6.add(new HTML((SyntaxHighlighter.highlight(WadlXml.param_fixed + "=\""))));
final TextBox parameterFixed = new TextBox();
parameterFixed.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
param.updateFixedValue(param.getFixedValue(), parameterFixed.getText());
}
});
parameterFixed.setText(param.getFixedValue());
parameterPanel6.add(parameterFixed);
parameterPanel6.add(new HTML(SyntaxHighlighter.highlight("\"")));
detailsPanel.add(parameterPanel6);
HorizontalPanel parameterPanel7 = new HorizontalPanel();
parameterPanel7.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_required + "=\"")));
final ListBox parameterRequired = new ListBox();
parameterRequired.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
boolean newIsRequired = false;
if (parameterRequired.getItemText(parameterRequired.getSelectedIndex()).equals("true")) {
newIsRequired = true;
}
param.updateIsRequired(param.getIsRequired(), newIsRequired);
}
});
parameterRequired.setVisibleItemCount(1);
parameterRequired.addItem("true");
parameterRequired.addItem("false");
if (param.getIsRequired()) {
parameterRequired.setSelectedIndex(0);
}
else {
parameterRequired.setSelectedIndex(1);
}
parameterPanel7.add(parameterRequired);
parameterPanel7.add(new HTML(SyntaxHighlighter.highlight("\"")));
detailsPanel.add(parameterPanel7);
HorizontalPanel parameterPanel8 = new HorizontalPanel();
parameterPanel8.add(new HTML(SyntaxHighlighter.highlight(WadlXml.param_repeating + "=\"")));
final ListBox parameterRepeating = new ListBox();
parameterRepeating.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
boolean newIsRepeating = false;
if (parameterRepeating.getItemText(parameterRepeating.getSelectedIndex()).equals("true")) {
newIsRepeating = true;
}