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

项目:ephesoft    文件:DocumentTree.java   
/**
 * @param docBean
 * @param docTitleLabel
 * @param docType
 * @param icon
 * @param docItem
 */
private void addDocDisplayItemsAndHandlers(final Document docBean, Label docTitleLabel, Label docType, Label icon,
        final TreeItem docItem) {
    String docDisplayProperty = getDocDisplayProperty(docBean, presenter.batchDTO.getDocDisplayName());
    DocumentTreeItem documentTreeItem = new DocumentTreeItem(docItem, docBean, icon, docDisplayProperty);
    addDocTreeItem(documentTreeItem);

    docItem.setTitle(documentTreeItem.documentTitle);
    docTitleLabel.setText(documentTreeItem.documentTitle);
    docType.setText(documentTreeItem.displayName);
    docTitleLabel.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            if (docItem.getState()) {
                docItem.setState(Boolean.FALSE);
            } else {
                OpenEvent.fire(docTree, docItem);
            }
        }
    });
}
项目:kie-docker-ci    文件:ImagesView.java   
@Override
public void onOpen(final OpenEvent<Appointment> event) {
    showLoadingView();
    final Appointment appt = event.getTarget();
    final String imageId = appt.getId();
    dockerService.getImage(imageId, new AsyncCallback<KieImage>() {
        @Override
        public void onFailure(final Throwable caught) {
            showError(caught);
        }

        @Override
        public void onSuccess(final KieImage result) {
            if (result != null) {
                final List<KieImage> list = new ArrayList<KieImage>(1);
                list.add(result);
                imagesProvider.setList(list);
                redrawTable();
                showAllImagesPanel();
            } else {
                showError(Constants.INSTANCE.notAvailable());
            }
            hideLoadingView();
        }
    });
}
项目:gwt-traction    文件:TractionDialogBox.java   
/**
    * Overrides show to call {@link #adjustGlassSize()} if the dialog
    * is already showing and fires an {@link OpenEvent} after the
    * normal show.
    */
   @Override
   public void show() {
boolean fireOpen = !isShowing();
super.show();

// adjust the size of the glass
if (isShowing()) {
    adjustGlassSize();
}

// fire the open event
if (fireOpen) {
    OpenEvent.fire(this, this);
}
   }
