本文整理汇总了Java中com.google.gwt.user.client.ui.Button.addStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Button.addStyleName方法的具体用法?Java Button.addStyleName怎么用?Java Button.addStyleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Button
的用法示例。
在下文中一共展示了Button.addStyleName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UniTimeMobileMenu
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public UniTimeMobileMenu() {
iMenuButton = new Button(MESSAGES.mobileMenuSymbol());
iMenuButton.addStyleName("unitime-MobileMenuButton");
iMenuButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (iStackPanel.isVisible())
hideMenu();
else
showMenu();
}
});
iStackPanel = new MyStackPanel();
iStackPanel.setVisible(false);
initWidget(iMenuButton);
}
示例2: initEdititButton
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Helper method called by constructor to initialize the edit it button
* Only seen by app owner.
*/
private void initEdititButton() {
final User currentUser = Ode.getInstance().getUser();
if(app.getDeveloperId().equals(currentUser.getUserId())){
editButton = new Button(MESSAGES.galleryEditText());
editButton.addClickHandler(new ClickHandler() {
// Open up source file if clicked the action button
public void onClick(ClickEvent event) {
editButton.setEnabled(false);
Ode.getInstance().switchToGalleryAppView(app, GalleryPage.UPDATEAPP);
}
});
editButton.addStyleName("app-action-button");
appAction.add(editButton);
}
}
示例3: initTryitButton
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Helper method called by constructor to initialize the try it button
*/
private void initTryitButton() {
actionButton = new Button(MESSAGES.galleryOpenText());
actionButton.addClickHandler(new ClickHandler() {
// Open up source file if clicked the action button
public void onClick(ClickEvent event) {
actionButton.setEnabled(false);
/*
* open a popup window that will prompt to ask user to enter
* a new project name(if "new name" is not valid, user may need to
* enter again). After that, "loadSourceFil" and "appWasDownloaded"
* will be called.
*/
new RemixedYoungAndroidProjectWizard(app, actionButton).center();
}
});
actionButton.addStyleName("app-action-button");
appAction.add(actionButton);
}
示例4: initCancelButton
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Helper method called by constructor to initialize the cancel button
*/
private void initCancelButton() {
cancelButton = new Button(MESSAGES.galleryCancelText());
cancelButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (editStatus==NEWAPP) {
Ode.getInstance().switchToProjectsView();
}else if(editStatus==UPDATEAPP){
Ode.getInstance().switchToGalleryAppView(app, GalleryPage.VIEWAPP);
}
}
});
cancelButton.addStyleName("app-action-button");
appAction.add(cancelButton);
}
示例5: BadConnectionNotifierViewImpl
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
@Inject
public BadConnectionNotifierViewImpl(
final HostedLocalizationConstant localizationConstant,
final PromptToLoginViewImplUiBinder uiBinder,
final HostedResources resources) {
this.resources = resources;
this.setWidget(uiBinder.createAndBindUi(this));
final Button okButton =
createButton(
localizationConstant.okButtonTitle(),
"ok-button",
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
delegate.onOkClicked();
}
});
okButton.addStyleName(this.resources.hostedCSS().blueButton());
addButtonToFooter(okButton);
}
示例6: helloWorld
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private void helloWorld() throws Exception {
JSONObject sampleData = new JSONObject();
sampleData.put("Field1", new JSONNumber(1.0));
sampleData.put("Field2", new JSONString("Hello world"));
sampleData.put("Field3", JSONBoolean.getInstance(true));
// Sample 1 - basic usage
final FormLayout formLayout = new FormLayout(sampleData.toString());
RootPanel.get().add(formLayout);
Button button = new Button("Apply");
button.addStyleName(style.apply());
button.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.alert(formLayout.getDataJson());
}
});
formLayout.appendWidgetToBottom(button);
}
示例7: showEndGame
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public void showEndGame(final Runnable runnable) {
final DialogBox box = new DialogBox();
box.setAnimationEnabled(true);
box.setText("Thanks for playing Higher or Lower! *ding*ding*ding*ding*");
Button b = new Button("Thanks for having me!");
b.addStyleName("centered");
b.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
runnable.run();
box.hide();
}
});
box.setWidget(b);
box.center();
box.show();
}
示例8: ErrorPopup
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public ErrorPopup(Widget w){
super(false, true);
VerticalPanel response = new VerticalPanel();
setText("Erro");
setAnimationEnabled(true);
setWidget(response);
response.add(w);
w.addStyleName("errorMessage");
response.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
Button closeButton = new Button("Fechar");
response.add(closeButton);
closeButton.addStyleName("closeButton");
closeButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
hide();
}
});
}
示例9: ErrorPopup
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public ErrorPopup(Widget w){
super(false, true);
VerticalPanel response = new VerticalPanel();
setText("Error");
setAnimationEnabled(true);
setWidget(response);
response.add(w);
w.addStyleName("errorMessage");
response.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
Button closeButton = new Button("Close");
response.add(closeButton);
closeButton.addStyleName("closeButton");
closeButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
hide();
}
});
}
示例10: genButton
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private Button genButton(final int bitm) {
Button btn = GWT.create(Button.class);
btn.setStylePrimaryName("v-nativebutton");
switch (bitm) {
case VIEW_BITM:
btn.addStyleName("v-view");
break;
case EDIT_BITM:
btn.addStyleName("v-edit");
break;
case DELETE_BITM:
btn.addStyleName("v-delete");
break;
}
btn.setHTML("<span></span>");
btn.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
VButtonValueRenderer.this.clickedBITM = bitm;
VButtonValueRenderer.super.onClick(event);
}
});
return btn;
}
示例11: JobDescPopupPanel
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public JobDescPopupPanel(String title) {
Label label = new Label(title);
label.setStyleName("bda-newjob-head");
verticalPanel.add(label);
verticalPanel.add(createGrid());
HorizontalPanel hpanel = new HorizontalPanel();
hpanel.setStyleName("bda-newjob-hpanel");
verticalPanel.add(errorLabel);
Button cancelBtn = new Button(Constants.studioUIMsg.cancel());
cancelBtn.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
JobDescPopupPanel.this.hide();
}
});
hpanel.add(submitBtn);
hpanel.add(cancelBtn);
submitBtn.removeStyleName("gwt-Button");
cancelBtn.removeStyleName("gwt-Button");
submitBtn.addStyleName("button-style");
cancelBtn.addStyleName("button-style");
errorLabel.setStyleName("error-label");
verticalPanel.add(hpanel);
verticalPanel.addStyleName("bda-newjob");
this.setCloseEnable(false);
}
示例12: initAppComments
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Helper method called by constructor to initialize the app's comment area
*/
private void initAppComments() {
// App details - comments
appDetails.add(appComments);
appComments.addStyleName("app-comments-wrapper");
Label commentsHeader = new Label("Comments and Reviews");
commentsHeader.addStyleName("app-comments-header");
appComments.add(commentsHeader);
final TextArea commentTextArea = new TextArea();
commentTextArea.addStyleName("app-comments-textarea");
appComments.add(commentTextArea);
Button commentSubmit = new Button("Submit my comment");
commentSubmit.addStyleName("app-comments-submit");
commentSubmit.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
final OdeAsyncCallback<Long> commentPublishCallback = new OdeAsyncCallback<Long>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(Long date) {
// get the new comment list so gui updates
// note: we might modify the call to publishComment so it returns
// the list instead, this would save one server call
gallery.GetComments(app.getGalleryAppId(), 0, 100);
}
};
Ode.getInstance().getGalleryService().publishComment(app.getGalleryAppId(),
commentTextArea.getText(), commentPublishCallback);
}
});
appComments.add(commentSubmit);
// Add list of comments
gallery.GetComments(app.getGalleryAppId(), 0, 100);
appComments.add(appCommentsList);
appCommentsList.addStyleName("app-comments");
}
示例13: initUpdateButton
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Helper method called by constructor to initialize the publish button
*/
private void initUpdateButton() {
actionButton = new Button(MESSAGES.galleryUpdateText());
actionButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if(!checkIfReadyToPublishOrUpdateApp(app)){
return;
}
actionButton.setEnabled(false);
actionButton.setText(MESSAGES.galleryAppUpdating());
final OdeAsyncCallback<Void> updateSourceCallback = new OdeAsyncCallback<Void>(
MESSAGES.galleryError()) {
@Override
public void onSuccess(Void result) {
gallery.appWasChanged(); // to update the gallery list and page
Ode.getInstance().switchToGalleryAppView(app, GalleryPage.VIEWAPP);
}
@Override
public void onFailure(Throwable caught) {
Window.alert(MESSAGES.galleryNoExtensionsPlease());
actionButton.setEnabled(true);
actionButton.setText(MESSAGES.galleryUpdateText());
}
};
Ode.getInstance().getGalleryService().updateApp(app,imageUploaded,updateSourceCallback);
}
});
actionButton.addStyleName("app-action-button");
appAction.add(actionButton);
}
示例14: createView
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public void createView() {
panel = new FlowPanel();
panel.addStyleName(style.navigationPanel());
searchButton = new Button(ApplicationConstants.CONSTANTS.searchFormButton());
searchButton.addStyleName(style.navigationButton());
panel.add(searchButton);
listButton = new Button(ApplicationConstants.CONSTANTS.listFormButton());
listButton.addStyleName(style.navigationButton());
panel.add(listButton);
}
示例15: SearchMetadata
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* SearchMetadata
*/
public SearchMetadata(HasPropertyHandler propertyHandler) {
formManager = new FormManager(propertyHandler);
table = new FlexTable();
scrollPanel = new ScrollPanel(table);
// Table padding and spacing properties
formManager.getTable().setCellPadding(2);
formManager.getTable().setCellSpacing(2);
groupPopup = new GroupPopup();
groupPopup.setWidth("300px");
groupPopup.setHeight("125px");
groupPopup.setStyleName("okm-Popup");
groupPopup.addStyleName("okm-DisableSelect");
addGroup = new Button(Main.i18n("search.add.property.group"), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
groupPopup.show(UIDockPanelConstants.SEARCH);
}
});
table.setWidget(0, 0, addGroup);
table.setWidget(1, 0, formManager.getTable());
addGroup.setStyleName("okm-AddButton");
addGroup.addStyleName("okm-NoWrap");
initWidget(scrollPanel);
}