Java 类com.google.gwt.event.logical.shared.CloseHandler 实例源码

项目:cuba    文件:CubaTreeWidget.java   
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);
}
项目:x-cure-chat    文件:SendMessageDialogUI.java   
/**
 * 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();       
}
项目:che    文件:QuickDocViewImpl.java   
@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);
}
项目:firefly    文件:AlertManager.java   
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;

}
项目:gerrit    文件:PopupHelper.java   
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;
}
项目:gerrit    文件:ActionMessageBox.java   
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;
}
项目:gerrit    文件:RenameFileBox.java   
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));
}
项目:appformer    文件:JSSplashScreenActivity.java   
@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();
        }
    });
}
项目:appformer    文件:UberfireColumnPicker.java   
public Button createToggleButton() {
    final Button button = GWT.create(Button.class);
    button.addStyleName(UFTableResources.INSTANCE.CSS().columnPickerButton());
    button.setDataToggle(Toggle.BUTTON);
    button.setIcon(IconType.LIST_UL);
    button.setTitle(CommonConstants.INSTANCE.ColumnPickerButtonTooltip());

    popup.addStyleName(UFTableResources.INSTANCE.CSS().columnPickerPopup());
    popup.addAutoHidePartner(button.getElement());
    popup.addCloseHandler(new CloseHandler<PopupPanel>() {
        public void onClose(CloseEvent<PopupPanel> popupPanelCloseEvent) {
            if (popupPanelCloseEvent.isAutoClosed()) {
                button.setActive(false);
            }
        }
    });

    button.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            if (!button.isActive()) {
                showColumnPickerPopup(button.getAbsoluteLeft() + button.getOffsetWidth(),
                                      button.getAbsoluteTop() + button.getOffsetHeight());
            } else {
                popup.hide(false);
            }
        }
    });
    return button;
}
项目:appformer    文件:AbstractPopupActivity.java   
@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();
}
项目:google-apis-explorer    文件:AuthView.java   
public AuthView(AuthManager authManager, ApiService service, AnalyticsManager analytics) {
  initWidget(uiBinder.createAndBindUi(this));

  this.presenter = new AuthPresenter(service, authManager, analytics, this);

  serviceName.setText(service.displayTitle());

  // Unless you show then hide popup windows they do not initialize properly.
  scopePopup.show();
  scopePopup.hide();

  scopeInfoPopup.show();
  scopeInfoPopup.hide();

  scopeInfoPopup.addCloseHandler(new CloseHandler<PopupPanel>() {
    @Override
    public void onClose(CloseEvent<PopupPanel> event) {
      GWT.log("Handler for closing popup.");
      clickedToDiscloseScopeInfo = false;
    }
  });
}
项目:solr-explorer    文件:DIHDialog.java   
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);
}
项目:Wiab.pro    文件:Popup.java   
/**
 * 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();
        }
      });
}
项目:x-cure-chat    文件:SendChatMessageDialogUI.java   
/**
 * 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( );
}
项目:che    文件:QuickOpenViewImpl.java   
@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());
        }
      });
}
项目:gerrit    文件:GlobalKey.java   
private static void initDialog() {
  if (restoreGlobal == null) {
    restoreGlobal =
        new CloseHandler<PopupPanel>() {
          @Override
          public void onClose(CloseEvent<PopupPanel> event) {
            active = global;
          }
        };
  }
}
项目:gerrit    文件:RenameFileAction.java   
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;
}
项目:gerrit    文件:AddFileAction.java   
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;
}
项目:gerrit    文件:ReplyAction.java   
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;
}
项目:gerrit    文件:DeleteFileAction.java   
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;
}
项目:umlet    文件:MySuggestionDisplay.java   
@Override
protected PopupPanel createPopup() {
    PopupPanel p = super.createPopup();
    p.addCloseHandler(new CloseHandler<PopupPanel>() {
        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
            popupHideTimer.schedule(400);
        }
    });
    return p;
}
项目:appformer    文件:AbstractSplashScreenActivity.java   
@PostConstruct
private void initialize() {
    this.splashFilter = getFilter();
    splash.addCloseHandler(new CloseHandler<SplashView>() {
        @Override
        public void onClose(final CloseEvent<SplashView> event) {
            AbstractSplashScreenActivity.this.onClose();
        }
    });
}
项目:appformer    文件:AbstractPopupActivityTest.java   
@Before
@SuppressWarnings("unchecked")
public void setup() {
    when(popupView.addCloseHandler(any(CloseHandler.class))).thenAnswer(new Answer<HandlerRegistration>() {
        @Override
        public HandlerRegistration answer(InvocationOnMock invocation) throws Throwable {
            registeredCloseHandler = (CloseHandler<PopupView>) invocation.getArguments()[0];
            closeHandlerRegistration = mock(HandlerRegistration.class);
            return closeHandlerRegistration;
        }
    });
    popupActivity = new TestingPopupActivity(placeManager,
                                             popupView);
    popupPlace = new DefaultPlaceRequest("PopupPlace");
}
项目:platypus-js    文件:WindowPopupPanel.java   
protected final void initPopup() {
    setGlassEnabled(isModal());
    // clearPopupDecorations
    getElement().getStyle().setBorderWidth(0, Style.Unit.PX);
    getElement().getStyle().setMargin(0, Style.Unit.PX);
    getElement().getStyle().setPadding(0, Style.Unit.PX);
    // close event re-fire
    addCloseHandler(new CloseHandler<PopupPanel>() {

        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
            ClosedEvent.<WindowUI>fire(window, window);
        }
    });
}
项目:qafe-platform    文件:MainFactory.java   
public static void createWindowWithUrl(String title, String url, int width, int height, boolean resizable, boolean centered, int top, int left, boolean modal) {
    Frame frame = new Frame(url);
    DOM.setStyleAttribute(frame.getElement(), "border", "none");

    if (ClientApplicationContext.getInstance().isMDI()) {
        final WindowPanel sized = new WindowPanel(title);
        sized.addCloseHandler(new CloseHandler<PopupPanel>() {
            public void onClose(CloseEvent<PopupPanel> event) {
                if (ClientApplicationContext.getInstance().internalWindowCount > 0) {
                    ClientApplicationContext.getInstance().internalWindowCount--;
                }
            }
        });
        sized.setResizable(resizable);

        sized.setAnimationEnabled(true);
        sized.setSize("" + width + "px", "" + height + "px");
        sized.setModal(modal);
        sized.setWidget(frame);
        if (centered) {
            sized.center();
        } else if (top > 0 && left > 0) {
            sized.setPopupPosition(left, top);
            sized.show();
        } else {
            sized.show();
        }
    } else {
    //  ExtendedWindow.resizeTo(width, height);
        WindowFactory.setWidgetToMainPanel(frame, null);
    }

}
项目:avro-ui    文件:ActionsButtonCell.java   
private void showPopup(final Context context, final Element parent,
        final T value, final ValueUpdater<T> valueUpdater) {

    currentValue = value;

    actionsPopup.getElement().getStyle().setZIndex(2000);

    actionsPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
        public void setPosition(int offsetWidth, int offsetHeight) {
            int left = parent.getFirstChildElement().getAbsoluteLeft();
            int top = parent.getFirstChildElement().getAbsoluteTop()
                    + parent.getFirstChildElement().getOffsetHeight() + 2;

            if (left + actionsPopup.getOffsetWidth() > Window
                    .getClientWidth()) {
                left = parent.getFirstChildElement().getAbsoluteRight()
                        - actionsPopup.getOffsetWidth();
            }

            actionsPopup.setPopupPosition(left, top);
        }
    });
    if (popupCloseHandlerRegistration != null) {
        popupCloseHandlerRegistration.removeHandler();
    }
    popupCloseHandlerRegistration = actionsPopup
            .addCloseHandler(new CloseHandler<PopupPanel>() {
                @Override
                public void onClose(CloseEvent<PopupPanel> event) {
                    setViewData(context.getKey(), false);
                    setValue(context, parent, value);
                }
            });

}
项目:kaa    文件:MessageDialog.java   
/**
 * Instantiates a new MessageDialog.
 */