项目:QMAClone    文件:PanelThreadList.java   
public void onSuccess(List<PacketBbsThread> result) {
    for (final PacketBbsThread thread : result) {
        final LazyPanel lazyPanel = new LazyPanel() {
            @Override
            protected Widget createWidget() {
                DecoratorPanel decoratorPanel = new DecoratorPanel();
                decoratorPanel.setWidget(new PanelThread((int) thread.id, thread.title));
                return decoratorPanel;
            }
        };

        OpenHandler<DisclosurePanel> openHandler = new OpenHandler<DisclosurePanel>() {
            @Override
            public void onOpen(OpenEvent<DisclosurePanel> event) {
                lazyPanel.ensureWidget();
            }
        };

        DisclosurePanel disclosurePanel = new DisclosurePanel(thread.title);
        disclosurePanel.setContent(lazyPanel);
        disclosurePanel.addOpenHandler(openHandler);
        add(disclosurePanel);
    }
}
项目:unitimes    文件:CurriculaCourses.java   
public void addBlankLine() {
    List<Widget> line = new ArrayList<Widget>();

    HorizontalPanel hp = new HorizontalPanel();
    line.add(hp);

    CurriculaCourseSelectionBox cx = new CurriculaCourseSelectionBox();
    cx.setWidth("130px");
    cx.addCourseSelectionHandler(iCourseChangedHandler);
    if (cx.getCourseFinder() instanceof HasOpenHandlers)
        ((HasOpenHandlers<PopupPanel>)cx.getCourseFinder()).addOpenHandler(new OpenHandler<PopupPanel>() {
            @Override
            public void onOpen(OpenEvent<PopupPanel> event) {
                iTable.clearHover();
            }
        });
    if (!iEditable) cx.setEnabled(false);
    line.add(cx);

    for (int col = 0; col < iClassifications.getClassifications().size(); col++) {
        ShareTextBox ex = new ShareTextBox(col, null, null);
        if (!iEditable) ex.setReadOnly(true);
        line.add(ex);
        EnrollmentLabel note = new EnrollmentLabel(col, null, null, null, null, null, null);
        line.add(note);
    }

    int row = iTable.addRow("", line);
    iTable.getRowFormatter().addStyleName(row, "unitime-NoPrint");
    if (iVisibleCourses != null) iTable.getRowFormatter().setVisible(row, false);
    for (int col = 0; col < line.size(); col++)
        if (!iTable.getCellFormatter().isVisible(0, col))
            iTable.getCellFormatter().setVisible(row, col, false);
}
项目:unitimes    文件:UniTimeDialogBox.java   
@Override
public void show() {
    boolean fireOpen = !isShowing();
    super.show();
    if (fireOpen) {
        OpenEvent.fire(this, this);
    }
}
项目:LAS    文件:WindowBox.java   
@Override
public void show() {
    boolean fireOpen = !isShowing();
    super.show();
    if (fireOpen) {
        OpenEvent.fire(this, this);
    }
}
项目:LAS    文件:DatasetWidget.java   
@Override
public void onOpen(OpenEvent<TreeItem> event) {
    TreeItem item = event.getTarget();
    currentlySelected = item;
    if ( item.getChild(0).getText().equals(DatasetWidget.LOADING) ) {
        CategorySerializable cat = (CategorySerializable) item.getUserObject();
        Util.getRPCService().getCategories(cat.getID(), null, categoryCallback);
    }
}
项目:LAS    文件:UI.java   
@Override
public void onOpen(OpenEvent<DisclosurePanel> event) {

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

}
项目:ephesoft    文件:DocumentTree.java   
/**
 * 
 */
