Ejemplo n.º 1
0
  @Override
  public void close() {
    int dccs = 0;
    for (WindowModel window : windowManager.getChildren(this)) {
      if (window instanceof TransferContainer && ((TransferContainer) window).getDCC().isActive()
          || window instanceof ChatContainer && ((ChatContainer) window).getDCC().isActive()) {
        dccs++;
      }
    }

    if (dccs > 0) {
      new StandardQuestionDialog(
              parentWindow,
              ModalityType.MODELESS,
              "Close confirmation",
              "Closing this window will cause all existing DCCs "
                  + "to terminate, are you sure you want to do this?",
              () -> {
                close();
                plugin.removeContainer();
              })
          .display();
    } else {
      super.close();
      plugin.removeContainer();
    }
  }
Ejemplo n.º 2
0
 /** {@inheritDoc} */
 @Override
 public void linesAdded(final int line, final int length, final int size) {
   for (int i = 0; i < length; i++) {
     DynamicRequestHandler.addEvent(
         new Event(
             "lineadded", new Message(style(parent.getDocument().getStyledLine(line)), this)));
   }
 }
Ejemplo n.º 3
0
  public WebWindow(final WebInterfaceUI controller, final FrameContainer parent) {
    super();

    this.parent = parent;
    this.title = parent.getTitle();

    WINDOWS.put(getId(), this);

    parent.getDocument().addIRCDocumentListener(this);
    parent.addFrameInfoListener(this);

    if (parent.getParent() == null) {
      DynamicRequestHandler.addEvent(new Event("newwindow", this));
    } else {
      DynamicRequestHandler.addEvent(
          new Event(
              "newchildwindow",
              new Object[] {controller.getWindowManager().getWindow(parent.getParent()), this}));
    }
  }
Ejemplo n.º 4
0
  /** Updates the invite label for the currently active server. */
  private void update() {
    if (activeFrame == null) {
      activeServer = null;
    } else {
      activeServer = activeFrame.getServer();
    }
    if (activeServer != null && !inviteList.containsKey(activeServer)) {
      inviteList.add(activeServer, activeServer.getInvites());
      activeServer.addInviteListener(this);
    }

    if (activeServer == null || inviteList.get(activeServer).isEmpty()) {
      setVisible(false);
      closeDialog();
    } else {
      refreshDialog();
      setVisible(true);
    }
  }