本文整理汇总了Java中com.google.gwt.user.client.ui.Button.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setEnabled方法的具体用法?Java Button.setEnabled怎么用?Java Button.setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Button
的用法示例。
在下文中一共展示了Button.setEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
@Override
public void render(RendererCellReference cell, String text, Button button) {
Element e = button.getElement();
if(e.getPropertyString(ROW_KEY_PROPERTY) != getRowKey((JsonObject) cell.getRow())) {
e.setPropertyString(ROW_KEY_PROPERTY,
getRowKey((JsonObject) cell.getRow()));
}
if(e.getPropertyString(COLUMN_ID_PROPERTY) != getColumnId(getGrid()
.getColumn(cell.getColumnIndex()))) {
e.setPropertyString(COLUMN_ID_PROPERTY, getColumnId(getGrid()
.getColumn(cell.getColumnIndex())));
}
if (htmlContentAllowed) {
button.setHTML(text);
} else {
button.setText(text);
}
button.setEnabled(true);
}
示例2: render
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
@Override
public void render(RendererCellReference cell, Boolean enable, Button button) {
Element e = button.getElement();
if(e.getPropertyString(ROW_KEY_PROPERTY) != getRowKey((JsonObject) cell.getRow())) {
e.setPropertyString(ROW_KEY_PROPERTY,
getRowKey((JsonObject) cell.getRow()));
}
if(e.getPropertyString(COLUMN_ID_PROPERTY) != getColumnId(getGrid()
.getColumn(cell.getColumnIndex()))) {
e.setPropertyString(COLUMN_ID_PROPERTY, getColumnId(getGrid()
.getColumn(cell.getColumnIndex())));
}
String style = button.getStyleName();
if (style != null && style.contains("delete-confirm")) {
button.removeStyleName("delete-confirm");
}
if (htmlContentAllowed) {
button.setHTML(getState().delete);
} else {
button.setText(getState().delete);
}
button.setEnabled(enable);
}
示例3: call
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
static void call(Button b, Project.NameKey project) {
b.setEnabled(false);
ChangeApi.createChange(
project.get(),
RefNames.REFS_CONFIG,
null,
AdminConstants.I.editConfigMessage(),
null,
new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(ChangeInfo result) {
Gerrit.display(
Dispatcher.toEditScreen(
project, new PatchSet.Id(result.legacyId(), 1), "project.config"));
}
@Override
public void onFailure(Throwable caught) {
b.setEnabled(true);
super.onFailure(caught);
}
});
}
示例4: ConsoleDialog
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public ConsoleDialog(ConsoleDialogListener listener) {
super(false, true);
this.listener = listener;
VerticalPanel dialogContents = new VerticalPanel();
dialogContents.setSpacing(4);
setWidget(dialogContents);
console = new TextArea();
console.setReadOnly(true);
int width= Window.getClientWidth();
int height= Window.getClientHeight();
console.setSize(width*2/3 + "px", height*2/3 + "px");
console.addStyleName(Utils.sandboxStyle.consoleArea());
okButton = new Button("Ok");
addButton(okButton);
dialogContents.add(console);
okButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
if (ConsoleDialog.this.listener != null) {
ConsoleDialog.this.listener.onOk(rpcCallSucceded && consoleSessionSucceded);
}
}
});
okButton.setEnabled(false);
}
示例5: render
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
@Override
public void render(final RendererCellReference cell, final String text, final Button button) {
final boolean buttonEnable = isButtonEnable(cell.getElement().getClassName());
if (text != null) {
button.setHTML(text);
}
applystyles(button, buttonEnable);
// this is to allow the button to disappear, if the text is null
button.setVisible(text != null);
button.getElement().setId(UIComponentIdProvider.ROLLOUT_ACTION_ID + "." + cell.getColumnIndex());
button.setEnabled(buttonEnable);
}
示例6: render
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
@Override
public void render(final RendererCellReference cell, final FontIconData iconMetadata, final Button button) {
if (iconMetadata.getFontIconHtml() != null) {
button.setHTML(iconMetadata.getFontIconHtml());
}
applyStyles(button, iconMetadata.isDisabled(), iconMetadata.getStyle());
button.getElement().setId(iconMetadata.getId());
button.getElement().setTitle(iconMetadata.getTitle());
button.setEnabled(!iconMetadata.isDisabled());
// this is to allow the button to disappear, if the text is null
button.setVisible(iconMetadata.getFontIconHtml() != null);
}
示例7: initName
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private void initName() {
final VerticalPanel groupNamePanel = new VerticalPanel();
groupNamePanel.setStyleName(Gerrit.RESOURCES.css().groupNamePanel());
groupNameTxt = new NpTextBox();
groupNameTxt.setStyleName(Gerrit.RESOURCES.css().groupNameTextBox());
groupNameTxt.setVisibleLength(60);
groupNamePanel.add(groupNameTxt);
saveName = new Button(AdminConstants.I.buttonRenameGroup());
saveName.setEnabled(false);
saveName.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
final String newName = groupNameTxt.getText().trim();
GroupApi.renameGroup(
getGroupUUID(),
newName,
new GerritCallback<com.google.gerrit.client.VoidResult>() {
@Override
public void onSuccess(com.google.gerrit.client.VoidResult result) {
saveName.setEnabled(false);
setPageTitle(AdminMessages.I.group(newName));
groupNameTxt.setText(newName);
if (getGroupUUID().equals(getOwnerGroupUUID())) {
ownerTxt.setText(newName);
}
}
});
}
});
groupNamePanel.add(saveName);
add(groupNamePanel);
}
示例8: initOwner
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private void initOwner() {
final VerticalPanel ownerPanel = new VerticalPanel();
ownerPanel.setStyleName(Gerrit.RESOURCES.css().groupOwnerPanel());
ownerPanel.add(new SmallHeading(AdminConstants.I.headingOwner()));
final AccountGroupSuggestOracle accountGroupOracle = new AccountGroupSuggestOracle();
ownerTxt = new RemoteSuggestBox(accountGroupOracle);
ownerTxt.setStyleName(Gerrit.RESOURCES.css().groupOwnerTextBox());
ownerTxt.setVisibleLength(60);
ownerPanel.add(ownerTxt);
saveOwner = new Button(AdminConstants.I.buttonChangeGroupOwner());
saveOwner.setEnabled(false);
saveOwner.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
final String newOwner = ownerTxt.getText().trim();
if (newOwner.length() > 0) {
AccountGroup.UUID ownerUuid = accountGroupOracle.getUUID(newOwner);
String ownerId = ownerUuid != null ? ownerUuid.get() : newOwner;
GroupApi.setGroupOwner(
getGroupUUID(),
ownerId,
new GerritCallback<GroupInfo>() {
@Override
public void onSuccess(GroupInfo result) {
updateOwnerGroup(result);
saveOwner.setEnabled(false);
}
});
}
}
});
ownerPanel.add(saveOwner);
add(ownerPanel);
}
示例9: initDescription
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private void initDescription() {
final VerticalPanel vp = new VerticalPanel();
vp.setStyleName(Gerrit.RESOURCES.css().groupDescriptionPanel());
vp.add(new SmallHeading(AdminConstants.I.headingDescription()));
descTxt = new NpTextArea();
descTxt.setVisibleLines(6);
descTxt.setCharacterWidth(60);
vp.add(descTxt);
saveDesc = new Button(AdminConstants.I.buttonSaveDescription());
saveDesc.setEnabled(false);
saveDesc.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
final String txt = descTxt.getText().trim();
GroupApi.setGroupDescription(
getGroupUUID(),
txt,
new GerritCallback<VoidResult>() {
@Override
public void onSuccess(VoidResult result) {
saveDesc.setEnabled(false);
}
});
}
});
vp.add(saveDesc);
add(vp);
}
示例10: initGroupOptions
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private void initGroupOptions() {
final VerticalPanel groupOptionsPanel = new VerticalPanel();
final VerticalPanel vp = new VerticalPanel();
vp.setStyleName(Gerrit.RESOURCES.css().groupOptionsPanel());
vp.add(new SmallHeading(AdminConstants.I.headingGroupOptions()));
visibleToAllCheckBox = new CheckBox(AdminConstants.I.isVisibleToAll());
vp.add(visibleToAllCheckBox);
groupOptionsPanel.add(vp);
saveGroupOptions = new Button(AdminConstants.I.buttonSaveGroupOptions());
saveGroupOptions.setEnabled(false);
saveGroupOptions.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
GroupApi.setGroupOptions(
getGroupUUID(),
visibleToAllCheckBox.getValue(),
new GerritCallback<VoidResult>() {
@Override
public void onSuccess(VoidResult result) {
saveGroupOptions.setEnabled(false);
}
});
}
});
groupOptionsPanel.add(saveGroupOptions);
add(groupOptionsPanel);
final OnEditEnabler enabler = new OnEditEnabler(saveGroupOptions);
enabler.listenTo(visibleToAllCheckBox);
}
示例11: call
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
static void call(Button b, String project) {
// TODO Replace CreateChangeDialog with a nicer looking display.
b.setEnabled(false);
new CreateChangeDialog(new Project.NameKey(project)) {
{
sendButton.setText(AdminConstants.I.buttonCreate());
message.setText(AdminConstants.I.buttonCreateDescription());
}
@Override
public void onSend() {
ChangeApi.createChange(
project,
getDestinationBranch(),
getDestinationTopic(),
message.getText(),
null,
new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(ChangeInfo result) {
sent = true;
hide();
Gerrit.display(PageLinks.toChange(result.projectNameKey(), result.legacyId()));
}
@Override
public void onFailure(Throwable caught) {
enableButtons(true);
super.onFailure(caught);
}
});
}
@Override
public void onClose(CloseEvent<PopupPanel> event) {
super.onClose(event);
b.setEnabled(true);
}
}.center();
}
示例12: StringListPanel
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public StringListPanel(String title, List<String> fieldNames, FocusWidget w, boolean autoSort) {
widget = w;
if (title != null) {
titlePanel = new HorizontalPanel();
SmallHeading titleLabel = new SmallHeading(title);
titlePanel.add(titleLabel);
add(titlePanel);
}
t = new StringListTable(fieldNames, autoSort);
add(t);
buttonPanel = new HorizontalPanel();
buttonPanel.setStyleName(Gerrit.RESOURCES.css().stringListPanelButtons());
deleteButton = new Button(Gerrit.C.stringListPanelDelete());
deleteButton.setEnabled(false);
deleteButton.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
widget.setEnabled(true);
t.deleteChecked();
}
});
buttonPanel.add(deleteButton);
add(buttonPanel);
}
示例13: setEnabled
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private static void setEnabled(boolean enabled, Button... draftButtons) {
if (draftButtons != null) {
for (Button b : draftButtons) {
b.setEnabled(enabled);
}
}
}
示例14: call
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
static void call(
final Button b,
final Project.NameKey project,
final String branch,
final Change.Id id,
final String revision,
final boolean enabled) {
b.setEnabled(false);
new RebaseDialog(project, branch, id, enabled) {
@Override
public void onSend() {
ChangeApi.rebase(
project.get(),
id.get(),
revision,
getBase(),
new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(ChangeInfo result) {
sent = true;
hide();
Gerrit.display(PageLinks.toChange(project, id));
}
@Override
public void onFailure(Throwable caught) {
enableButtons(true);
super.onFailure(caught);
}
});
}
@Override
public void onClose(CloseEvent<PopupPanel> event) {
super.onClose(event);
b.setEnabled(true);
}
}.center();
}
示例15: call
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
static void call(Button b, ChangeInfo info, Project.NameKey project) {
b.setEnabled(false);
new MoveDialog(project) {
{
sendButton.setText(Util.C.moveChangeSend());
}
@Override
public void onSend() {
ChangeApi.move(
info.project(),
info.legacyId().get(),
getDestinationBranch(),
getMessageText(),
new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(ChangeInfo result) {
sent = true;
hide();
Gerrit.display(PageLinks.toChange(project, result.legacyId()));
}
@Override
public void onFailure(Throwable caught) {
enableButtons(true);
super.onFailure(caught);
}
});
}
@Override
public void onClose(CloseEvent<PopupPanel> event) {
super.onClose(event);
b.setEnabled(true);
}
}.center();
}