当前位置: 首页>>代码示例>>Java>>正文


Java PopupPanel.setVisible方法代码示例

本文整理汇总了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);
}
 
开发者ID:jkonert,项目名称:socom,代码行数:29,代码来源:ShortNotification.java

示例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);
    }
}
 
开发者ID:kebernet,项目名称:gwittir,代码行数:39,代码来源:PopupValidationFeedback.java


注:本文中的com.google.gwt.user.client.ui.PopupPanel.setVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。