當前位置: 首頁>>代碼示例>>Java>>正文


Java CloseHandler類代碼示例

本文整理匯總了Java中com.google.gwt.event.logical.shared.CloseHandler的典型用法代碼示例。如果您正苦於以下問題:Java CloseHandler類的具體用法?Java CloseHandler怎麽用?Java CloseHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CloseHandler類屬於com.google.gwt.event.logical.shared包,在下文中一共展示了CloseHandler類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showContextMenuPopup

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
protected void showContextMenuPopup(int left, int top) {
    if (customContextMenu instanceof HasWidgets) {
        if (!((HasWidgets) customContextMenu).iterator().hasNext()) {
            // there are no actions to show
            return;
        }
    }

    customContextMenuPopup = Tools.createCubaTableContextMenu();
    customContextMenuPopup.setOwner(this);
    customContextMenuPopup.setWidget(customContextMenu);

    customContextMenuPopup.addCloseHandler(new CloseHandler<PopupPanel>() {
        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
            customContextMenuPopup = null;
        }
    });

    Tools.showPopup(customContextMenuPopup, left, top);
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:22,代碼來源:CubaTreeWidget.java

示例2: getPopup

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
public PopupPane getPopup() {
    if (popup==null) {
        popup = new PopupPane("Alerts", main);
        popup.setDefaultSize(600, 150);
        popup.setHideOnResizeWidget(view);
        popup.setDoRegionChangeHide(false);
        popup.hide();

        final Widget flyer = makeAniIcon();
        popup.addCloseHandler(new CloseHandler<PopupPane>(){
            public void onClose(CloseEvent<PopupPane> popupPanelCloseEvent) {
                int x = popup.getPopupPanel().getAbsoluteLeft() + view.getOffsetWidth() / 2;
                int y = popup.getPopupPanel().getAbsoluteTop() + view.getOffsetHeight() / 2;
                FlyByAnimation ani = new FlyByAnimation(flyer, x, y, message.getAbsoluteTop(),
                                                        message.getAbsoluteLeft());
                ani.setStartSize(100);
                ani.run(1000);
            }
        });
    }
    return popup;

}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:24,代碼來源:AlertManager.java

