本文整理汇总了Java中com.google.gwt.user.client.ui.PopupPanel.setStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java PopupPanel.setStyleName方法的具体用法?Java PopupPanel.setStyleName怎么用?Java PopupPanel.setStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.PopupPanel
的用法示例。
在下文中一共展示了PopupPanel.setStyleName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HorizontalPanelWithHint
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public HorizontalPanelWithHint(Widget hint) {
super();
iHint = new PopupPanel();
iHint.setWidget(hint);
iHint.setStyleName("unitime-PopupHint");
sinkEvents(Event.ONMOUSEOVER);
sinkEvents(Event.ONMOUSEOUT);
sinkEvents(Event.ONMOUSEMOVE);
iShowHint = new Timer() {
@Override
public void run() {
iHint.show();
}
};
iHideHint = new Timer() {
@Override
public void run() {
iHint.hide();
}
};
}
示例2: UniTimeTable
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public UniTimeTable() {
setCellPadding(2);
setCellSpacing(0);
sinkEvents(Event.ONMOUSEOVER);
sinkEvents(Event.ONMOUSEOUT);
sinkEvents(Event.ONCLICK);
sinkEvents(Event.ONKEYDOWN);
sinkEvents(Event.ONDBLCLICK);
setStylePrimaryName("unitime-MainTable");
iHintPanel = new PopupPanel();
iHintPanel.setStyleName("unitime-PopupHint");
Roles.getGridRole().set(getElement());
}
示例3: SelectionLayer
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public SelectionLayer() {
setStyleName("selection-layer");
iPopup = new PopupPanel();
iPopup.setStyleName("unitime-TimeGridSelectionPopup");
iHint = new P("content");
iPopup.setWidget(iHint);
iSelection = new SelectionPanel();
iSelection.setVisible(false);
add(iSelection, 0, 0);
sinkEvents(Event.ONMOUSEDOWN);
sinkEvents(Event.ONMOUSEUP);
sinkEvents(Event.ONMOUSEMOVE);
sinkEvents(Event.ONMOUSEOVER);
sinkEvents(Event.ONMOUSEOUT);
}
示例4: animationIconCSS
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
private void animationIconCSS(int mills, int startX, int startY) {
Image icon = new Image(ONE_GEAR_ICON_LARGE);
final PopupPanel popup= new PopupPanel();
popup.setStyleName("");
popup.addStyleName("animationLevel");
popup.setAnimationEnabled(false);
popup.setWidget(icon);
Widget w= button.getIcon()!=null ? button.getIcon() : button;
int endX= w.getAbsoluteLeft();
int endY= w.getAbsoluteTop();
setupCssAnimation(startX,startY,endX,endY);
int extra= 35;
CssAnimation.setAnimationStyle(popup,"iconAnimate "+ (mills+extra) +"ms ease-in-out 1 normal");
popup.setPopupPosition(endX, endY);
popup.show();
Timer t= new Timer() {
@Override
public void run() {
popup.hide();
}
};
t.schedule( mills);
}
示例5: PopupPane
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public PopupPane(String header,
Widget content,
PopupType ptype,
boolean pointerPopup,
boolean modal,
boolean autoHide,
HeaderType headerType) {
cnt++;
this.header = header;
_ptype= isStyleImplemented(ptype) ? ptype : PopupType.STANDARD;
_pointerPopup= pointerPopup;
_pointerIm= null;
_headerType= headerType;
_anStyleName = "ppDrop"+cnt;
init(modal,autoHide, headerType);
if (content!=null) setWidget(content);
popup.setAnimationEnabled(true);
_masking= modal;
if (Application.getInstance().getDefZIndex()>0) {
GwtUtil.setStyle(popup,"zIndex", Application.getInstance().getDefZIndex()+"");
}
if (_masking) {
_maskPanel = new PopupPanel(false, false);
_maskPanel.setAnimationEnabled(false);
_maskPanel.setStyleName("firefly-mask-ui");
addZIndexStyle(popup,"onTopDialog" );
_maskPanel.setWidget(new Label()); // needed for style to take effect
}
else {
_maskPanel = null;
}
popup.addCloseHandler(new CloseHandler<PopupPanel>() {
public void onClose(CloseEvent<PopupPanel> ev) {
CloseEvent.fire(PopupPane.this, PopupPane.this, ev.isAutoClosed());
}
});
}
示例6: show
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
void show() {
final PopupPanel p = new PopupPanel(true);
p.setStyleName(Resources.I.style().popup());
p.addAutoHidePartner(activatingButton.getElement());
p.addCloseHandler(
new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
activatingButton.unlink();
if (popup == p) {
popup = null;
}
}
});
p.add(panel);
p.showRelativeTo(activatingButton);
GlobalKey.dialog(p);
popup = p;
}
示例7: onRename
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
void onRename() {
if (popup != null) {
popup.hide();
return;
}
if (renameBox == null) {
renameBox = new RenameFileBox(project, changeId, revision);
}
renameBox.clearPath();
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(renameButton.getElement());
p.addCloseHandler(
new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
if (popup == p) {
popup = null;
}
}
});
p.add(renameBox);
p.showRelativeTo(renameButton);
GlobalKey.dialog(p);
renameBox.setFocus(true);
popup = p;
}
示例8: onEdit
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public void onEdit() {
if (popup != null) {
popup.hide();
return;
}
files.unregisterKeys();
if (addBox == null) {
addBox = new AddFileBox(project, changeId, revision, files);
}
addBox.clearPath();
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(addButton.getElement());
p.addCloseHandler(
new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
if (popup == p) {
popup = null;
}
}
});
p.add(addBox);
p.showRelativeTo(addButton);
GlobalKey.dialog(p);
addBox.setFocus(true);
popup = p;
}
示例9: onReply
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
void onReply(MessageInfo msg) {
if (popup != null) {
popup.hide();
return;
}
if (replyBox == null) {
replyBox = new ReplyBox(clp, project, psId, revision, allLabels, permittedLabels);
allLabels = null;
permittedLabels = null;
}
if (msg != null) {
replyBox.replyTo(msg);
}
final PopupPanel p = new PopupPanel(true, false);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(replyButton.getElement());
p.addAutoHidePartner(quickApproveButton.getElement());
p.addCloseHandler(
new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
if (popup == p) {
popup = null;
if (hasDraftComments || replyBox.hasMessage()) {
replyButton.setStyleName(style.highlight());
}
}
}
});
p.add(replyBox);
Window.scrollTo(0, 0);
replyButton.removeStyleName(style.highlight());
p.showRelativeTo(replyButton);
GlobalKey.dialog(p);
popup = p;
}
示例10: onDelete
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
void onDelete() {
if (popup != null) {
popup.hide();
return;
}
if (deleteBox == null) {
deleteBox = new DeleteFileBox(project, changeId, revision);
}
deleteBox.clearPath();
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(deleteButton.getElement());
p.addCloseHandler(
new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
if (popup == p) {
popup = null;
}
}
});
p.add(deleteBox);
p.showRelativeTo(deleteButton);
GlobalKey.dialog(p);
deleteBox.setFocus(true);
popup = p;
}
示例11: show
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
void show() {
if (popup != null) {
popup.hide();
popup = null;
return;
}
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.popup());
p.addAutoHidePartner(activatingButton.getElement());
p.addCloseHandler(
new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
if (popup == p) {
popup = null;
}
}
});
p.add(this);
p.showRelativeTo(activatingButton);
GlobalKey.dialog(p);
message.setFocus(true);
popup = p;
}
示例12: PopupCanvas
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public PopupCanvas(Widget offset, int width, int height) {
this.offset = offset;
this.width = width;
this.height = height;
popupPanel = new PopupPanel(false, false);
popupPanel.setStyleName("popup-canvas-background");
prepare();
}
示例13: handleException
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public void handleException(Object source, ValidationException exception) {
final Widget w = (Widget) source;
final PopupPanel p = new PopupPanel(false);
popups.put( source, p );
p.setStyleName("gwittir-ValidationPopup");
p.setWidget(new Label(this.getMessage(exception)));
p.setPopupPosition( -5000, -5000 );
p.show();
if(this.position == BOTTOM) {
p.setPopupPosition(w.getAbsoluteLeft(),
w.getAbsoluteTop() + w.getOffsetHeight());
} else if(this.position == RIGHT) {
p.setPopupPosition(w.getAbsoluteLeft() + w.getOffsetWidth(),
w.getAbsoluteTop());
} else if(this.position == LEFT) {
p.setPopupPosition(w.getAbsoluteLeft() - p.getOffsetWidth(),
w.getAbsoluteTop());
} else if(this.position == TOP) {
p.setPopupPosition(w.getAbsoluteLeft(),
w.getAbsoluteTop() - p.getOffsetHeight());
}
if( w instanceof SourcesPropertyChangeEvents ){
GWT.log("is PCE", null);
PropertyChangeListener attachListener = new PropertyChangeListener(){
public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
if( ((Boolean)propertyChangeEvent.getNewValue()).booleanValue() ){
p.setVisible( true );
} else {
p.setVisible( false );
}
}
};
listeners.put(w, attachListener );
((SourcesPropertyChangeEvents)w).addPropertyChangeListener("attached", attachListener);
((SourcesPropertyChangeEvents)w).addPropertyChangeListener("visible", attachListener);
}
}
示例14: show
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public void show() {
final PopupPanel panel = new PopupPanel();
panel.setStyleName(Res.R.style().toast());
HTML label = new HTML(message.replace("\n", "<br/>"));
panel.setWidget(label);
panel.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
public void setPosition(int offsetWidth, int offsetHeight) {
int left = (Window.getClientWidth() - offsetWidth) / 2;
int top = 0;
switch (gravity) {
case Gravity.TOP:
top = (Window.getClientHeight() - offsetHeight) / 10;
break;
case Gravity.CENTER:
top = (Window.getClientHeight() - offsetHeight) / 2;
break;
case Gravity.BOTTOM:
top = 9 * (Window.getClientHeight() - offsetHeight) / 10;
break;
}
panel.setPopupPosition(left, top);
}
});
// Create a new timer that calls hide().
Timer t = new Timer() {
public void run() {
panel.hide();
}
};
if (duration == LENGTH_SHORT) {
t.schedule(2500);
} else {
t.schedule(4000);
}
}
示例15: AriaSuggestBox
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public AriaSuggestBox(AriaTextBox box, SuggestOracle oracle) {
iOracle = oracle;
iText = box;
iText.setStyleName("gwt-SuggestBox");
initWidget(iText);
addEventsToTextBox();
iSuggestionMenu = new SuggestionMenu();
iPopupScroll = new ScrollPanel(iSuggestionMenu);
iPopupScroll.addStyleName("scroll");
iSuggestionPopup = new PopupPanel(true, false);
iSuggestionPopup.setPreviewingAllNativeEvents(true);
iSuggestionPopup.setStyleName("unitime-SuggestBoxPopup");
iSuggestionPopup.setWidget(iPopupScroll);
iSuggestionPopup.addAutoHidePartner(getElement());
iSuggestionCallback = new SuggestionCallback() {
@Override
public void onSuggestionSelected(Suggestion suggestion) {
if (!suggestion.getReplacementString().isEmpty()) {
setStatus(ARIA.suggestionSelected(status(suggestion)));
}
iCurrentText = suggestion.getReplacementString();
setText(suggestion.getReplacementString());
hideSuggestionList();
fireSuggestionEvent(suggestion);
}
};
iOracleCallback = new SuggestOracle.Callback() {
@Override
public void onSuggestionsReady(Request request, Response response) {
if (response.getSuggestions() == null || response.getSuggestions().isEmpty()) {
if (iSuggestionPopup.isShowing()) iSuggestionPopup.hide();
} else {
iSuggestionMenu.clearItems();
SuggestOracle.Suggestion first = null;
for (SuggestOracle.Suggestion suggestion: response.getSuggestions()) {
iSuggestionMenu.addItem(new SuggestionMenuItem(suggestion));
if (first == null) first = suggestion;
}
iSuggestionMenu.selectItem(0);
ToolBox.setMinWidth(iSuggestionMenu.getElement().getStyle(), (iText.getElement().getClientWidth() - 4) + "px");
iSuggestionPopup.showRelativeTo(iText);
iSuggestionMenu.scrollToView();
if (response.getSuggestions().size() == 1) {
if (first.getReplacementString().isEmpty())
setStatus(status(first));
else
setStatus(ARIA.showingOneSuggestion(status(first)));
} else {
setStatus(ARIA.showingMultipleSuggestions(response.getSuggestions().size(), request.getQuery(), status(first)));
}
}
}
};
Roles.getTextboxRole().setAriaAutocompleteProperty(iText.getElement(), AutocompleteValue.NONE);
iSuggestionPopup.getElement().setAttribute("id", DOM.createUniqueId());
Roles.getTextboxRole().setAriaOwnsProperty(iText.getElement(), Id.of(iSuggestionPopup.getElement()));
}