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


Java ToggleButton类代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.ToggleButton的典型用法代码示例。如果您正苦于以下问题:Java ToggleButton类的具体用法?Java ToggleButton怎么用?Java ToggleButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ToggleButton类属于com.google.gwt.user.client.ui包,在下文中一共展示了ToggleButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LASAnnotationsButton

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
public LASAnnotationsButton() {
	mainPanel.add(layoutPanel);
	annotationsButton = new ToggleButton(new Image(GWT.getModuleBaseURL()+"../images/i_off.png"), 
			new Image(GWT.getModuleBaseURL()+"../images/i_on.png"), new ClickHandler() {

				@Override
				public void onClick(ClickEvent event) {
					if ( annotationsButton.isDown() ) {	
						setOpen(true);
						annotationsButton.setTitle(DEFAULT_UP_TOOLTIP);
					} else {
						setOpen(false);
						annotationsButton.setTitle(DEFAULT_DOWN_TOOLTIP);
					}						
				}
		
	});
	annotationsButton.setTitle(DEFAULT_UP_TOOLTIP);
	annotationsButton.setStylePrimaryName("OL_MAP-ToggleButton");
	annotationsButton.addStyleDependentName("WIDTH");
	initWidget(annotationsButton);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:23,代码来源:LASAnnotationsButton.java

示例2: LASAnnotationsButtonPanelImpl

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
public LASAnnotationsButtonPanelImpl(String outputPanelID) {
    setName(outputPanelID);
    String moduleBaseURL = GWT.getModuleBaseURL();
    String upImageURL = moduleBaseURL + "../images/i_off.png";
    Image upImage = new Image(upImageURL);
    String downImageURL = moduleBaseURL + "../images/i_on.png";
    Image downImage = new Image(downImageURL);
    button = new ToggleButton(
            upImage,
            downImage);
    button.setTitle("Plot Annotations");
    button.setStylePrimaryName("OL_MAP-ToggleButton");
    button.addStyleDependentName("WIDTH");

    button.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            annotations.setVisible(button.isDown());
        }
    });

    initWidget(button);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:23,代码来源:LASAnnotationsButtonPanelImpl.java

示例3: setSelectedDataSourceType

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
/**
 * Sets the selected Data Source type button to the down position.
 * This method does not fire an event, just changes toggle position
 * @param dsType the data source type
 */
