本文整理匯總了Java中com.google.gwt.user.client.ui.VerticalPanel.addStyleName方法的典型用法代碼示例。如果您正苦於以下問題:Java VerticalPanel.addStyleName方法的具體用法?Java VerticalPanel.addStyleName怎麽用?Java VerticalPanel.addStyleName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.VerticalPanel
的用法示例。
在下文中一共展示了VerticalPanel.addStyleName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getFoot
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
private VerticalPanel getFoot() {
slider.setWidth("290px");
slider.disable();
slider.setIncrement(1);
slider.addValueChangeHandler(new ValueChangeHandler<Integer>() {
@Override
public void onValueChange(final ValueChangeEvent<Integer> event) {
final Layer layer = getSelectedLayer(getSelectedTabName());
layer.setOpacity((float) (event.getValue().intValue() / 100.0));
}
});
final VerticalPanel panel = new VerticalPanel();
panel.setWidth("300px");
panel.addStyleName(ThemeStyles.get().style().borderTop());
panel.add(new HTML(UIMessages.INSTANCE.lmOpacityHtmlLabel()));
panel.add(slider);
panel.add(statusBar);
return panel;
}
示例2: populateAvatarTitlePanel
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
@Override
public UserAvatarWidget populateAvatarTitlePanel(VerticalPanel avatarVerticalPanel, final ShortUserData senderData) {
//Add the title label
final Label createdByLabel = new Label( i18nTitles.topicCreatedByFieldTitle() );
createdByLabel.setStylePrimaryName( CommonResourcesContainer.USER_DIALOG_COMPULSORY_FIELD_STYLE );
createdByLabel.setWordWrap( false );
avatarVerticalPanel.add( createdByLabel );
avatarVerticalPanel.addStyleName( CommonResourcesContainer.FORUM_TITLE_EXTRA_STYLE );
//Add the avatar in a mode without the image
final UserAvatarWidget avatarWidget = new UserAvatarWidget( senderData, UserAvatarWidget.DISPLAY_USER_NAME_DATA );
avatarVerticalPanel.add( avatarWidget );
//Return the avatar object
return avatarWidget;
}
示例3: ChatMessagesPanelUI
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
/**
* The basic constructor
* @param roomID the id of the room to which this messages panel belongs
*/
public ChatMessagesPanelUI( final int roomID ) {
//Store the room's ID
this.roomID = roomID;
//Set interface components
table.setStyleName( CommonResourcesContainer.CHAT_MESSAGES_TABLE_STYLE_NAME );
VerticalPanel bottomAlignmentPanel = new VerticalPanel();
bottomAlignmentPanel.addStyleName( CommonResourcesContainer.CHAT_MESSAGES_VERTICAL_ALIGN_PANEL_STYLE_NAME );
bottomAlignmentPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
bottomAlignmentPanel.add( table );
msgsScrollPanel.add( bottomAlignmentPanel );
msgsScrollPanel.setStyleName( CommonResourcesContainer.CHAT_MESSAGES_SCROLL_PANEL_STYLE_NAME );
/*Initialize the composite widget*/
initWidget( msgsScrollPanel );
}
示例4: ErrorView
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
public ErrorView() {
VerticalPanel panel = new VerticalPanel();
Button reloadButton = new Button("Restart");
dialogBox.setText("System Error");
dialogBox.setGlassEnabled(true);
dialogBox.setAnimationEnabled(true);
dialogBox.addStyleName("gwt-ErrorDialogBox");
panel.addStyleName("dialog-vpanel");
panel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
errorLabel.addStyleName("dialog-error-icon");
panel.add(errorLabel);
reloadButton.addClickHandler(this);
panel.add(reloadButton);
dialogBox.setWidget(panel);
}
示例5: BaseViewImpl
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
public BaseViewImpl(boolean useDetailsPanel) {
errorPanel = new AlertPanel(Type.ERROR);
sandboxStyle = Utils.sandboxStyle;
avroUiStyle = Utils.avroUiStyle;
initWidget(createAndBindUi());
setTitle(getViewTitle());
if (useDetailsPanel) {
detailsPanel = new VerticalPanel();
detailsPanel.setWidth("100%");
detailsPanel.addStyleName(sandboxStyle.contentPanel());
ScrollPanel scroll = new ScrollPanel();
scroll.setWidth("100%");
scroll.add(detailsPanel);
centerPanel.setWidget(scroll);
}
initCenterPanel();
clearError();
}
示例6: DefaultHomepage
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
@Inject
public DefaultHomepage(CardGrid cardGrid,
@StartGame Button button,
GameHost startGame,
ScoreBoard scoreBoard) {
button.addClickListener(startGame);
VerticalPanel gamePanel = new VerticalPanel();
gamePanel.addStyleName("widePanel");
Label title = new Label("Welcome to... Higher or Lower!");
title.addStyleName("title");
gamePanel.add(title);
gamePanel.add(button);
gamePanel.add(cardGrid);
gamePanel.add(scoreBoard);
initWidget(gamePanel);
}
示例7: Form
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
public Form(boolean addComponentBackground) {
form.addStyleName("input-form-layout");
//form.addStyleName("standard-border");
if (addComponentBackground) form.addStyleName("component-background");
buttonBar = new ButtonBar();
buttonBar.setVisible(false);
buttonBar.addStyleName("button-bar");
//buttonBar.addStyleName("standard-border");
VerticalPanel mainLayoutPanel = new VerticalPanel();
mainLayoutPanel.setSpacing(3);
mainLayoutPanel.addStyleName("input-form");
mainLayoutPanel.add(form);
mainLayoutPanel.add(buttonBar);
//initWidget(GwtUtil.centerAlign(mainLayoutPanel));
initWidget(mainLayoutPanel);
}
示例8: populateDialog
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
@Override
protected void populateDialog() {
//ADD THE MAIN DATA FIELDS
if( isTopicView ) {
addNewGrid( 2, 2, false, "", true);
} else {
addNewGrid( 1, 1, false, "", true);
}
//Make a wrapper scroll panel around the message because it can be too long
VerticalPanel centeringPanel = new VerticalPanel();
centeringPanel.addStyleName( CommonResourcesContainer.MAXIMUM_WIDTH_FOR_MESSAGE_VIEW_STYLE );
centeringPanel.setHeight("100%");
centeringPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
centeringPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
centeringPanel.add( forumMessageUI );
ScrollPanel wrapperPanel = new ScrollPanel();
wrapperPanel.setStyleName( CommonResourcesContainer.SCROLLABLE_SIMPLE_PANEL );
//Force the maximum viewable area for the displayed forum message
wrapperPanel.addStyleName( CommonResourcesContainer.MAXIMUM_SIZE_FOR_MESSAGE_VIEW_STYLE );
wrapperPanel.add( centeringPanel );
if( isTopicView ) {
addToGrid( this.getCurrentGridIndex(), FIRST_COLUMN_INDEX, 2, wrapperPanel, false, false );
//Add the grid action buttons
this.addGridActionElements(true, true);
} else {
addToGrid( FIRST_COLUMN_INDEX, wrapperPanel, false, false );
}
}
示例9: addDialogWidgets
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
private void addDialogWidgets() {
VerticalPanel vertPanel = new VerticalPanel();
SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
SimplePager pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true) {
@Override
public void setPageStart(int index) {
HasRows display = getDisplay();
if (display != null) {
Range range = display.getVisibleRange();
int pageSize = range.getLength();
if (isRangeLimited() && display.isRowCountExact()) {
index = Math.min(index, display.getRowCount() - 1);
}
index = Math.max(0, index);
if (index != range.getStart()) {
display.setVisibleRange(index, pageSize);
}
}
}
};
vertPanel.addStyleName("dialog-vpanel");
vertPanel.add(table);
vertPanel.add(pager);
pager.setDisplay(table);
pager.addStyleName("centered-hortz");
dialogBox.setWidget(vertPanel);
}
示例10: MultiConstraintHardMediumSoftMatchRuleModellerWidget
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
public MultiConstraintHardMediumSoftMatchRuleModellerWidget(final RuleModeller mod,
final EventBus eventBus,
final ActionMultiConstraintHardMediumSoftMatch actionConstraintMatch,
final TranslationService translationService,
final Boolean readOnly) {
super(mod,
eventBus,
translationService);
hardConstraintMatchInputWidget = new ConstraintMatchInputWidget(actionConstraintMatch.getActionHardConstraintMatch());
hardConstraintMatchInputWidget
.addConstraintMatchValueChangeHandler(new ConstraintMatchValueChangeHandler(actionConstraintMatch.getActionHardConstraintMatch()));
mediumConstraintMatchInputWidget = new ConstraintMatchInputWidget(actionConstraintMatch.getActionMediumConstraintMatch());
mediumConstraintMatchInputWidget
.addConstraintMatchValueChangeHandler(new ConstraintMatchValueChangeHandler(actionConstraintMatch.getActionMediumConstraintMatch()));
softConstraintMatchInputWidget = new ConstraintMatchInputWidget(actionConstraintMatch.getActionSoftConstraintMatch());
softConstraintMatchInputWidget
.addConstraintMatchValueChangeHandler(new ConstraintMatchValueChangeHandler(actionConstraintMatch.getActionSoftConstraintMatch()));
VerticalPanel verticalPanel = new VerticalPanel();
HorizontalPanel labelPanel = createLabelPanel(translationService.getTranslation(GuidedRuleEditorConstants.RuleModellerActionPlugin_MultiConstraintMatch));
verticalPanel.add(labelPanel);
verticalPanel.add(getItemPanel(translationService.getTranslation(GuidedRuleEditorConstants.RuleModellerActionPlugin_HardScore),
hardConstraintMatchInputWidget));
verticalPanel.add(getItemPanel(translationService.getTranslation(GuidedRuleEditorConstants.RuleModellerActionPlugin_MediumScore),
mediumConstraintMatchInputWidget));
verticalPanel.add(getItemPanel(translationService.getTranslation(GuidedRuleEditorConstants.RuleModellerActionPlugin_SoftScore),
softConstraintMatchInputWidget));
verticalPanel.addStyleName(GuidedRuleEditorResources.INSTANCE.css().multiConstraintMatch());
initWidget(verticalPanel);
}
開發者ID:kiegroup,項目名稱:optaplanner-wb,代碼行數:36,代碼來源:MultiConstraintHardMediumSoftMatchRuleModellerWidget.java
示例11: resize
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
public void resize() {
int px = getResizedWidth();
for (Widget w : widgets) {
if (!(w instanceof HTML)) {
VerticalPanel vp = ((VerticalPanel) w);
GwtUtil.setStyle(vp, "maxWidth", Integer.toString(px) + "px");
GwtUtil.setStyle(vp, "width", Integer.toString(px) + "px");
GwtUtil.setStyle(vp, "clear", "none");
for (Iterator<Widget> i = vp.iterator(); i.hasNext(); ) {
Widget c = i.next();
try {
if (panelMap.containsKey(vp)) {
int height = panelMap.get(vp).getCurrentPlot().getScreenHeight() + MPW_HEADER_HEIGHT;
int width = px - 8;
vp.clear();
vp.add(panelMap.get(vp).makeFixedSizeContainer(width, height, false));
vp.addStyleName("shadow");
GwtUtil.setStyles(vp, "margin", "2px",
"background","#E5E5E5 url(images/bg_boxgradient.png) repeat-x");
} else {
GwtUtil.setStyle(c, "maxWidth", Integer.toString(px) + "px");
GwtUtil.setStyle(c, "width", Integer.toString(px) + "px");
}
} catch (NullPointerException e) {
//todo: handle null pointer exception
}
}
}
}
}
示例12: makeSideHeader
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
protected Widget makeSideHeader() {
Widget close = makeCloseButton(false);
SimplePanel panel= new SimplePanel();
panel.addStyleName(_ffCss.titleBgColor());
panel.addStyleName(_ffCss.titleColor());
panel.setHeight("100%");
VerticalPanel header = new VerticalPanel();
titleLabel.addStyleName("title-label");
titleLabel.setHeight("100%");
DOM.setStyleAttribute(titleLabel.getElement(), "cursor", "default");
GwtUtil.setStyle(header, "paddingTop", "3px");
titleLabel.setHTML(" ");
header.addStyleName(_ffCss.popupTitleVerticalBackground());
header.addStyleName(_ffCss.titleBgColor());
header.addStyleName(_ffCss.titleColor());
// header.addStyleName(_ffCss.popupBackground());
header.add(close);
header.add(titleLabel);
header.setCellHeight(titleLabel, "100%");
header.setWidth("15px");
header.setHeight("100%");
panel.setWidget(header);
return panel;
}
示例13: SearchPanel
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
private SearchPanel() {
navPanel = new VerticalPanel();
formPanel.addStyleName("content-panel");
setFormAreaMinWidth("500px");
//li
DockPanel mainPanel = new DockPanel();
mainPanel.addStyleName("component-background");
mainPanel.add(navPanel, DockPanel.WEST);
mainPanel.add(formPanel, DockPanel.CENTER);
Element el = (Element) navPanel.getElement().getParentElement();
if (el != null) {
DOM.setStyleAttribute(el, "background", "#E5E5E5");
DOM.setStyleAttribute(el, "padding", "10px 10px 10px 30px");
DOM.setStyleAttribute(el, "borderRight", "2px outset #e8e8e8");
} else {
navPanel.addStyleName("search-panel-list");
}
// mainPanel.setWidth("100%");
mainPanel.setCellWidth(navPanel, "200px");
mainPanel.setCellHeight(navPanel, "100%");
initWidget(mainPanel);
}
示例14: init
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
/**
* UI Initialization
*/
protected void init() {
this.setSize("850px", "400px");
this.setGlassEnabled(true);
this.setModal(true);
desc.setText(desc.getText()+" Job Id - "+bdaJobId);
closeButton.setSize("10px", "10px");
closeButton.setStyleName("closebtn");
VerticalPanel topPanel = new VerticalPanel(); //Outermost vertical panel
topPanel.add(closeButton);
topPanel.setCellHeight(closeButton, "13px");
topPanel.setStyleName("vpanel");
desc.setStyleName("popupTitle");
topPanel.add(desc);
topPanel.setCellHeight(desc, "30px");
HorizontalPanel optPanel = new HorizontalPanel(); //Operation panel(include search, batch delete.etc)
optPanel.addStyleName("run-history-optPanel");
DateTimeFormat pickerFormat = DateTimeFormat.getFormat("yyyy-MM-dd");
startTimeBox.setFormat(new DateBox.DefaultFormat(pickerFormat));
startTimeBox.getDatePicker().addStyleName("run-history-datepicker-popup");
endTimeBox.setFormat(new DateBox.DefaultFormat(pickerFormat));
endTimeBox.getDatePicker().addStyleName("run-history-datepicker-popup");
searchBtn.removeStyleName("gwt-Button");
searchBtn.addStyleName("run-history-search-button");
//The initial time is set to 2016-1-1
endTime = new Date();
DateTimeFormat tmpFormatter = DateTimeFormat.getFormat("yyyy-MM-dd");
startTime = tmpFormatter.parse("2016-01-01");
selectAllChkBox.setVisible(false);
batchDelBtn.removeStyleName("gwt-Button");
batchDelBtn.addStyleName("run-history-batch-del-button");
optPanel.add(startTimeLabel);
optPanel.add(startTimeBox);
optPanel.add(endTimeLabel);
optPanel.add(endTimeBox);
optPanel.add(searchBtn);
if(isExample && !AppController.power.equals("111")) //Example job only can be deleted by administrator privileges
{}
else
optPanel.add(batchDelBtn);
optPanel.add(selectAllChkBox);
runHistoryGrid.addStyleName("run-history-table"); //Data view
runHistoryGrid.addStyleName("table-striped");
runHistoryGrid.addStyleName("table-hover");
runHistoryGrid.resize(rowNum, colNum);
for(int i=0;i<colNum;i++)
{
runHistoryGrid.setText(0, i, columns[i]);
}
initGridData();
topPanel.add(optPanel);
topPanel.add(runHistoryGrid);
VerticalPanel bottomPanel = new VerticalPanel(); //Paging control
bottomPanel.add(pageGrid);
bottomPanel.addStyleName("run-history-bottomPanel");
VerticalPanel panel = new VerticalPanel();
panel.add(topPanel);
panel.add(bottomPanel);
this.add(panel);
this.setStyleName("loading_container");
}
示例15: populateTitlePanel
import com.google.gwt.user.client.ui.VerticalPanel; //導入方法依賴的package包/類
private void populateTitlePanel() {
//Add the avatar panel to the message if needed
final boolean isAvatarPanelNeeded = isAvatarTitlePanelNeeded();
if( isAvatarPanelNeeded ) {
//Add the sub-panel with the avatar
VerticalPanel avatarTitlePanel = new VerticalPanel();
avatarTitlePanel.setWidth("100%");
avatarTitlePanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
avatarTitlePanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
avatarTitlePanel.addStyleName( CommonResourcesContainer.MESSAGE_AVATAR_TITLE_PANEL_STYLE );
//Populate the panel, store the link to the avatar, if needed
userAvatar = populateAvatarTitlePanel( avatarTitlePanel, messageData.senderData );
//Put it into the message
titlePanelTable.setWidget(0, 0, avatarTitlePanel );
titlePanelTable.getCellFormatter().addStyleName(0, 0, CommonResourcesContainer.FORUM_MESSAGE_SUBJECT_DELIM_PANEL_STYLE );
}
//Add the subpanel with the title and other message info
VerticalPanel titleVertPanel = new VerticalPanel();
titleVertPanel.setHeight("100%");
//In case of the avatar panel NOT needed this is the first cell in the row, otherwise it is the second cell
titlePanelTable.setWidget(0, ( isAvatarPanelNeeded ? 1 : 0 ), titleVertPanel );
titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
titleVertPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
final Label messageSubjectField = new Label( getMessageSubjectFieldName() + ":" );
messageSubjectField.setWordWrap( false );
MessageTextToFlowPanel.addContentWidget( messageSubjectContent, messageSubjectField, true );
final List<Widget> messageWidgets = SmileyHandlerUI.getMessageViewObject( messageData.messageTitle,
ChatMessage.MAX_ONE_WORD_LENGTH, false );
for( Widget w : messageWidgets ) {
MessageTextToFlowPanel.addContentWidget( messageSubjectContent, w, true );
}
//Set the proper styles to the field and value labels
setMessageSubjectFieldValueStyles( messageSubjectField, messageSubjectContent );
titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
//Add message title clicking capability, if needed
if( isMsgTitleClickable ) {
//THe clickable version allows to view the forum message replies
messageSubjectClickPanel = new FocusPanel();
messageSubjectClickPanel.setTitle( getViewForumMessageRepliesLinkText() );
messageSubjectClickPanel.addStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_STYLE );
messageSubjectClickPanel.add( messageSubjectContent );
titleVertPanel.add( messageSubjectClickPanel );
} else {
messageSubjectContent.addStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_STYLE );
titleVertPanel.add( messageSubjectContent );
}
lastSenderProfileLink = populateMessageTitleLastReplyInfoPanel( titleInfoLastRepPanel );
titleVertPanel.add( titleInfoLastRepPanel );
//Add the message title info
if( SiteManager.isAdministrator() ) {
//if the user is an administrator, then he is allowed to see the message id of all messages
addNewFieldValuePair( titleInfoPanel, i18nTitles.forumMessageID(), messageData.messageID + "", true );
}
populateMessageTitleInfoPanel( titleInfoPanel );
titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
titleVertPanel.add( titleInfoPanel );
//Complete the title panel
mainVerticalPanel.add( titlePanelTable );
//Add the delimiter panel
SimplePanel delimiterPanel = new SimplePanel();
delimiterPanel.setStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_DELIMITER_PANEL_STYLE );
mainVerticalPanel.add( delimiterPanel );
}