本文整理匯總了Java中com.google.gwt.user.client.ui.FlowPanel.add方法的典型用法代碼示例。如果您正苦於以下問題:Java FlowPanel.add方法的具體用法?Java FlowPanel.add怎麽用?Java FlowPanel.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.FlowPanel
的用法示例。
在下文中一共展示了FlowPanel.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: appendList
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
public final void appendList(ArrayList<String> choices, boolean ordered, String additionalStyle) {
if (choices == null || choices.size() == 0) {
return;
}
FlowPanel htmlList = new FlowPanel(ordered? OListElement.TAG : UListElement.TAG);
if (additionalStyle != null && additionalStyle.length() > 0) {
_promptChar.getElement().setAttribute("style", additionalStyle);
}
for (String choice : choices) {
FlowPanel item = new FlowPanel(LIElement.TAG);
item.getElement().setInnerText(choice);
htmlList.add(item);
}
appendAndScrollOrFocusAsAppropriate(htmlList);
}
示例2: addGallerySearchTab
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
/**
* Creates the GUI components for search tab.
*
* @param searchApp: the FlowPanel that search tab will reside.
*/
private void addGallerySearchTab(FlowPanel searchApp) {
// Add search GUI
FlowPanel searchPanel = new FlowPanel();
final TextBox searchText = new TextBox();
searchText.addStyleName("gallery-search-textarea");
Button sb = new Button(MESSAGES.gallerySearchForAppsButton());
searchPanel.add(searchText);
searchPanel.add(sb);
searchPanel.addStyleName("gallery-search-panel");
searchApp.add(searchPanel);
appSearchContent.addStyleName("gallery-search-results");
searchApp.add(appSearchContent);
searchApp.addStyleName("gallery-search");
sb.addClickHandler(new ClickHandler() {
// @Override
public void onClick(ClickEvent event) {
gallery.FindApps(searchText.getText(), 0, NUMAPPSTOSHOW, 0, true);
}
});
}
示例3: GalleryAppBox
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
/**
* Creates new Gallery app box.
*/
private GalleryAppBox() {
gContainer = new FlowPanel();
final HorizontalPanel container = new HorizontalPanel();
container.setWidth("100%");
container.setSpacing(0);
container.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
HorizontalPanel panel = new HorizontalPanel();
Image image = new Image();
image.setResource(Ode.getImageBundle().waitingIcon());
panel.add(image);
Label label = new Label();
label.setText(Ode.getMessages().defaultRpcMessage());
panel.add(label);
gContainer.add(panel);
this.add(gContainer);
}
示例4: ItemViewCarrier
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
public ItemViewCarrier(String err) {
errorView = new FlowPanel();
errorView.setStyleName("qp-item-error");
Label errorLabel = new Label(err);
errorLabel.setStyleName("qp-item-error-text");
errorView.add(errorLabel);
}
示例5: getMediaObject
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
protected Widget getMediaObject() {
Widget mediaObjectWidget;
if (isFullScreen) {
mediaObjectWidget = fullScreenMediaWrapper.getMediaObject();
} else {
FlowPanel videoContainer = new FlowPanel();
videoContainer.add(mediaWrapper.getMediaObject());
videoContainer.getElement().getStyle().setPosition(Position.RELATIVE);
mediaObjectWidget = videoContainer;
}
return mediaObjectWidget;
}
示例6: FlashLocalMediaImpl
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
public FlashLocalMediaImpl(String name) {
elementId = Document.get().createUniqueId();
panelMain = new FlowPanel();
panelMain.setStyleName("qp-" + name + "-flash-local");
panelContent = new FlowPanel();
panelContent.getElement().setId(elementId);
panelMain.add(panelContent);
initWidget(panelMain);
}
示例7: createWelcomeDialog
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
/**
* Possibly display the MIT App Inventor "Splash Screen"
*
* @param force Bypass the check to see if they have dimissed this version
*/
private void createWelcomeDialog(boolean force) {
if (!shouldShowWelcomeDialog() && !force) {
maybeShowNoProjectsDialog();
return;
}
// Create the UI elements of the DialogBox
final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
dialogBox.setStylePrimaryName("ode-DialogBox");
dialogBox.setText(MESSAGES.createWelcomeDialogText());
dialogBox.setHeight(splashConfig.height + "px");
dialogBox.setWidth(splashConfig.width + "px");
dialogBox.setGlassEnabled(true);
dialogBox.setAnimationEnabled(true);
dialogBox.center();
VerticalPanel DialogBoxContents = new VerticalPanel();
HTML message = new HTML(splashConfig.content);
message.setStyleName("DialogBox-message");
FlowPanel holder = new FlowPanel();
Button ok = new Button(MESSAGES.createWelcomeDialogButton());
final CheckBox noshow = new CheckBox(MESSAGES.doNotShow());
ok.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
dialogBox.hide();
if (noshow.getValue()) { // User checked the box
userSettings.getSettings(SettingsConstants.SPLASH_SETTINGS).
changePropertyValue(SettingsConstants.SPLASH_SETTINGS_VERSION,
"" + splashConfig.version);
userSettings.saveSettings(null);
}
maybeShowNoProjectsDialog();
}
});
holder.add(ok);
holder.add(noshow);
DialogBoxContents.add(message);
DialogBoxContents.add(holder);
dialogBox.setWidget(DialogBoxContents);
dialogBox.show();
}
示例8: toGwtWidget
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
void toGwtWidget(
final PromptlyPanel promptlyPanel,
FlowPanel outerWidget,
boolean withFormatting,
String outerClassOverride
) {
if (outerClassOverride != null) {
outerWidget.getElement().setAttribute("class", outerClassOverride);
}
for (StyledParagraphItem paragraphItem : _items) {
final String text = paragraphItem.getText();
final String style = paragraphItem.getStyle();
FlowPanel spanElement = new FlowPanel(SpanElement.TAG /* <span> tag */ );
spanElement.getElement().setInnerText(text);
if (withFormatting && style != null) {
spanElement.getElement().setAttribute("style", style);
}
final ItemListener callback = paragraphItem.getCallback();
if (callback != null) {
Hyperlink hl = new Hyperlink(promptlyPanel, promptlyPanel.getNextHyperlinkIdAndIncrement(), callback, text);
spanElement.addDomHandler(hl , ClickEvent.getType());
spanElement.getElement().setAttribute("onMouseOver", "this.style.fontWeight='normal'");
spanElement.getElement().setAttribute("onMouseOut", "this.style.fontWeight='normal'");
}
outerWidget.add(spanElement);
}
}
示例9: wontConnectDialog
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
/**
* Display a Dialog box that explains that you cannot connect a
* device or the emulator to App Inventor until you have a project
* selected.
*/
private void wontConnectDialog() {
// Create the UI elements of the DialogBox
final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
dialogBox.setStylePrimaryName("ode-DialogBox");
dialogBox.setText(MESSAGES.noprojectDialogTitle());
dialogBox.setHeight("100px");
dialogBox.setWidth("400px");
dialogBox.setGlassEnabled(true);
dialogBox.setAnimationEnabled(true);
dialogBox.center();
VerticalPanel DialogBoxContents = new VerticalPanel();
HTML message = new HTML("<p>" + MESSAGES.noprojectDuringConnect() + "</p>");
message.setStyleName("DialogBox-message");
FlowPanel holder = new FlowPanel();
Button okButton = new Button("OK");
okButton.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
dialogBox.hide();
}
});
holder.add(okButton);
DialogBoxContents.add(message);
DialogBoxContents.add(holder);
dialogBox.setWidget(DialogBoxContents);
dialogBox.show();
}
示例10: createEmailCollapse
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
/**
* Help method for Email Collapse Function
* When the button(see more) is clicked, it will retrieve the whole email from database.
* @param parent the parent container
* @param emailId email id
* @param preview email preview
*/
void createEmailCollapse(final FlowPanel parent, final long emailId, final String preview){
final Label emailContent = new Label();
emailContent.setText(preview);
emailContent.addStyleName("inline-label");
parent.add(emailContent);
final Label actionButton = new Label();
actionButton.setText(MESSAGES.seeMoreLink());
actionButton.addStyleName("seemore-link");
parent.add(actionButton);
if(preview.length() <= MAX_EMAIL_PREVIEW_LENGTH){
actionButton.setVisible(false);
}
actionButton.addClickHandler(new ClickHandler() {
boolean ifPreview = true;
@Override
public void onClick(ClickEvent event) {
if(ifPreview == true){
OdeAsyncCallback<Email> callback = new OdeAsyncCallback<Email>(
// failure message
MESSAGES.serverUnavailable()) {
@Override
public void onSuccess(final Email email) {
emailContent.setText(email.getBody());
emailContent.addStyleName("inline");
actionButton.setText(MESSAGES.hideLink());
ifPreview = false;
}
};
Ode.getInstance().getGalleryService().getEmail(emailId, callback);
}else{
emailContent.setText(preview);
actionButton.setText(MESSAGES.seeMoreLink());
ifPreview = true;
}
}
});
}
示例11: loadModerationPage
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
/**
* load the moderation page, and setect tab index 0
* For now, only one tab exists
*/
public static void loadModerationPage() {
INSTANCE.reports = new ReportList();
FlowPanel reportsContainer = new FlowPanel();
reportsContainer.add(INSTANCE.reports);
INSTANCE.add(reportsContainer, MESSAGES.moderationPageBoxCaption());
INSTANCE.selectTab(0);
// Styling options
INSTANCE.addStyleName("gallery");
}
示例12: loadGalleryList
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
/**
* Load GalleryList
*/
public static void loadGalleryList(){
INSTANCE.plist = new GalleryList();
FlowPanel pContainer = new FlowPanel();
pContainer.add(INSTANCE.plist);
INSTANCE.add(pContainer);
}
示例13: appendTiledLineImage
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
public final void appendTiledLineImage(String srcImageText, String additionalCssStyle) {
FlowPanel outer = new FlowPanel(DivElement.TAG);
outer.getElement().setAttribute("style", additionalCssStyle + "line-height:100%;font-size:1px;width:100%;align:'center';background-image:url('"+srcImageText+"');"); //margin-bottom:6px;
FlowPanel inner = new FlowPanel(ImageElement.TAG);
inner.getElement().setAttribute("src", srcImageText);
inner.getElement().setAttribute("style", "visibility: hidden;");
outer.add(inner);
appendAndScrollOrFocusAsAppropriate(outer);
}
示例14: createImageDialog
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的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();
}
示例15: createMainPanel
import com.google.gwt.user.client.ui.FlowPanel; //導入方法依賴的package包/類
private void createMainPanel() {
mainPanel = new FlowPanel();
mainPanel.setStyleName(styleNames.QP_INFO());
mainPanel.add(contentPanel);
}