private void addDocTreeOpenHandler() {
    docTree.addOpenHandler(new OpenHandler<TreeItem>() {

        @Override
        public void onOpen(OpenEvent<TreeItem> arg0) {
            TreeItem target = arg0.getTarget();
            String title = target.getTitle();
            String text = target.getText();
            presenter.document = getdocTreeItemByTitle(arg0.getTarget().getTitle()).document;
            boolean isAlreadySelected = setDocumentSelected(arg0.getTarget());

            List<Page> pageList = presenter.document.getPages().getPage();
            for (Page page : pageList) {
                String identifier = page.getIdentifier();
                PageImage pageImage = pageImageMap.get(identifier);
                RotatableImage image = pageImage.getImage();
                if (!page.isIsRotated()) {
                    image.setUrl(presenter.batchDTO.getAbsoluteURLFor(page.getThumbnailFileName()), page.getDirection());
                } else {
                    image.setUrl(presenter.batchDTO.getAbsoluteURLForRotatedImage(page.getThumbnailFileName(), page.getDirection()
                            .toString()), page.getDirection());
                }
            }

            presenter.page = presenter.document.getPages().getPage().get(0);

            setPageSelected(getPageImageById(presenter.page.getIdentifier()).image, false);
            int itemCount = presenter.getView().getRvPanel().getReviewPanel().documentTypes.getItemCount();
            if (target.getChildCount() > 0 && !(title.isEmpty() && text.isEmpty())) {
                scrollIntoView(target.getElement());
            }
            if (!isAlreadySelected || itemCount == 0) {
                DocumentTree.this.fireEvent(new DocExpandEvent(presenter.document));
            } else {
                DocumentTree.this.fireEvent(new DocExpandEvent(presenter.document, false));
            }
        }
    });
}
项目:r01fb    文件:TreeViewItem.java   
void _fireExpandOrCollapseEvent(final boolean expand) {
    if (_tree != null) {
        if (expand) {
            OpenEvent.fire(_tree,this);
            TreeViewItemExpandEvent.fire(_tree,this);
        } else {
            CloseEvent.fire(_tree,this);
            TreeViewItemCollapseEvent.fire(_tree,this);
        }
    }
}
项目:unitime    文件:CurriculaCourses.java   
public void addBlankLine() {
    List<Widget> line = new ArrayList<Widget>();

    HorizontalPanel hp = new HorizontalPanel();
    line.add(hp);

    CurriculaCourseSelectionBox cx = new CurriculaCourseSelectionBox();
    cx.setWidth("130px");
    cx.addCourseSelectionHandler(iCourseChangedHandler);
    if (cx.getCourseFinder() instanceof HasOpenHandlers)
        ((HasOpenHandlers<PopupPanel>)cx.getCourseFinder()).addOpenHandler(new OpenHandler<PopupPanel>() {
            @Override
            public void onOpen(OpenEvent<PopupPanel> event) {
                iTable.clearHover();
            }
        });
    if (!iEditable) cx.setEnabled(false);
    line.add(cx);

    for (int col = 0; col < iClassifications.getClassifications().size(); col++) {
        ShareTextBox ex = new ShareTextBox(col, null, null);
        if (!iEditable) ex.setReadOnly(true);
        line.add(ex);
        EnrollmentLabel note = new EnrollmentLabel(col, null, null, null, null, null, null);
        line.add(note);
    }

    int row = iTable.addRow("", line);
    iTable.getRowFormatter().addStyleName(row, "unitime-NoPrint");
    if (iVisibleCourses != null) iTable.getRowFormatter().setVisible(row, false);
    for (int col = 0; col < line.size(); col++)
        if (!iTable.getCellFormatter().isVisible(0, col))
            iTable.getCellFormatter().setVisible(row, col, false);
}
项目:unitime    文件:UniTimeDialogBox.java   
@Override
public void show() {
    boolean fireOpen = !isShowing();
    super.show();
    if (fireOpen) {
        OpenEvent.fire(this, this);
    }
}
项目:appformer    文件:Tree.java   
void fireStateChanged(final T item,
                      final T.State state) {
    if (state.equals(T.State.OPEN)) {
        OpenEvent.fire(this,
                       item);
    } else {
        CloseEvent.fire(this,
                        item);
    }
    onSelection(item,
                true);
}
项目:appformer    文件:LazyStackPanelHeader.java   
private void onTitleClicked() {
    if (expanded) {
        CloseEvent.fire(this,
                        this);
    } else {
        OpenEvent.fire(this,
                       this);
    }
}
项目:socom    文件:UserAdministrationView.java   
@UiHandler("tree")
void onTreeOpen(OpenEvent<TreeItem> event) {
    TreeItem item = event.getTarget();
    if(item.getText().length() > 1) return; // search field hack
    String first = item.getText();
    presenter.loadUsers(first, item);
}
项目:unitimes    文件:UniTimeDialogBox.java   
public HandlerRegistration addOpenHandler(OpenHandler<UniTimeDialogBox> handler) {
    return addHandler(handler, OpenEvent.getType());
}
项目:LAS    文件:WindowBox.java   
@Override
public HandlerRegistration addOpenHandler(OpenHandler<WindowBox> handler) {
    return addHandler(handler, OpenEvent.getType());
}
项目:aggregate    文件:RefreshOpenHandler.java   
@Override
public void onOpen(OpenEvent<T> event) {
    AggregateUI.resize();
}
项目:r01fb    文件:TreeView.java   
@Override
public final HandlerRegistration addOpenHandler(final OpenHandler<TreeViewItem> handler) {
    return this.addHandler(handler,
                           OpenEvent.getType());
}
项目:unitime    文件:UniTimeDialogBox.java   
public HandlerRegistration addOpenHandler(OpenHandler<UniTimeDialogBox> handler) {
    return addHandler(handler, OpenEvent.getType());
}
项目:appformer    文件:Tree.java   
@Override
public HandlerRegistration addOpenHandler(final OpenHandler<T> handler) {
    return addHandler(handler,
                      OpenEvent.getType());
}
项目:appformer    文件:AbstractLazyStackPanelHeader.java   
public HandlerRegistration addOpenHandler(OpenHandler<AbstractLazyStackPanelHeader> handler) {
    return addHandler(handler,
                      OpenEvent.getType());
}
项目:platypus-js    文件:WindowPanel.java   
@Override
protected void onAttach() {
    super.onAttach();
    onResize();
    OpenEvent.<WindowUI> fire(this, this);
}
项目:platypus-js    文件:WindowPanel.java   
@Override
public HandlerRegistration addOpenHandler(OpenHandler<WindowUI> handler) {
    return addHandler(handler, OpenEvent.getType());
}
项目:platypus-js    文件:WindowPopupPanel.java   
@Override
public HandlerRegistration addOpenHandler(OpenHandler<WindowUI> handler) {
    return window.addHandler(handler, OpenEvent.getType());
}
项目:platypus-js    文件:AutoCloseBox.java   
@Override
public HandlerRegistration addOpenHandler(OpenHandler<AutoCloseBox> handler) {
    return addHandler(handler, OpenEvent.getType());
}
项目:gwt-traction    文件:TractionDialogBox.java   
@Override
   public HandlerRegistration addOpenHandler(OpenHandler<TractionDialogBox> handler) {
return addHandler(handler, OpenEvent.getType());
   }