示例3: RenameFileBox

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
RenameFileBox(Project.NameKey project, Change.Id changeId, RevisionInfo revision) {
  this.project = project;
  this.changeId = changeId;

  path = new RemoteSuggestBox(new PathSuggestOracle(project, changeId, revision));
  path.addCloseHandler(
      new CloseHandler<RemoteSuggestBox>() {
        @Override
        public void onClose(CloseEvent<RemoteSuggestBox> event) {
          hide();
        }
      });

  initWidget(uiBinder.createAndBindUi(this));
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:16,代碼來源:RenameFileBox.java

示例4: forceShow

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
@Override
public void forceShow() {
    final IsWidget widget = getWidget();

    splash.setContent(widget,
                      getBodyHeight());
    splash.setTitle(getTitle());
    splash.show();
    splash.addCloseHandler(new CloseHandler<SplashView>() {
        @Override
        public void onClose(final CloseEvent<SplashView> event) {
            JSSplashScreenActivity.this.onClose();
        }
    });
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:16,代碼來源:JSSplashScreenActivity.java

示例5: onOpen

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
@Override
public void onOpen() {
    super.onOpen();

    popup.addCloseHandler(new CloseHandler<PopupView>() {
        @Override
        public void onClose(CloseEvent<PopupView> event) {
            if (!placeManagerIsClosingUs) {
                try {
                    popupAlreadyHiding = true;
                    placeManager.closePlace(place);
                } finally {
                    popupAlreadyHiding = false;
                }
            }
        }
    });

    final IsWidget widget = getWidget();

    popup.setContent(widget);
    popup.setSize(getSize());
    popup.setTitle(getTitle());
    popup.show();
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:26,代碼來源:AbstractPopupActivity.java

示例6: DIHDialog

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
public DIHDialog(final DIHManager dihManager) {
    super(true, false);
    this.dihManager = dihManager;

    main = new VerticalPanel();
    setText("Data Import Result");

    statusTimer = new Timer() {
        public void run() {
            dihManager.getStatus(new Callback<DIHResult>() {
                public void onSuccess(DIHResult result) {
                    reset(result);
                }
            });
        }
    };

    addCloseHandler(new CloseHandler<PopupPanel>() {
        public void onClose(CloseEvent<PopupPanel> popupPanelCloseEvent) {
            statusTimer.cancel();
        }
    });

    setWidget(main);
}
 
開發者ID:cominvent,項目名稱:solr-explorer,代碼行數:26,代碼來源:DIHDialog.java

示例7: Popup

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
/**
 * Creates a popup.
 *
 * @param reference   reference element for the positioner
 * @param positioner  strategy for positioning the popup
 */
public Popup(Element reference, RelativePopupPositioner positioner) {
  this.reference = reference;
  this.positioner = positioner;
  popupPanel.addStyleName("editor-popup");
  popupPanel.setAnimationEnabled(true);
  popupPanel.addCloseHandler(
      new CloseHandler<PopupPanel>() {
        
        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
          Popup.this.hide();
        }
      });
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:21,代碼來源:Popup.java

示例8: SendMessageDialogUI

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
/**
 * The constructor that has to be used when we send
 * a message to a particular user 
 * @param parentDialog the parent dialog, i.e. the one we open this dialog from
 * @param toUserID the ID of the user we send the message to
 * @param toUserLoginName the login name of the user we send the message to
 * @param replyMsgData if not null then this is the message we reply to
 */
public SendMessageDialogUI( final DialogBox parentDialog, final int toUserID,
							final String toUserLoginName, final PrivateMessageData replyMsgData) {
	super( true, false, true, parentDialog );
	
	//Store the local value of the message we reply to
	this.replyMsgData = replyMsgData;
	
	//Increment the number of opened send message dialogs
	openSendMessageDialogCounter++;
	this.addCloseHandler( new CloseHandler<PopupPanel>(){
		public void onClose( CloseEvent<PopupPanel> e ) {
			if( e.getTarget() == thisDialog ) {
				//The send message is closed, decrement the number of
				//opened send message dialogs
				if( openSendMessageDialogCounter > 0 ) {
					openSendMessageDialogCounter--;
				}
			}
		}
	} );
	
	//Set the message recepient
	setMessageRecepient(toUserID, toUserLoginName);
	
	//Set title and style
	this.setText(titlesI18N.sendPersonalMessageDialogTitle() );
	this.setStyleName( CommonResourcesContainer.USER_DIALOG_STYLE_NAME );
	
	//Fill dialog with data
	populateDialog();		
}
 
開發者ID:ivan-zapreev,項目名稱:x-cure-chat,代碼行數:40,代碼來源:SendMessageDialogUI.java

示例9: SendChatMessageDialogUI

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
/**
 * A constructor creates a send chat message dialog with the preset recipient.
 * @param roomID the id of the room we will be sending the message from
 * @param recepientID the recepient's ID
 * @param recepientLoginName the recipient's login name
 * @param roomsManager the instane of the rooms manager
 */
SendChatMessageDialogUI( final int roomID, final ClickHandler smileyActionLinkClickHandler, final RoomsManagerUI roomsManager ) {
	super( true, false, false, null );
	
	//Store the parameters
	this.commonWidgets = new SendChatMessageWidgets( roomID, smileyActionLinkClickHandler, this, false, roomsManager );
	this.roomsManager = roomsManager;
	
	//Add style
	this.addStyleName( CommonResourcesContainer.SEND_CHAT_MESSAGE_DIALOG_EXTRA_STYLE );
	
	//Update the dialog's title
	updateDialogTitle();
	
	//Call the onClose method to clean up data
	this.addCloseHandler( new CloseHandler<PopupPanel>(){
		public void onClose(CloseEvent<PopupPanel> e) {
			if( e.getTarget() == thisDialog ) {
				//Save the current dialog data
				SendChatMessageManager.getInstance().saveChatMessageDataFromCurrentUI();
			}
		}
	} );
	
	//Initialize the common components
	commonWidgets.initialize();
	
	//Fill dialog with data
	populateDialog();
	
	//Update the list of recipients for the case of no recipients set
	updateMessageRecipientsPanel( );
}
 
開發者ID:ivan-zapreev,項目名稱:x-cure-chat,代碼行數:40,代碼來源:SendChatMessageDialogUI.java

示例10: QuickOpenViewImpl

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
@Inject
public QuickOpenViewImpl(
    Resources resources,
    AutoCompleteResources autoCompleteResources,
    QuickOpenViewImplUiBinder uiBinder,
    LanguageServerResources languageServerResources) {
  this.resources = resources;
  this.languageServerResources = languageServerResources;

  css = autoCompleteResources.autocompleteComponentCss();
  css.ensureInjected();

  DockLayoutPanel rootElement = uiBinder.createAndBindUi(this);
  setWidget(rootElement);
  setAutoHideEnabled(true);
  setAnimationEnabled(true);

  layoutPanel.setWidgetHidden(actionsPanel, true);

  addCloseHandler(
      new CloseHandler<PopupPanel>() {
        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
          delegate.onClose(event.isAutoClosed());
        }
      });
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:28,代碼來源:QuickOpenViewImpl.java

示例11: QuickDocViewImpl

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
@Inject
public QuickDocViewImpl() {
  super(true, true);
  addCloseHandler(
      new CloseHandler<PopupPanel>() {
        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
          if (delegate != null) {
            delegate.onCloseView();
          }
        }
      });

  setSize("400px", "200px");
  Style style = getElement().getStyle();
  style.setProperty("resize", "both");
  style.setPaddingBottom(0, Style.Unit.PX);
  style.setPaddingTop(3, Style.Unit.PX);
  style.setPaddingLeft(3, Style.Unit.PX);
  style.setPaddingRight(3, Style.Unit.PX);
  createFrame();
  add(frame);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:24,代碼來源:QuickDocViewImpl.java

示例12: PopupPane

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的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());
        }
    });
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:46,代碼來源:PopupPane.java

示例13: initDialog

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的package包/類
private static void initDialog() {
  if (restoreGlobal == null) {
    restoreGlobal =
        new CloseHandler<PopupPanel>() {
          @Override
          public void onClose(CloseEvent<PopupPanel> event) {
            active = global;
          }
        };
  }
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:12,代碼來源:GlobalKey.java

示例14: show

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的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;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:20,代碼來源:PopupHelper.java

示例15: onRename

import com.google.gwt.event.logical.shared.CloseHandler; //導入依賴的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;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:30,代碼來源:RenameFileAction.java


注:本文中的com.google.gwt.event.logical.shared.CloseHandler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。