本文整理汇总了Java中com.google.gwt.user.client.ui.Grid.setStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Grid.setStyleName方法的具体用法?Java Grid.setStyleName怎么用?Java Grid.setStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Grid
的用法示例。
在下文中一共展示了Grid.setStyleName方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createGrid
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* Create a Grid that describes the job
*/
@SuppressWarnings("deprecation")
private Grid createGrid() {
Grid grid = new Grid(2, 2);
grid.setWidth("280px");
grid.setWidget(0, 0, new Label(Constants.studioUIMsg.jobName()));
/**
* Panel information
*/
namebox.setStyleName("boxstyle");
grid.setWidget(0, 1, namebox);
grid.setWidget(1, 0, new Label(Constants.studioUIMsg.jobDescription()));
SubmitListener sl = new SubmitListener();
namebox.addKeyboardListener(sl);
descArea.setStyleName("boxstyle");
descArea.setHeight("auto");
grid.setWidget(1, 1, descArea);
grid.setStyleName("bda-newjob-grid");
return grid;
}
示例2: initGridHead
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
protected void initGridHead(int size){
this.setSpacing(3);
paramsGrid = new Grid(size, 3);
paramsGrid.setStyleName("gridstyle");
paramsGrid.setBorderWidth(1);
paramsGrid.setWidth("250px");
Label nameLabel = new Label(Constants.studioUIMsg.parameter());
nameLabel.setWidth("65px");
paramsGrid.setWidget(0, 0, nameLabel);
Label typeLabel = new Label(Constants.studioUIMsg.type());
typeLabel.setWidth("40px");
paramsGrid.setWidget(0, 1, typeLabel);
Label valueLabel = new Label(Constants.studioUIMsg.value());
paramsGrid.setWidget(0, 2, valueLabel);
paramsGrid.setVisible(false);
}
示例3: onInitialize
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* Initialize this example.
*/
@ShowcaseSource
@Override
public Widget onInitialize() {
// Create the text area and toolbar
RichTextArea area = new RichTextArea();
area.ensureDebugId("cwRichText-area");
area.setSize("100%", "14em");
RichTextToolbar toolbar = new RichTextToolbar(area);
toolbar.ensureDebugId("cwRichText-toolbar");
toolbar.setWidth("100%");
// Add the components to a panel
Grid grid = new Grid(2, 1);
grid.setStyleName("cw-RichText");
grid.setWidget(0, 0, toolbar);
grid.setWidget(1, 0, area);
return grid;
}
示例4: onRender
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
final RichTextArea area = new RichTextArea();
area.setSize("1000", "600");
new OrderService().getOrderTemplate(new OrderService.Listener() {
public void onSuccess(String content) {
area.setHTML(content);
}
});
RichTextToolbar toolbar = new RichTextToolbar(area);
// toolbar.setWidth("100%");
// Add the components to a panel
Grid grid = new Grid(2, 1);
grid.setStyleName("cw-RichText");
grid.setWidget(0, 0, toolbar);
grid.setWidget(1, 0, area);
// grid.setSize("100%", "100%");
add(grid);
Button button = new Button("Save");
add(button);
}
示例5: NotificationContainer
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* Create notification container.
*
* @param resources core resources
*/
@Inject
public NotificationContainer(Resources resources) {
this.resources = resources;
nGrid = new Grid(0, 1);
nGrid.setStyleName(resources.notificationCss().notificationPanelContainer());
add(nGrid);
}
示例6: KeyHelpPopup
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public KeyHelpPopup() {
super(true /* autohide */, true /* modal */);
setStyleName(KeyResources.I.css().helpPopup());
final Anchor closer = new Anchor(KeyConstants.I.closeButton());
closer.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
}
});
final Grid header = new Grid(1, 3);
header.setStyleName(KeyResources.I.css().helpHeader());
header.setText(0, 0, KeyConstants.I.keyboardShortcuts());
header.setWidget(0, 2, closer);
final CellFormatter fmt = header.getCellFormatter();
fmt.addStyleName(0, 1, KeyResources.I.css().helpHeaderGlue());
fmt.setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT);
final Grid lists = new Grid(0, 7);
lists.setStyleName(KeyResources.I.css().helpTable());
populate(lists);
lists.getCellFormatter().addStyleName(0, 3, KeyResources.I.css().helpTableGlue());
final FlowPanel body = new FlowPanel();
body.add(header);
body.getElement().appendChild(DOM.createElement("hr"));
body.add(lists);
focus = new FocusPanel(body);
focus.getElement().getStyle().setProperty("outline", "0px");
focus.getElement().setAttribute("hideFocus", "true");
focus.addKeyPressHandler(this);
focus.addKeyDownHandler(this);
add(focus);
}
示例7: addGrid
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private void addGrid(VerticalPanel fp) {
grid = new Grid(2, 3);
grid.setStyleName(Gerrit.RESOURCES.css().infoBlock());
grid.setText(0, 0, AdminConstants.I.columnProjectName() + ":");
grid.setWidget(0, 1, project);
grid.setText(1, 0, AdminConstants.I.headingParentProjectName() + ":");
grid.setWidget(1, 1, parent);
grid.setWidget(1, 2, browse);
fp.add(grid);
}
示例8: VerifyRulesFiredWidget
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* @param rfl List<VeryfyRuleFired>
* @param scenario = the scenario to add/remove from
*/
public VerifyRulesFiredWidget( final FixtureList rfl,
final Scenario scenario,
final boolean showResults ) {
outer = new Grid( 2,
1 );
this.showResults = showResults;
outer.getCellFormatter().setStyleName( 0,
0,
"modeller-fact-TypeHeader" ); //NON-NLS
outer.getCellFormatter().setAlignment( 0,
0,
HasHorizontalAlignment.ALIGN_CENTER,
HasVerticalAlignment.ALIGN_MIDDLE );
outer.setStyleName( "modeller-fact-pattern-Widget" ); //NON-NLS
outer.setWidget( 0,
0,
new SmallLabel( TestScenarioConstants.INSTANCE.ExpectRules() ) );
initWidget( outer );
FlexTable data = render( rfl,
scenario );
outer.setWidget( 1,
0,
data );
}
示例9: onInitUI
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
@Override
protected void onInitUI() {
super.onInitUI();
tokenLabel = new CopyableLabel("");
tokenLabel.addStyleName(Gerrit.RESOURCES.css().oauthToken());
expiresLabel = new Label("");
expiresLabel.addStyleName(Gerrit.RESOURCES.css().oauthExpires());
grid = new Grid(2, 2);
grid.setStyleName(Gerrit.RESOURCES.css().infoBlock());
grid.addStyleName(Gerrit.RESOURCES.css().oauthInfoBlock());
add(grid);
expiredNote = new Label(Util.C.labelOAuthExpired());
expiredNote.setVisible(false);
add(expiredNote);
row(grid, 0, Util.C.labelOAuthToken(), tokenLabel);
row(grid, 1, Util.C.labelOAuthExpires(), expiresLabel);
CellFormatter fmt = grid.getCellFormatter();
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().bottomheader());
flow = new FlowPanel();
flow.setStyleName(Gerrit.RESOURCES.css().oauthPanel());
add(flow);
Label netrcLabel = new Label(Util.C.labelOAuthNetRCEntry());
netrcLabel.setStyleName(Gerrit.RESOURCES.css().oauthPanelNetRCHeading());
flow.add(netrcLabel);
netrcValue = new CopyableLabel("");
netrcValue.setStyleName(Gerrit.RESOURCES.css().oauthPanelNetRCEntry());
flow.add(netrcValue);
Label cookieLabel = new Label(Util.C.labelOAuthGitCookie());
cookieLabel.setStyleName(Gerrit.RESOURCES.css().oauthPanelCookieHeading());
flow.add(cookieLabel);
cookieValue = new CopyableLabel("");
cookieValue.setStyleName(Gerrit.RESOURCES.css().oauthPanelCookieEntry());
flow.add(cookieValue);
}
示例10: onInitUI
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
@Override
protected void onInitUI() {
super.onInitUI();
String url = Gerrit.info().auth().httpPasswordUrl();
if (url != null) {
Anchor link = new Anchor();
link.setText(Util.C.linkObtainPassword());
link.setHref(url);
link.setTarget("_blank");
add(link);
return;
}
password = new CopyableLabel("(click 'generate' to revoke an old password)");
password.addStyleName(Gerrit.RESOURCES.css().accountPassword());
generatePassword = new Button(Util.C.buttonGeneratePassword());
generatePassword.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
doGeneratePassword();
}
});
final Grid userInfo = new Grid(2, 2);
final CellFormatter fmt = userInfo.getCellFormatter();
userInfo.setStyleName(Gerrit.RESOURCES.css().infoBlock());
userInfo.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
add(userInfo);
row(userInfo, 0, Util.C.userName(), new UsernameField());
row(userInfo, 1, Util.C.password(), password);
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().bottomheader());
final FlowPanel buttons = new FlowPanel();
buttons.add(generatePassword);
add(buttons);
}
示例11: onInitUI
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
@Override
protected void onInitUI() {
super.onInitUI();
createWidgets();
/* top table */
grid = new Grid(2, 2);
grid.setStyleName(Gerrit.RESOURCES.css().infoBlock());
grid.setText(0, 0, Util.C.watchedProjectName());
final HorizontalPanel hp = new HorizontalPanel();
hp.add(nameBox);
hp.add(browse);
grid.setWidget(0, 1, hp);
grid.setText(1, 0, Util.C.watchedProjectFilter());
grid.setWidget(1, 1, filterTxt);
final CellFormatter fmt = grid.getCellFormatter();
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().header());
fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().header());
fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().bottomheader());
final FlowPanel fp = new FlowPanel();
fp.setStyleName(Gerrit.RESOURCES.css().addWatchPanel());
fp.add(grid);
fp.add(addNew);
add(fp);
/* bottom table */
add(watchesTab);
add(delSel);
/* popup */
projectsPopup =
new ProjectListPopup() {
@Override
protected void onMovePointerTo(String projectName) {
// prevent user input from being overwritten by simply poping up
if (!projectsPopup.isPoppingUp() || "".equals(nameBox.getText())) {
nameBox.setText(projectName);
}
}
@Override
protected void openRow(String projectName) {
nameBox.setText(projectName);
doAddNew();
}
};
projectsPopup.initPopup(Util.C.projects(), PageLinks.SETTINGS_PROJECTS);
}
示例12: createNavWidget
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private Widget createNavWidget() {
Grid p = new Grid(1, 5);
p.setStyleName(BoundTable.NAV_STYLE);
Button b = new Button("<<",
new ClickListener() {
public void onClick(Widget sender) {
first();
}
});
b.setStyleName(BoundTable.NAV_STYLE);
if (this.getCurrentChunk() == 0) {
b.setEnabled(false);
}
p.setWidget(0, 0, b);
b = new Button("<",
new ClickListener() {
public void onClick(Widget sender) {
previous();
}
});
b.setStyleName(BoundTable.NAV_STYLE);
if (this.getCurrentChunk() == 0) {
b.setEnabled(false);
}
p.setWidget(0, 1, b);
b = new Button(">",
new ClickListener() {
public void onClick(Widget sender) {
next();
}
});
b.setStyleName(BoundTable.NAV_STYLE);
if (this.getCurrentChunk() == (this.getNumberOfChunks() - 1)) {
b.setEnabled(false);
}
Label l = new Label((this.getCurrentChunk() + 1) + " / "
+ this.getNumberOfChunks());
p.setWidget(0, 2, l);
p.getCellFormatter().setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_CENTER);
p.setWidget(0, 3, b);
b = new Button(">>",
new ClickListener() {
public void onClick(Widget sender) {
last();
}
});
b.setStyleName(BoundTable.NAV_STYLE);
if (this.getCurrentChunk() == (this.getNumberOfChunks() - 1)) {
b.setEnabled(false);
}
p.setWidget(0, 4, b);
return p;
}