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


Java CloseEvent類代碼示例

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


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

示例1: onClose

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的package包/類
@Override
public void onClose(CloseEvent<PopupPanel> event) {
	debug("VComboBoxMultiselect.SP: onClose(" + event.isAutoClosed() + ")");

	if (event.isAutoClosed()) {
		this.lastAutoClosed = new Date().getTime();
	}
}
 
開發者ID:bonprix,項目名稱:vaadin-combobox-multiselect,代碼行數:9,代碼來源:VComboBoxMultiselect.java

示例2: showContextMenuPopup

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的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

示例3: getPopup

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的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

示例4: RenameFileBox

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的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

示例5: forceShow

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的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

示例6: show

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

    modal.addHiddenHandler(new ModalHiddenHandler() {
        @Override
        public void onHidden(final ModalHiddenEvent hiddenEvent) {
            CloseEvent.fire(PopupViewImpl.this,
                            PopupViewImpl.this,
                            false);
        }
    });

    modal.addHideHandler(new ModalHideHandler() {
        @Override
        public void onHide(ModalHideEvent evt) {
            CloseEvent.fire(PopupViewImpl.this,
                            PopupViewImpl.this,
                            false);
        }
    });
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:23,代碼來源:PopupViewImpl.java

示例7: onOpen

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的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

示例8: shouldNotCallHideOnViewWhenCloseOperationTriggeredByView

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的package包/類
/**
 * Test to ensure we don't start an infinite loop when someone clicks the "X" in the popup header.
 * See also the complementary test, {@link #shouldNotCallCloseOnPlaceManagerWhenCloseOperationTriggeredByPlaceManager()}.
 */
@SuppressWarnings("unchecked")
@Test
public void shouldNotCallHideOnViewWhenCloseOperationTriggeredByView() throws Exception {
    doAnswer(new Answer<Void>() {
        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            // simulate is what PlaceManager will do in response to the close hook
            popupActivity.onClose();
            return null;
        }
    }).when(placeManager).closePlace(popupPlace);

    popupActivity.onStartup(popupPlace);
    popupActivity.onOpen();
    registeredCloseHandler.onClose(mock(CloseEvent.class));

    verify(placeManager,
           times(1)).closePlace(popupPlace);

    // we shouldn't call hide() on the popup, because this sequence of events
    // was triggered by the fact that it was already hiding itself
    verify(popupView,
           never()).hide();
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:29,代碼來源:AbstractPopupActivityTest.java

示例9: shouldNotCallCloseOnPlaceManagerWhenCloseOperationTriggeredByPlaceManager

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的package包/類
/**
 * Test to ensure we don't start an infinite loop when the PlaceManager closes the activity.
 * See also the complementary case, {@link #shouldNotCallHideOnViewWhenCloseOperationTriggeredByView()}.
 */
@SuppressWarnings("unchecked")
@Test
public void shouldNotCallCloseOnPlaceManagerWhenCloseOperationTriggeredByPlaceManager() throws Exception {
    doAnswer(new Answer<Void>() {
        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            // simulate is what PopupView will do in response to hide()
            registeredCloseHandler.onClose(mock(CloseEvent.class));
            return null;
        }
    }).when(popupView).hide();

    popupActivity.onStartup(popupPlace);
    popupActivity.onOpen();
    popupActivity.onClose();

    verify(popupView).hide();

    // PlaceManager initiated this operation, so we mustn't call back into it
    verify(placeManager,
           never()).closePlace(popupPlace);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:27,代碼來源:AbstractPopupActivityTest.java

示例10: DIHDialog

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的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

示例11: onClose

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的package包/類
@Override
public void onClose(CloseEvent<DisclosurePanel> event) {

    for (Iterator panelIt = xPanels.iterator(); panelIt.hasNext();) {
        OutputPanel panel = (OutputPanel) panelIt.next();
        panel.setAnnotationsOpen(false);
    }

}
 
開發者ID:NOAA-PMEL,項目名稱:LAS,代碼行數:10,代碼來源:UI.java

示例12: Popup

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的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

示例13: SendMessageDialogUI

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的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

示例14: SendChatMessageDialogUI

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的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

示例15: QuickOpenViewImpl

import com.google.gwt.event.logical.shared.CloseEvent; //導入依賴的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


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