本文整理汇总了Java中com.google.gwt.user.client.ui.Button.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setVisible方法的具体用法?Java Button.setVisible怎么用?Java Button.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Button
的用法示例。
在下文中一共展示了Button.setVisible方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUI
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* The UI consists of a vertical panel that holds a drop-down list box,
* a Horizontal panel that holds the templates list (cell list) plus
* the selected template. This is inserted in the Wizard dialog.
*
* @param templates should never be null
* @return the main panel for Wizard dialog.
*/
VerticalPanel createUI(final ArrayList<TemplateInfo> templates) {
VerticalPanel panel = new VerticalPanel();
panel.setStylePrimaryName("gwt-SimplePanel");
panel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
panel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
templatePanel = new HorizontalPanel();
templatePanel.add(makeTemplateSelector(templates));
if (templates.size() > 0)
templatePanel.add(new TemplateWidget(templates.get(0), templateHostUrl));
templatesMenu = makeTemplatesMenu();
HorizontalPanel hPanel = new HorizontalPanel();
hPanel.add(templatesMenu);
removeButton = new Button("Remove this repository", new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
removeCurrentlySelectedRepository();
}
});
removeButton.setVisible(false);
hPanel.add(removeButton);
panel.add(hPanel);
panel.add(templatePanel);
return panel;
}
示例2: setButtonsForUrls
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public void setButtonsForUrls() {
urlButtonPanel.clear();
urlAndShortcutMap = presenter.batchDTO.getUrlAndShortcutMap();
urlAndTitleMap = presenter.batchDTO.getUrlAndTitleMap();
if (null != urlAndShortcutMap && !urlAndShortcutMap.isEmpty()) {
Set<String> urlList = urlAndShortcutMap.keySet();
for (final String url : urlList) {
if (urlAndShortcutMap.get(url) != null && !urlAndShortcutMap.get(url).isEmpty()) {
String buttonName = LocaleDictionary.get().getConstantValue(urlAndApplicationMap.get(url));
Button button = new Button(buttonName, new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
presenter.showExternalAppForHtmlPattern(urlAndShortcutMap.get(url), urlAndTitleMap.get(url));
}
});
button.setWidth("55px");
button.setVisible(true);
String title = url.substring(url.indexOf('('), url.length());
button.setTitle(title);
urlButtonPanel.setSpacing(5);
urlButtonPanel.add(button);
}
}
}
}
示例3: 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);
}
示例4: 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);
}
示例5: a2b
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
private static void a2b(NativeMap<ActionInfo> actions, String a, Button b) {
if (actions.containsKey(a)) {
b.setVisible(true);
ActionInfo actionInfo = actions.get(a);
b.setTitle(actionInfo.title());
b.setEnabled(actionInfo.enabled());
}
}
示例6: setEnabled
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
public void setEnabled(int button, boolean enabled) {
Button b = (Button)iButtons.getWidget(button);
b.setVisible(enabled); b.setEnabled(enabled);
for (UniTimeHeaderPanel clone: iClones)
clone.setEnabled(button, enabled);
}
示例7: initReportSection
import com.google.gwt.user.client.ui.Button; //导入方法依赖的package包/类
/**
* Helper method called by constructor to initialize the report section
*/
private void initReportSection() {
final HTML reportPrompt = new HTML();
reportPrompt.setHTML(MESSAGES.galleryReportPrompt());
reportPrompt.addStyleName("primary-prompt");
final TextArea reportText = new TextArea();
reportText.addStyleName("action-textarea");
final Button submitReport = new Button(MESSAGES.galleryReportButton());
submitReport.addStyleName("action-button");
final Label descriptionError = new Label();
descriptionError.setText("Description required");
descriptionError.setStyleName("ode-ErrorMessage");
descriptionError.setVisible(false);
appReportPanel.add(reportPrompt);
appReportPanel.add(descriptionError);
appReportPanel.add(reportText);
appReportPanel.add(submitReport);
final OdeAsyncCallback<Boolean> isReportdByUserCallback = new OdeAsyncCallback<Boolean>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(Boolean isAlreadyReported) {
if(isAlreadyReported) { //already reported, cannot report again
reportPrompt.setHTML(MESSAGES.galleryAlreadyReportedPrompt());
reportText.setVisible(false);
submitReport.setVisible(false);
submitReport.setEnabled(false);
} else {
submitReport.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
final OdeAsyncCallback<Long> reportClickCallback = new OdeAsyncCallback<Long>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(Long id) {
reportPrompt.setHTML(MESSAGES.galleryReportCompletionPrompt());
reportText.setVisible(false);
submitReport.setVisible(false);
submitReport.setEnabled(false);
}
};
if (!reportText.getText().trim().isEmpty()){
Ode.getInstance().getGalleryService().addAppReport(app, reportText.getText(),
reportClickCallback);
descriptionError.setVisible(false);
} else {
descriptionError.setVisible(true);
}
}
});
}
}
};
Ode.getInstance().getGalleryService().isReportedByUser(app.getGalleryAppId(),
isReportdByUserCallback);
}