本文整理匯總了Java中com.google.gwt.user.client.ui.ListBox.setWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java ListBox.setWidth方法的具體用法?Java ListBox.setWidth怎麽用?Java ListBox.setWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.ListBox
的用法示例。
在下文中一共展示了ListBox.setWidth方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setKeyPatternPanelView
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
private void setKeyPatternPanelView() {
keyPatternText = new TextBox();
keyPatternText.addStyleName(AdminConstants.GWT_ADVANCED_KV_TEXT_BOX);
keyPatternField = new ListBox();
keyPatternField.setWidth("98%");
keyPatternPanel.add(keyPatternText);
useExistingKey.setValue(Boolean.FALSE);
useExistingKey.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> arg0) {
if (arg0.getValue().equals(Boolean.TRUE)) {
keyPatternValidateButton.setEnabled(Boolean.FALSE);
keyPatternPanel.remove(keyPatternText);
keyPatternPanel.add(keyPatternField);
} else {
keyPatternValidateButton.setEnabled(Boolean.TRUE);
keyPatternPanel.remove(keyPatternField);
keyPatternPanel.add(keyPatternText);
}
}
});
}
示例2: createEnumInput
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
private ListBox createEnumInput(boolean isMultiSelect) {
ListBox lb = new ListBox(isMultiSelect);
lb.setVisibleItemCount(isMultiSelect ? 5 : 1);
if (isMultiSelect && BrowserUtil.isIE()) {
lb.setHeight("70px");
}
lb.setWidth("130px");
return lb;
}
示例3: init
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
/**
* UI initialization
*/
public void init()
{
this.setSize("480px", "100px");
//Dialog box title
closeButton.setSize("10px", "10px");
closeButton.setStyleName("closebtn");
//Selection dialog
HorizontalPanel typeListPanel = new HorizontalPanel();
typeListPanel.setStyleName("popupDatatypeSelectPanel");
typeListBox = new ListBox();
typeListBox.setWidth("120px");
typeListBox.addItem("----");
typeListBox.addItem(DatasetType.GENERAL.getDesc());
typeListBox.addItem(DatasetType.CSV.getDesc());
typeListBox.addItem(DatasetType.TSV.getDesc());
typeListBox.addItem(DatasetType.JSON.getDesc());
if(dataset.getContenttype() == null || dataset.getContenttype() .equals(""))
typeListBox.setSelectedIndex(0);
else
{
for(int i = 0 ; i<typeListBox.getItemCount() ; i++)
{
if(typeListBox.getItemText(i).equals(dataset.getContenttype()))
{
typeListBox.setSelectedIndex(i);
break;
}
}
}
Label selectLabel = new Label("Select data type: ");
typeListPanel.add(selectLabel);
typeListPanel.add(typeListBox);
//Ok and cancel button
HorizontalPanel buttonPanel = new HorizontalPanel();
buttonPanel.setStyleName("popupDatatypeButtonPanel");
okBtn = new Button("Ok");
okBtn.setStyleName("button-style");
cancelBtn = new Button("Cancel");
cancelBtn.setStyleName("button-style");
buttonPanel.add(okBtn);
buttonPanel.add(cancelBtn);
//Overall arrangement
VerticalPanel topPanel = new VerticalPanel();
topPanel.add(closeButton);
topPanel.setCellHeight(closeButton, "13px");
topPanel.setStyleName("vpanel");
desc.setStyleName("popupDatatypeSelectTitle");
topPanel.add(desc);
topPanel.setCellHeight(desc, "30px");
topPanel.add(typeListPanel);
topPanel.add(buttonPanel);
this.setGlassEnabled(true);
this.setModal(true);
this.add(topPanel);
this.center();
this.setStyleName("loading-panel");
}
示例4: YoungAndroidComponentSelectorPropertyEditor
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
/**
* Creates a new property editor for selecting a component, where the
* user chooses among components of one or more component types.
*
* @param editor the editor that this property editor belongs to
* @param componentTypes types of component that can be selected, or null if
* all types of components can be selected.
*/
public YoungAndroidComponentSelectorPropertyEditor(final YaFormEditor editor,
Set<String> componentTypes) {
this.editor = editor;
this.componentTypes = componentTypes;
VerticalPanel selectorPanel = new VerticalPanel();
componentsList = new ListBox();
componentsList.setVisibleItemCount(10);
componentsList.setWidth("100%");
selectorPanel.add(componentsList);
selectorPanel.setWidth("100%");
choices = new ListWithNone(MESSAGES.noneCaption(), new ListWithNone.ListBoxWrapper() {
@Override
public void addItem(String item) {
componentsList.addItem(item);
}
@Override
public String getItem(int index) {
return componentsList.getItemText(index);
}
@Override
public void removeItem(int index) {
componentsList.removeItem(index);
}
@Override
public void setSelectedIndex(int index) {
componentsList.setSelectedIndex(index);
}
});
// At this point, the editor hasn't finished loading.
// Use a DeferredCommand to finish the initialization after the editor has finished loading.
DeferredCommand.addCommand(new Command() {
@Override
public void execute() {
if (editor.isLoadComplete()) {
finishInitialization();
} else {
// Editor still hasn't finished loading.
DeferredCommand.addCommand(this);
}
}
});
initAdditionalChoicePanel(selectorPanel);
}
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:59,代碼來源:YoungAndroidComponentSelectorPropertyEditor.java
示例5: setupDetectorPanel
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
private void setupDetectorPanel(HorizontalPanel detectorPanel, final Label errorLabelActivateDetector,
final ListDataProvider<AnalyzerResultDTO> dataProvider) {
// DoS detector panel
Label detectorTypeLabel = new Label("Filter Type");
final ListBox detectorType = new ListBox();
detectorType.setName("Detector Type");
detectorType.setTitle("Detector Type Title");
detectorType.addItem("VALUE_OUT_OF_BOUND", "VALUE_OUT_OF_BOUND");
detectorType.addItem("MS_EP_CONNECTIVITY", "MS_EP_CONNECTIVITY");
detectorType.addItem("WRONG_MSG_TO_MS_EP", "WRONG_MSG_TO_MS_EP");
//detectorType.addItem("ERR_MSG_FROM_MS_EP", "ERR_MSG_FROM_MS_EP");
//detectorType.addItem("WRONG_MSG_FORMAT", "WRONG_MSG_FORMAT");
detectorType.addItem("DENIAL_OF_SERVICE", "DENIAL_OF_SERVICE");
//detectorType.addItem("NW_SEGMENTATION", "NW_SEGMENTATION");
//detectorType.addItem("NEW_HOST", "NEW_HOST");
detectorType.setWidth("220");
detectorPanel.add(HTMLFormatUtil.getPaddingLabel());
detectorPanel.add(detectorTypeLabel);
detectorPanel.add(detectorType);
// Result display button
Button displayDetectorResultButton = new Button("Show Detector Findings");
// displayDetectorResultButton.addClickHandler(new ClickHandler() {
// public void onClick(ClickEvent event) {
// greetingService.getAnalyzerResultsByType(
// DetectionRuleTypeDTO.valueOf(detectorType.getValue(detectorType.getSelectedIndex())),
// new AsyncCallbackAdapter<List<AnalyzerResultDTO>>() {
// // Called by onFailure if the session is still valid
// public void doFailureAction() {
// errorLabelActivateDetector.setText(SERVER_ERROR);
// }
//
// public void onSuccess(List<AnalyzerResultDTO> result) {
// dataProvider.setList(result);
// }
// });
// }
// });
detectorPanel.add(HTMLFormatUtil.getPaddingLabel());
detectorPanel.add(displayDetectorResultButton);
// Result display button
Button displayAllResultButton = new Button("Show All Findings");
// displayAllResultButton.addClickHandler(new ClickHandler() {
// public void onClick(ClickEvent event) {
// greetingService.getAnalyzerResults(new AsyncCallbackAdapter<List<AnalyzerResultDTO>>() {
// // Called by onFailure if the session is still valid
// public void doFailureAction() {
// errorLabelActivateDetector.setText(SERVER_ERROR);
// }
//
// public void onSuccess(List<AnalyzerResultDTO> result) {
// dataProvider.setList(result);
// }
// });
// }
// });
detectorPanel.add(HTMLFormatUtil.getPaddingLabel());
detectorPanel.add(displayAllResultButton);
}