本文整理汇总了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);
}
示例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);
}
示例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();
}
示例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);
}
示例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());
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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 );
}
示例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;
}
示例12: setOpen
import com.google.gwt.user.client.ui.ToggleButton; //导入依赖的package包/类
public void setOpen(ToggleButton annotationsButton) {
this.setVisible(true);
}
示例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;
}
示例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;
}
示例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;
}