项目:consulo    文件:CellBrowser.java   
/**
 * Update the state of a child node based on the keyboard selection of the
 * specified {@link BrowserCellList}. This method will open/close child
 * {@link TreeNode}s as needed.
 *
 * @param cellList the CellList that changed state.
 * @param fireEvents true to fireEvents
 * @return the open {@link TreeNode}, or null if not opened
 */
private <C> TreeNode updateChildState(BrowserCellList<C> cellList, boolean fireEvents) {
  /*
   * Verify that the specified list is still in the browser. It possible for
   * the list to receive deferred updates after it has been removed
   */
  if (cellList.isDestroyed) {
    return null;
  }

  // Get the key of the value to open.
  C newValue = cellList.getPresenter().getKeyboardSelectedRowValue();
  Object newKey = cellList.getValueKey(newValue);

  // Close the current open node.
  TreeNode closedNode = null;
  if (cellList.focusedKey != null && cellList.isFocusedOpen
      && !cellList.focusedKey.equals(newKey)) {
    // Get the node to close.
    closedNode =
            (treeNodes.size() > cellList.level + 1) ? treeNodes.get(cellList.level + 1) : null;

    // Close the node.
    trimToLevel(cellList.level);
  }

  // Open the new node.
  TreeNode openNode = null;
  boolean justOpenedNode = false;
  if (newKey != null) {
    if (newKey.equals(cellList.focusedKey)) {
      // The node is already open.
      openNode = cellList.isFocusedOpen ? treeNodes.get(cellList.level + 1) : null;
    } else {
      // Select this value.
      if (KeyboardSelectionPolicy.BOUND_TO_SELECTION == getKeyboardSelectionPolicy()) {
        cellList.setSelectedValue(newValue);
      }

      // Add the child node if this node has children.
      cellList.focusedKey = newKey;
      NodeInfo<?> childNodeInfo = isLeaf(newValue) ? null : getNodeInfo(newValue);
      if (childNodeInfo != null) {
        cellList.isFocusedOpen = true;
        justOpenedNode = true;
        openNode = appendTreeNode(childNodeInfo, newValue);
      }
    }
  }

  /*
   * Fire event. We fire events after updating the view in case user event
   * handlers modify the open state of nodes, which would interrupt the
   * process.
   */
  if (fireEvents) {
    if (closedNode != null) {
      CloseEvent.fire(this, closedNode);
    }
    if (openNode != null && justOpenedNode) {
      OpenEvent.fire(this, openNode);
    }
  }

  // Return the open node if it is still open.
  return (openNode == null || openNode.isDestroyed()) ? null : openNode;
}