public MessageDialog(Listener listener, AlertPanel.Type type, String title, String message) {
  super(false, true);
  setTitle(title);
  this.listener = listener;

  VerticalPanel dialogContents = new VerticalPanel();
  dialogContents.setSpacing(4);
  setWidget(dialogContents);

  AlertPanel messageLabel = new AlertPanel(type);
  messageLabel.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE_WRAP);
  messageLabel.getElement().getStyle().setProperty("maxHeight", "400px");
  messageLabel.getElement().getStyle()
      .setProperty("maxWidth", Window.getClientWidth() * 2 / 3 + "px");
  messageLabel.getElement().getStyle().setOverflowY(Overflow.AUTO);
  messageLabel.setMessage(message);
  dialogContents.add(messageLabel);

  okButton = new Button(Utils.constants.ok(), new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      hide();
    }
  });

  addButton(okButton);

  this.addCloseHandler(new CloseHandler<PopupPanel>() {
    @Override
    public void onClose(CloseEvent<PopupPanel> event) {
      if (MessageDialog.this.listener != null) {
        MessageDialog.this.listener.onOk();
      }
    }
  });
}
项目:geomajas-project-client-gwt2    文件:GeocoderWidgetAlternativesViewImpl.java   
public GeocoderWidgetAlternativesViewImpl(GeocoderWidgetResource resource) {
    this.resource = resource;
    resource.css().ensureInjected();
    UIBINDER.createAndBindUi(this);
    popup.setAutoHideEnabled(true);
    popup.addCloseHandler(new CloseHandler<PopupPanel>() {

        public void onClose(CloseEvent<PopupPanel> event) {
            alternativesPresenter.onAlternativesViewClosed();
        }
    });
}
项目:incubator-wave    文件:Popup.java   
/**
 * 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();
    }
  });
}
项目:solr-explorer    文件:MainPane.java   
@Initializer
public void init() {

    drawers = new DrawerLayout();

    drawers.setContent(resultsPane);
    resultsPane.setSize("100%", "100%");

    final ToggleToolButton debugButton = new ToggleToolButton(SolrExplorerImages.Instance.get().monitorIcon().createImage());
    statusBarPane.setHeight("100%");
    statusBarPane.addButton(debugButton);
    debugButton.addChangeHandler(new ChangeHandler() {
        public void onChange(ChangeEvent event) {
            if (debugButton.isDown()) {
                drawers.showDrawer("console");
            } else {
                drawers.hideDrawer(DrawerLayout.Position.BOTTOM);
            }
        }
    });

    consolePane.setSize("100%", "100%");
    consolePane.addCloseHandler(new CloseHandler() {
        public void onClose(CloseEvent closeEvent) {
            debugButton.toggle();
        }
    });

    main.addNorth(searchPane, 100);
    searchPane.setSize("100%", "100%");
    main.addSouth(statusBarPane, 25);
    main.add(drawers);
}
项目:gwt-dynamic-plugins    文件:WrapPanel.java   
private static void hookWindowClosing() {
    Impl.scheduleDispose(new Disposable() {
        @Override
        public void dispose() {
            detachWidgets();
        }
    });
    // Catch the window closing event.
    Window.addCloseHandler(new CloseHandler<Window>() {
        @Override
        public void onClose(CloseEvent<Window> closeEvent) {
            detachWidgets();
        }
    });
}
项目:x-cure-chat    文件:ViewUserProfileDialogUI.java   
/**
 * The main constructor
 * @param userID the id of the user we want to browse profile for
 * @param userLoginName the login name of the user we want to browse profile for
 * @param parentDialog the dialog we opn this dialog from
 * @param onSendMsgClose close this dialog if some one presses the send message link
 */