public void setSelectedDataSourceType(String dsType) {
	if(dsType!=null) {
		// de-select all toggle buttons
		deselectDSTypeButtons();
		
		// Set new button toggle state down
		for(ToggleButton tButton : dsTypeButtons) {
			String buttonId = tButton.getElement().getId();
			if(buttonId.equals(dsType)) {
				tButton.setValue(true);
				this.selectedSourceType = dsType;
			}
		}
	}
	updateStatus();
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:22,代码来源:DataSourcePropertiesPanel.java

示例4: ButtonsExample

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
public ButtonsExample() {
  super("Buttons");

  Button button = new Button("Disabled button");
  button.setEnabled(false);
  add(button);

  CheckBox check = new CheckBox("Check box");
  check.setChecked(true);
  add(check);

  PushButton push = new PushButton("Click me", "Clicked");
  add(push);

  ToggleButton toggle = new ToggleButton("Up", "Down");
  add(toggle);

}
 
开发者ID:DavidWhitlock,项目名称:PortlandStateJava,代码行数:19,代码来源:ButtonsExample.java

示例5: addComponentListeners

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void addComponentListeners() {
  ComboBoxSelectItem value = getSelectedValue();
  ToggleButton button = getChoiceButton();

  getListPanel().addChangeHandler(getDelegateHandler());

  //value.addChangeHandler(getDelegateHandler());
  button.addFocusHandler(getDelegateHandler());
  value.addFocusHandler(getDelegateHandler());
  button.addBlurHandler(getDelegateHandler());
  value.addBlurHandler(getDelegateHandler());
  value.addClickHandler(getDelegateHandler());
  button.addClickHandler(getDelegateHandler());
  value.addKeyUpHandler(getDelegateHandler());
  value.addKeyDownHandler(getDelegateHandler());
  value.addKeyPressHandler(getDelegateHandler());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:WidgetComboBox.java

示例6: onClick

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
@Override
public void onClick(ClickEvent event) {
    ToggleButton button = (ToggleButton) event.getSource();
    int index = buttons.indexOf(button);
    if ( button.isDown() ) {
        enable(index);
    } else {
        disable(index, true);
    }
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:11,代码来源:SeasonConstraintPanel.java

示例7: buildPanel

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
@Override
public void buildPanel() {
    viewerPanel = new ViewerPanel();
    showCartographicPositionOnMouseOver();

    _showPosOnMouseOverTBtn = new ToggleButton("Show Cartographic Position on Mouse Over");
    _showPosOnMouseOverTBtn.setValue(true);
    _showPosOnMouseOverTBtn.addValueChangeHandler(new MValueChangeHandler());

    _pickEntityTBtn = new ToggleButton("Pick Entity");
    _pickEntityTBtn.addValueChangeHandler(new MValueChangeHandler());

    _drillDownPickingTBtn = new ToggleButton("Drill-Down Picking");
    _drillDownPickingTBtn.addValueChangeHandler(new MValueChangeHandler());

    _pickPositionTBtn = new ToggleButton("Pick position");
    _pickPositionTBtn.addValueChangeHandler(new MValueChangeHandler());

    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.add(_showPosOnMouseOverTBtn);
    hPanel.add(_pickEntityTBtn);
    hPanel.add(_drillDownPickingTBtn);
    hPanel.add(_pickPositionTBtn);

    AbsolutePanel aPanel = new AbsolutePanel();
    aPanel.add(viewerPanel);
    aPanel.add(hPanel, 20, 20);

    contentPanel.add(new HTML("<p>Use the mouse to select and manipulate objects in the scene.</p>"));
    contentPanel.add(aPanel);

    initWidget(contentPanel);
}
 
开发者ID:iSergio,项目名称:gwt-cs,代码行数:34,代码来源:Picking.java

示例8: onValueChange

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
@Override
public void onValueChange(ValueChangeEvent<Boolean> valueChangeEvent) {
    ToggleButton source = (ToggleButton) valueChangeEvent.getSource();
    reset();
    if (source.equals(_showPosOnMouseOverTBtn)) {
        showCartographicPositionOnMouseOver();

        _pickEntityTBtn.setValue(false);
        _drillDownPickingTBtn.setValue(false);
        _pickPositionTBtn.setValue(false);
    }
    else if (source.equals(_pickEntityTBtn)) {
        pickEntity();

        _showPosOnMouseOverTBtn.setValue(false);
        _drillDownPickingTBtn.setValue(false);
        _pickPositionTBtn.setValue(false);
    }
    else if (source.equals(_drillDownPickingTBtn)) {
        drillDownPicking();

        _showPosOnMouseOverTBtn.setValue(false);
        _pickEntityTBtn.setValue(false);
        _pickPositionTBtn.setValue(false);
    }
    else if (source.equals(_pickPositionTBtn)) {
        pickPosition();

        _showPosOnMouseOverTBtn.setValue(false);
        _pickEntityTBtn.setValue(false);
        _drillDownPickingTBtn.setValue(false);
    }
}
 
开发者ID:iSergio,项目名称:gwt-cs,代码行数:34,代码来源:Picking.java

示例9: deselectDSTypeButtons

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
private void deselectDSTypeButtons() {
// First de-select all to clear current toggle
for(ToggleButton tButton : dsTypeButtons) {
		tButton.setValue(false);
}
// Also make sure addType button is unToggled
if(this.addTypeButton!=null) {
	this.addTypeButton.setValue(false);
}
  }
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:11,代码来源:DataSourcePropertiesPanel.java

示例10: addTabButton

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
private void addTabButton(ToggleButton p_button, String p_title)
{
  p_button.addValueChangeHandler( this );
  p_button.setTitle( p_title );
  p_button.setStyleName( "fmp-PushButton32" );
  m_vTabPanel.add( p_button );
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:8,代码来源:MAppTabMenu.java

示例11: createToggleButton

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
/** Method to create a Toggle button for the toolbar **/
private ToggleButton createToggleButton(String url, Integer top, Integer left, Integer width, Integer height, String tip) {
	Image extract = new Image(url, left, top, width, height);
	ToggleButton tb = new ToggleButton(extract);
	tb.setHeight(height+"px");
	tb.setWidth(width+"px");
	tb.addClickHandler(evHandler);
	if (tip != null) {
		tb.setTitle(tip);
	}
	return tb;
}
 
开发者ID:fhcampuswien,项目名称:atom,代码行数:13,代码来源:RichTextToolbar.java

示例12: setOpen

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
public void setOpen(ToggleButton annotationsButton) {
	this.setVisible(true);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:4,代码来源:LASAnnotationsPanel.java

示例13: createToggleButton

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
private ToggleButton createToggleButton(AbstractImagePrototype img, String tip) {
  ToggleButton tb = new ToggleButton(img.createImage());
  tb.addClickListener(listener);
  tb.setTitle(tip);
  return tb;
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:7,代码来源:RichTextToolbar.java

示例14: createToggleButton

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
private ToggleButton createToggleButton(AbstractImagePrototype img, String tip) {
  ToggleButton tb = new ToggleButton(img.createImage());
  tb.addClickHandler(handler);
  tb.setTitle(tip);
  return tb;
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:7,代码来源:RichTextToolbar.java

示例15: createToggleButton

import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
private ToggleButton createToggleButton(ImageResource img, String tip) {
    ToggleButton tb = new ToggleButton(new Image(img));
    tb.addClickHandler(handler);
    tb.setTitle(tip);
    return tb;
}
 
开发者ID:inepex,项目名称:ineform,代码行数:7,代码来源:RichTextToolbar.java


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