本文整理汇总了Java中com.google.gwt.user.client.ui.PopupPanel.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java PopupPanel.setVisible方法的具体用法?Java PopupPanel.setVisible怎么用?Java PopupPanel.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.PopupPanel
的用法示例。
在下文中一共展示了PopupPanel.setVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public static void show(String text, int delayMillis, final boolean doReload){
final PopupPanel notificationPopup = new PopupPanel(false);
final Label label = new Label(text);
notificationPopup.setWidget(label);
notificationPopup.setPopupPosition(50, 20);
notificationPopup.setVisible(true);
notificationPopup.show();
Timer t = new Timer() {
@Override
public void run() {
Animation a = new Animation() {
@Override
protected void onUpdate(double progress) {
notificationPopup.getElement().getStyle().setProperty("opacity", String.valueOf(1-progress));
if(progress == 1) {
notificationPopup.hide();
if(doReload)
Location.reload();
}
}
};
a.run(500);
}
};
t.schedule(delayMillis);
}
示例2: 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);
}
}