当前位置: 首页>>代码示例>>Java>>正文


Java ListBox.setWidth方法代码示例

本文整理汇总了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);
			}
		}
	});
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:24,代码来源:AdvancedKVExtractionView.java

示例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;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:10,代码来源:FilterPanel.java

示例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");
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:66,代码来源:DataTypeSelectPanel.java

示例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);
	}
 
开发者ID:dpinney,项目名称:essence,代码行数:62,代码来源:AnalyzerAndReportUI.java


注:本文中的com.google.gwt.user.client.ui.ListBox.setWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。