本文整理匯總了Java中com.google.gwt.user.client.ui.HorizontalPanel.setStyleName方法的典型用法代碼示例。如果您正苦於以下問題:Java HorizontalPanel.setStyleName方法的具體用法?Java HorizontalPanel.setStyleName怎麽用?Java HorizontalPanel.setStyleName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.HorizontalPanel
的用法示例。
在下文中一共展示了HorizontalPanel.setStyleName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: IconCell
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public IconCell(ImageResource resource, final String title, String text) {
super(null);
iIcon = new Image(resource);
iIcon.setTitle(title);
iIcon.setAltText(title);
if (text != null && !text.isEmpty()) {
iLabel = new HTML(text, false);
iPanel = new HorizontalPanel();
iPanel.setStyleName("icon");
iPanel.add(iIcon);
iPanel.add(iLabel);
iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
}
iIcon.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
event.stopPropagation();
UniTimeConfirmationDialog.info(title);
}
});
}
示例2: initializew3wPanel
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
private void initializew3wPanel() {
w3wPanel = new HorizontalPanel();
w3wPanel.setSpacing(5);
w3wPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
StyleInjector.inject(".w3wPanel { " + "background: #E0ECF8;"
+ "border-radius: 5px 10px;" + "opacity: 0.8}");
w3wPanel.setStyleName("w3wPanel");
w3wPanel.setWidth("415px");
wordsLabel = new Label();
w3wAnchor = new AnchorBuilder().setHref("https://what3words.com/")
.setText(UIMessages.INSTANCE.what3Words())
.setTitle("https://what3words.com/").build();
w3wAnchor.getElement().getStyle().setColor("#FF0000");
w3wAnchor.setVisible(false);
w3wPanel.add(w3wAnchor);
w3wPanel.add(wordsLabel);
}
示例3: create
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的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);
}
示例4: addViewUserProfileLink
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
/**
* Allows to add a small panel containing the "View Full Profile" link,
* this is made for those who are not smart enough to click on the login
* name in this dialog again, to get to a full profile view
*/
private void addViewUserProfileLink() {
//Initialize the link
Label userProfileLink = new Label(I18NManager.getTitles().viewFullUserProfileLinkTitle());
userProfileLink.setWordWrap(false);
userProfileLink.setStyleName( CommonResourcesContainer.DIALOG_LINK_RED_STYLE );
userProfileLink.addClickHandler( this.userProfileShowHandler );
//Initialize the panel
HorizontalPanel userProfileLinkPanel = new HorizontalPanel();
userProfileLinkPanel.setStyleName( CommonResourcesContainer.VIEW_USER_PROFILE_LINK_PANEL_STYLE );
userProfileLinkPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
userProfileLinkPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
userProfileLinkPanel.add( userProfileLink );
//Add the profile view link panel to the main panel
mainInfoVPanel.add( userProfileLinkPanel );
}
示例5: FooterScreen
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public FooterScreen() {
HorizontalPanel panel = new HorizontalPanel();
HTML label = new HTML("OneCMDB 1.4.0 Beta © Lokomo Systems <<a href='javascript:;'>about</a>>");
label.setTitle("Show about screen");
label.setStyleName("onecmdb-footer-label");
panel.add(label);
panel.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_RIGHT);
panel.setStyleName("onecmdb-footer");
label.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
getBaseEntryScreen().showScreen(OneCMDBApplication.SHOW_STATIC_CONTENT,
"about.html",
new Long(0));
}
});
initWidget(panel);
}
示例6: loadLayoutStructure
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
private void loadLayoutStructure() {
page = new VerticalPanel();
mainView = new HorizontalPanel();
leftPanel = new VerticalPanel();
mainView.setStyleName("mainViewLayer");
mainView.setWidth("100%");
leftPanel.setStyleName("leftPanelLayer");
leftPanel.setWidth("700px");
page.setWidth("100%");
Label title = new Label("Import configuration");
title.setStyleName("title");
//Main layout
page.add(title);
page.add(mainView);
//Left layout
mainView.add(leftPanel);
grid = new Grid(1,2);
grid.setCellPadding(5);
leftPanel.add(grid);
}
示例7: appendChilds
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
private void appendChilds(TreeWidget rootEnt, JSONArray children) {
for (int i = 0; i < children.size(); ++i) {
nextEntityName = children.get(i).isString().stringValue();
Anchor a = new Anchor(nextEntityName + " (" + entities.get(nextEntityName).getLeft() + ")");
a.setWidth("100%");
a.setStyleName("font");
a.addClickHandler(new ClickHandler() {
String name = nextEntityName;
@Override
public void onClick(ClickEvent event) {
module.setSelectedEntity(name);
}
});
HorizontalPanel cPanel = new HorizontalPanel();
cPanel.setStyleName("tree");
cPanel.setWidth("100%");
cPanel.add(a);
TreeWidget c = new TreeWidget(cPanel);
rootEnt.addChild(c);
if (children.size() > 0) appendChilds(c, entities.get(nextEntityName).getRight());
}
}
示例8: generateLegend
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
protected void generateLegend(int i, String ras) {
String c = "col" + i;
HTMLPanel html = new HTMLPanel("<span id='" + c + "'></span>");
SimplePanel p = new SimplePanel();
p.setSize("20px", "20px");
p.getElement().getStyle().setBackgroundColor(colorsArray[i]);
p.setStyleName("colorBox");
HorizontalPanel hp = new HorizontalPanel();
hp.setStyleName("margin-bottom");
hp.add(p);
String htmlString = "<b>" + ras + "</b>";
HTMLPanel htm = new HTMLPanel( htmlString );
hp.add(htm);
html.add(hp, c);
legend.add(html);
}
示例9: generateTree
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
private void generateTree(TreeWidget c, JSONValue entity) {
nextEntityName = entity.isObject().get("entity").isString().stringValue();
Anchor a = new Anchor(nextEntityName);
a.setWidth("100%");
a.setStyleName("font");
a.addClickHandler(new ClickHandler() {
String name = nextEntityName;
@Override
public void onClick(ClickEvent event) {
setSelectedEntity(name);
}
});
HorizontalPanel cPanel = new HorizontalPanel();
cPanel.setStyleName("tree");
cPanel.setWidth("100%");
cPanel.add(a);
TreeWidget cc = new TreeWidget(cPanel);
c.addChild(cc);
results.put(nextEntityName, entity.isObject().get("results").isArray());
entities.add(nextEntityName);
for (int i = 0; i < entity.isObject().get("children").isArray().size(); ++i) {
generateTree(cc, entity.isObject().get("children").isArray().get(i));
}
}
示例10: appendChilds
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
private void appendChilds(TreeWidget rootEnt, JSONArray children) {
for (int i = 0; i < children.size(); ++i) {
nextEntityName = children.get(i).isString().stringValue();
Anchor a = new Anchor(nextEntityName + " (" + entities.get(nextEntityName).getLeft() + ")");
a.setWidth("100%");
a.setStyleName("font");
a.addClickHandler(new ClickHandler() {
String name = nextEntityName;
@Override
public void onClick(ClickEvent event) {
setSelectedEntity(name);
}
});
HorizontalPanel cPanel = new HorizontalPanel();
cPanel.setStyleName("tree");
cPanel.setWidth("100%");
cPanel.add(a);
TreeWidget c = new TreeWidget(cPanel);
rootEnt.addChild(c);
if (children.size() > 0) appendChilds(c, entities.get(nextEntityName).getRight());
}
}
示例11: onInitUI
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
@Override
protected void onInitUI() {
super.onInitUI();
setPageTitle(AdminConstants.I.groupListTitle());
initPageHeader();
prev = PagingHyperlink.createPrev();
prev.setVisible(false);
next = PagingHyperlink.createNext();
next.setVisible(false);
groups = new GroupTable(PageLinks.ADMIN_GROUPS);
add(groups);
final HorizontalPanel buttons = new HorizontalPanel();
buttons.setStyleName(Gerrit.RESOURCES.css().changeTablePrevNextLinks());
buttons.add(prev);
buttons.add(next);
add(buttons);
}
示例12: createWidget
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
@Override
protected Widget createWidget() {
HorizontalPanel mainPanel = new HorizontalPanel();
save.setValue( true );
mainPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
mainPanel.add( new Label( "Products :" ) );
mainPanel.add( products );
mainPanel.add( showProduct );
mainPanel.add( new Label( "Deals :" ) );
mainPanel.add( deals );
mainPanel.add( showDeal );
mainPanel.add( save );
mainPanel.setStyleName( "bar" );
return mainPanel;
}
示例13: onModuleLoad
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public void onModuleLoad() {
all.setStyleName("all");
RootPanel.get().add(all);
HorizontalPanel footer = new HorizontalPanel();
footer.setStyleName("footer2");
RootPanel.get().add(footer);
loadShowCompany();
}
示例14: JobDescPopupPanel
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的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);
}
示例15: InstructorCell
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public InstructorCell(ArrayList<String> names, ArrayList<String> emails, String separator) {
super(null, separator);
if (names != null && !names.isEmpty()) {
separator = separator.replace(" ", " ");
for (int i = 0; i < names.size(); i++) {
String text = names.get(i) + (i + 1 < names.size() ? separator : "");
String email = (emails != null && i < emails.size() ? emails.get(i) : null);
if (email != null && !email.isEmpty()) {
iText += text;
HorizontalPanel p = new HorizontalPanel();
p.setStyleName("instructor");
Anchor a = new Anchor();
a.setHref("mailto:" + email);
a.setHTML(new Image(RESOURCES.email()).getElement().getString());
a.setTitle(MESSAGES.sendEmail(names.get(i)));
a.setStyleName("unitime-SimpleLink");
a.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
event.stopPropagation();
}
});
p.add(a);
p.setCellVerticalAlignment(a, HasVerticalAlignment.ALIGN_MIDDLE);
HTML h = new HTML(text, false);
h.getElement().getStyle().setMarginLeft(2, Unit.PX);
p.add(h);
iPanel.add(p);
iContent.add(h);
} else
add(text);
}
} else {
add(" ");
}
}