本文整理汇总了Java中com.google.gwt.user.client.ui.Button.setStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setStyleName方法的具体用法?Java Button.setStyleName怎么用?Java Button.setStyleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Button
的用法示例。
在下文中一共展示了Button.setStyleName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HelloWorld
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public HelloWorld() {
HTML html = new HTML("Hello Word");
refresh = new Button("refresh UI");
refresh.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
GeneralComunicator.refreshUI();
}
});
vPanel = new VerticalPanel();
vPanel.add(html);
vPanel.add(refresh);
refresh.setStyleName("okm-Input");
initWidget(vPanel);
}
示例2: DebugConsolePopup
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Logout popup
*/
public DebugConsolePopup() {
// Establishes auto-close when click outside
super(false, false);
setText(Main.i18n("debug.console.label"));
vPanel = new VerticalPanel();
button = new Button(Main.i18n("button.close"), this);
text = new HTML(Main.i18n("debug.enable.disable"));
vPanel.add(new HTML("<br>"));
vPanel.add(text);
vPanel.add(Log.getLogger(DivLogger.class).getWidget());
vPanel.add(new HTML("<br>"));
vPanel.add(button);
vPanel.add(new HTML("<br>"));
vPanel.setCellHorizontalAlignment(button, VerticalPanel.ALIGN_CENTER);
button.setStyleName("okm-YesButton");
super.hide();
Log.getLogger(DivLogger.class).getWidget().setVisible(true);
setWidget(vPanel);
}
示例3: LogoutPopup
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Logout popup
*/
public LogoutPopup() {
// Establishes auto-close when click outside
super(false, true);
vPanel = new VerticalPanel();
text = new HTML(Main.i18n("logout.logout"));
button = new Button(Main.i18n("button.close"), this);
vPanel.setWidth("250px");
vPanel.setHeight("100px");
vPanel.add(new HTML("<br>"));
vPanel.add(text);
vPanel.add(new HTML("<br>"));
vPanel.add(button);
vPanel.add(new HTML("<br>"));
vPanel.setCellHorizontalAlignment(text, VerticalPanel.ALIGN_CENTER);
vPanel.setCellHorizontalAlignment(button, VerticalPanel.ALIGN_CENTER);
button.setStyleName("okm-YesButton");
super.hide();
setWidget(vPanel);
}
示例4: create
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Creates dialog box.
*
* @param popup - UniversalPopup on which the dialog is based
* @param title - title placed in the title bar
* @param innerWidget - the inner widget of the dialog
* @param dialogButtons - buttons
*/
public static void create(UniversalPopup popup, String title, Widget innerWidget,
DialogButton[] dialogButtons) {
// Title
popup.getTitleBar().setTitleText(title);
VerticalPanel contents = new VerticalPanel();
popup.add(contents);
// Message
contents.add(innerWidget);
// Buttons
HorizontalPanel buttonPanel = new HorizontalPanel();
for (DialogButton dialogButton : dialogButtons) {
Button button = new Button(dialogButton.getTitle());
button.setStyleName(Dialog.getCss().dialogButton());
buttonPanel.add(button);
dialogButton.link(button);
}
contents.add(buttonPanel);
buttonPanel.setStyleName(Dialog.getCss().dialogButtonPanel());
contents.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);
}
示例5: initializeBox
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private void initializeBox() {
changeList = new Button("Change to list view");
changeList.setStyleName("button");
changeList.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
if (enabledTree) {
enabledTree = false;
changeList.setText("Change to tree view");
reloadListData();
}
else {
enabledTree = true;
changeList.setText("Change to list view");
reloadTreeData();
}
}
});
mainPanel.add(changeList);
filterPanel = searchFields();
mainPanel.add(filterPanel);
mainPanel.add(list);
list.setWidth("100%");
reloadTreeData();
}
示例6: createVideoDialog
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Creates video on page!
*/
private static void createVideoDialog(String tutorialId) {
// Create the UI elements of the DialogBox
final DialogBox dialogBox = new DialogBox(true, true); // DialogBox(autohide, modal)
dialogBox.setStylePrimaryName("ode-DialogBox");
dialogBox.setText("Tutorial Video");
dialogBox.setGlassEnabled(true);
dialogBox.setAnimationEnabled(true);
VerticalPanel DialogBoxContents = new VerticalPanel();
// Adds Youtube Video
HTML message = new HTML("<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/" + tutorialId + "?rel=0&autoplay=1\" frameborder=\"0\" allowfullscreen></iframe>");
message.setStyleName("DialogBox-message");
FlowPanel holder = new FlowPanel();
Button ok = new Button("Close");
ok.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
dialogBox.hide();
}
});
ok.setStyleName("DialogBox-button");
holder.add(ok);
DialogBoxContents.add(message);
DialogBoxContents.add(holder);
dialogBox.setWidget(DialogBoxContents);
dialogBox.center();
dialogBox.show();
}
示例7: createImageDialog
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Enlarges image on page
*/
private static void createImageDialog(String img) {
// Create the UI elements of the DialogBox
final DialogBox dialogBox = new DialogBox(true, true); // DialogBox(autohide, modal)
dialogBox.setStylePrimaryName("ode-DialogBox");
dialogBox.setGlassEnabled(true);
dialogBox.setAnimationEnabled(true);
VerticalPanel DialogBoxContents = new VerticalPanel();
FlowPanel holder = new FlowPanel();
Button ok = new Button("Close");
ok.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
dialogBox.hide();
}
});
ok.setStyleName("DialogBox-button");
// Adds Image
Image image = new Image(img);
image.addLoadHandler(new LoadHandler() {
public void onLoad(LoadEvent evt) {
dialogBox.center();
}
});
image.setStyleName("DialogBox-image");
holder.add(ok);
DialogBoxContents.add(image);
DialogBoxContents.add(holder);
dialogBox.setWidget(DialogBoxContents);
dialogBox.center();
dialogBox.show();
}
示例8: 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);
}
示例9: applystyles
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private void applystyles(final Button button, final boolean buttonEnable) {
button.setStyleName(VButton.CLASSNAME);
button.addStyleName(getStyle("tiny"));
button.addStyleName(getStyle("borderless-colored"));
button.addStyleName(getStyle("button-no-border"));
button.addStyleName(getStyle("action-type-padding"));
if (buttonEnable) {
return;
}
button.addStyleName("v-disabled");
}
示例10: applyStyles
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private static void applyStyles(final Button button, final boolean buttonDisabled, final String additionalStyle) {
button.setStyleName(VButton.CLASSNAME);
button.addStyleName(getStyle("tiny"));
button.addStyleName(getStyle("borderless"));
button.addStyleName(getStyle("button-no-border"));
button.addStyleName(getStyle("action-type-padding"));
button.addStyleName(getStyle(additionalStyle));
if (buttonDisabled) {
button.addStyleName("v-disabled");
}
}
示例11: ComparisonPanel
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public ComparisonPanel(List<String> comparison) {
this.riskSessions = comparison;
ppg = new VerticalPanel();
ppg.setWidth("100%");
mView = new VerticalPanel();
Label title = new Label("Risk analysis session comparisons");
title.setStyleName("title");
ppg.add(title);
ppg.add(mView);
Button back = new Button("Back");
back.setStyleName("deleteButton");
back.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
back();
}
});
mView.setStyleName("leftPanelLayer");
mView.add(back);
computeResults();
}
示例12: onInitUI
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
@Override
protected void onInitUI() {
super.onInitUI();
Resources.I.style().ensureInjected();
saveProject = new Button(AdminConstants.I.buttonSaveChanges());
saveProject.setStyleName("");
saveProject.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
doSave();
}
});
ExtensionPanel extensionPanelTop =
new ExtensionPanel(GerritUiExtensionPoint.PROJECT_INFO_SCREEN_TOP);
extensionPanelTop.put(GerritUiExtensionPoint.Key.PROJECT_NAME, getProjectKey().get());
add(extensionPanelTop);
add(new ProjectDownloadPanel(getProjectKey().get(), true));
initDescription();
grid = new LabeledWidgetsGrid();
pluginOptionsPanel = new FlowPanel();
actionsGrid = new LabeledWidgetsGrid();
initProjectOptions();
initAgreements();
add(grid);
add(pluginOptionsPanel);
add(saveProject);
add(actionsGrid);
ExtensionPanel extensionPanelBottom =
new ExtensionPanel(GerritUiExtensionPoint.PROJECT_INFO_SCREEN_BOTTOM);
extensionPanelBottom.put(GerritUiExtensionPoint.Key.PROJECT_NAME, getProjectKey().get());
add(extensionPanelBottom);
}
示例13: createChangeAction
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private Button createChangeAction() {
final Button createChange = new Button(AdminConstants.I.buttonCreateChange());
createChange.setStyleName("");
createChange.setTitle(AdminConstants.I.buttonCreateChangeDescription());
createChange.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
CreateChangeAction.call(createChange, getProjectKey().get());
}
});
return createChange;
}
示例14: createEditConfigAction
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private Button createEditConfigAction() {
final Button editConfig = new Button(AdminConstants.I.buttonEditConfig());
editConfig.setStyleName("");
editConfig.setTitle(AdminConstants.I.buttonEditConfigDescription());
editConfig.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
EditConfigAction.call(editConfig, getProjectKey());
}
});
return editConfig;
}
示例15: addCloseToTab
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private void addCloseToTab(final TabPanelEntry tab) {
final Button close = new Button("×");
close.setStyleName("close");
close.addStyleName(WorkbenchResources.INSTANCE.CSS().tabCloseButton());
close.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
final WorkbenchPartPresenter.View partToDeselect = tabInvertedIndex.get(tab);
panelManager.closePlace(partToDeselect.getPresenter().getDefinition().getPlace());
}
});
tab.getTabWidget().addToAnchor(close);
}