public ViewUserProfileDialogUI(final int userID, final String userLoginName,
                                final DialogBox parentDialog, final boolean onSendMsgClose ) {
    //No autohide, and the dialog is modal
    super( false, true, true, parentDialog );

    this.onSendMsgClose = onSendMsgClose;
    //Initialize the user files view
    this.userFilesView = new UserProfileFilesView( this, null );

    //In case we were searching for friends it's better
    //if we update the parent's search dialog page on exit. 
    if( ( parentDialog != null ) && ( parentDialog instanceof PagedActionGridDialog<?> ) ){
        this.addCloseHandler( new CloseHandler<PopupPanel>(){
            public void onClose( CloseEvent<PopupPanel> e ) {
                if( e.getTarget() == thisDialog ) {
                    ((PagedActionGridDialog<?>) parentDialog).updateActualData();
                }
            }
        } );
    }

    //Save the user ID and user Login Name
    this.userID = userID;
    this.userLoginName = userLoginName;
    this.friendManager = new AddRemoveFriendManager( userID );

    //Set the dialog's caption.
    setText( titlesI18N.viewUserProfileDialogTitle() );

    //Set a style name so we can style it with CSS.
    this.setStyleName(CommonResourcesContainer.USER_DIALOG_STYLE_NAME);

    //Enable the action buttons and hot key, even though we will not be adding these buttons
    //to the grid, we will use the hot keys associated with them to close this dialog
    setLeftEnabled( true );
    setRightEnabled( true );

    //Fill dialog with data
    populateDialog();

    //Get the current MainUserData object from the server
    retrieveUserData();
}
项目:x-cure-chat    文件:ViewMessageDialogUI.java   
/**
 * The constructor that has to be used when we view a message of a particular user 
 * @param autoHide true for autohide
 * @param modal true for a modal dialog
 * @param parentDialog the parent dialog, i.e. the one we open this dialog from
 * @param shortMessageData the short message data needed to initialize the dialog
 * @param roomsManager the instance of the rooms manager 
 */
public ViewMessageDialogUI(final boolean autoHide, final boolean modal, final DialogBox parentDialog,
                            final ShortPrivateMessageData shortMessageData, final RoomsManagerUI roomsManager ) {
    super( false, autoHide, modal, parentDialog );

    //Store the rooms manager
    this.roomsManager = roomsManager;

    //Set the message short data, and initialize markers
    this.shortMessageData = shortMessageData;
    isSimpleMessage = (shortMessageData.getMessageType() == ShortPrivateMessageData.SIMPLE_MESSAGE_TYPE) ||
                      (shortMessageData.getMessageType() == ShortPrivateMessageData.FORUM_REPLY_NOTIFICATION_MESSAGE_TYPE );
    isRoomAccessRequestMessage = (shortMessageData.getMessageType() == ShortPrivateMessageData.ROOM_ACCESS_REQUEST_MESSAGE_TYPE);
    isRoomAccessGrantedMessage = (shortMessageData.getMessageType() == ShortPrivateMessageData.ROOM_ACCESS_GRANTED_MESSAGE_TYPE);
    isRoomAccessMessage = isRoomAccessRequestMessage || isRoomAccessGrantedMessage;
    isSentByThisUser = ( shortMessageData.getFromUID() == SiteManager.getUserID() );

    //Set title and style
    if( isSimpleMessage ) {
        if( isSentByThisUser ) {
            this.setText(titlesI18N.viewSimplePersonalMessageOutDialogTitle() );
        } else {
            this.setText(titlesI18N.viewSimplePersonalMessageInDialogTitle() );
        }
    } else {
        if( isRoomAccessRequestMessage ) {
            if( isSentByThisUser ) {
                this.setText(titlesI18N.viewRoomAccessRequestOutDialogTitle() );
            } else {
                this.setText(titlesI18N.viewRoomAccessRequestInDialogTitle() );
            }
        } else {
            if( isRoomAccessGrantedMessage ) {
                this.setText(titlesI18N.viewRoomAccessNotificationDialogTitle() );
            }
        }
    }
    this.setStyleName( CommonResourcesContainer.USER_DIALOG_STYLE_NAME );

    //Update the parent dialog if it is an paged action grid dialog.
    //There ase several possible cases when the list of messages in the 
    //parent MessagesManagerDialogUI has to be updated, but instead of 
    //considering all of them in separate we just update the dialog on exit.
    this.addCloseHandler( new CloseHandler<PopupPanel>(){
        public void onClose(CloseEvent<PopupPanel> e) {
            if( ( e.getTarget() == thisDialog ) && ( parentDialog != null ) &&
                ( parentDialog instanceof PagedActionGridDialog<?> ) ) {
                ( (PagedActionGridDialog<?>) parentDialog).updateActualData();
            }
        }
    } );

    //Fill dialog with data
    populateDialog();

    //Load message body from the server
    loadMessageBody();
}
项目:wte4j    文件:TemplateListPanel.java   
@Override
public void addContextMenuCloseHandler(CloseHandler<PopupPanel> handler) {
    contextPanel.addCloseHandler(handler);
}
项目:gwt-material    文件:MaterialChip.java   
@Override
public HandlerRegistration addCloseHandler(CloseHandler closeHandler) {
    return addHandler(closeHandler, CloseEvent.getType());
}
项目:r01fb    文件:TreeView.java   
@Override
public HandlerRegistration addCloseHandler(final CloseHandler<TreeViewItem> handler) {
    return this.addHandler(handler,
                           CloseEvent.getType());
}
项目:firefly    文件:PopupPane.java   
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());
        }
    });
}
项目:firefly    文件:PopupPane.java   
public HandlerRegistration addCloseHandler(CloseHandler<PopupPane> h) {
    return hMan.addHandler(CloseEvent.getType(),h);
}
项目:firefly    文件:TableGroupPreviewCombo.java   
public TableGroupPreviewCombo(Layout tableLO, Layout previewLO, PreviewTabPane preview) {

        mainPanel = new SplitLayoutPanelFirefly();
        mainPanel.setMinCenterSize(30,30);
        this.initWidget(mainPanel);

        tabPane = new TabPane<Widget>();

        this.preview = preview;
        this.setSize("100%", "100%");
        if (preview != null) {
//            previewTitlePanel = new TitlePanel("Put the title here",preview);
            previewWrapper = new ResizablePanel(preview);
//            preview.setSize("100%", "100%");

            addWidget(previewLO, previewWrapper, 400);
        }

//        tableTitlePanel = new TitlePanel("Put the title here",tabPane);

        tabPane.setSize("100%", "100%");

        tableWrapper = new ResizablePanel(tabPane);
//        tableWrapper.setSize("100%", "100%");
        addWidget(tableLO, tableWrapper, 400);

//        if (preview != null) {
//            setScrollMode(previewWrapper, "visible");
//        }
//        setScrollMode(sp, "hidden");

        tabPane.getEventManager().addListener(TabPane.TAB_REMOVED, new WebEventListener(){
                public void eventNotify(WebEvent ev) {
                    TabPane.Tab<SelectableTablePanel> tab = (TabPane.Tab<SelectableTablePanel>) ev.getData();
                    if (tab.isRemovable()) {
                        TableGroupPreviewCombo.this.preview.unBind(tab.getContent());
                    }
                }
            });

        newTableListener = new WebEventListener(){
                    public void eventNotify(WebEvent ev) {
                        NewTableResults tableInfo = (NewTableResults) ev.getData();
                        if (tableInfo != null && tableInfo.getConfig() != null) {
                            final TableConfig conf = tableInfo.getConfig();

                            final TablePanel table = addTable(conf.getTitle(), conf.getLoader(), true);
                            table.init(new AsyncCallback<Integer>(){
                                public void onFailure(Throwable caught) {}
                                public void onSuccess(Integer result) {
                                    tabPane.selectTab(tabPane.getTab(table.getName()));
                                    DownloadSelectionIF downloadIF = conf.getDownloadSelectionIF();
                                    if (downloadIF != null) {
                                        TablePrimaryDisplay.createDownloadButton(table, downloadIF, conf.getDownloadRequest());
                                    }
                                }
                            });
                        }
                    }
                };

        WebEventManager.getAppEvManager().addListener(Name.NEW_TABLE_RETRIEVED, newTableListener);
        tabPane.addCloseHandler(new CloseHandler<TabPane>(){
                    public void onClose(CloseEvent<TabPane> tabPaneCloseEvent) {
                        WebEventManager.getAppEvManager().removeListener(Name.NEW_TABLE_RETRIEVED, newTableListener);
                    }
                });

        LayoutSelector loSel = Application.getInstance().getLayoutManager().getLayoutSelector();
        if (preview != null) {
            loSel.setHub(preview.getEventHub());
        }
    }
项目:firefly    文件:TabPane.java   
public HandlerRegistration addCloseHandler(CloseHandler<TabPane> handler) {
    return addHandler(handler, CloseEvent.getType());
}