예제 #1
0
  public void addProjectIcon(Project project) {
    FlowPanel projectPanel = new FlowPanel();

    JsArrayString appStrings = project.getApps();
    String description = "";

    for (int i = 0; i < appStrings.length(); i++) {
      if (i == appStrings.length() - 1) description += appStrings.get(i);
      else description += appStrings.get(i) + ", ";
    }

    final String projectName = project.getName();
    final String appNames = description;

    Image projectImg = new Image(res.projectdefaulticon2().getUrl());
    projectImg.setPixelSize(64, 64);

    projectPanel.add(projectImg);
    projectPanel.add(new Label(projectName));

    final FocusPanel testLabel = new FocusPanel();
    testLabel.add(projectPanel);
    testLabel.setStyleName(style.projectIcon());
    testLabel.addMouseOverHandler(
        new MouseOverHandler() {
          public void onMouseOver(MouseOverEvent event) {
            testLabel.setStyleName(style.projectIconActive());
            desc.show();
            desc.setPopupPosition(
                testLabel.getAbsoluteLeft() + testLabel.getOffsetWidth(),
                testLabel.getAbsoluteTop() - 5);
            desc.setTitle("Applications");
            desc.setText(appNames);
          }
        });
    testLabel.addMouseOutHandler(
        new MouseOutHandler() {
          public void onMouseOut(MouseOutEvent event) {
            testLabel.setStyleName(style.projectIcon());
            desc.hide();
          }
        });
    testLabel.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            testLabel.setStyleName(style.projectIcon());
            eventBus.fireEvent(
                new PanelTransitionEvent(
                    PanelTransitionEvent.TransitionTypes.DASHBOARD, projectName));
          }
        });

    projectIconsFlowPanel.add(testLabel);
    iconMap.put(project.getName(), projectIconsFlowPanel.getWidgetIndex(testLabel));
  }
예제 #2
0
파일: Table.java 프로젝트: dematey/ephesoft
  public Table(
      int totalCount,
      TableHeader header,
      boolean requireRadioButton,
      boolean fireEventForFirstRow,
      final DoubleClickListner doubleClickListner) {
    super();
    initWidget(BINDER.createAndBindUi(this));
    this.totalCount = totalCount;
    this.fireEventForFirstRow = fireEventForFirstRow;
    tableData = new TableData();
    tableData.setHeader(header);
    this.requireRadioButton = requireRadioButton;
    navBar = new NavBar(this);
    mouseOn = false;
    if (doubleClickListner != null && totalCount != 0) {
      focusPanel.addMouseOutHandler(
          new MouseOutHandler() {

            @Override
            public void onMouseOut(MouseOutEvent arg0) {
              mouseOn = false;
            }
          });

      focusPanel.addMouseOverHandler(
          new MouseOverHandler() {

            @Override
            public void onMouseOver(MouseOverEvent arg0) {
              mouseOn = true;
            }
          });

      addDoubleClickHandler(
          new DoubleClickHandler() {

            @Override
            public void onDoubleClick(DoubleClickEvent arg0) {
              if (mouseOn) {
                doubleClickListner.onDoubleClickTable();
              }
            }
          });
    }
  }
예제 #3
0
  @Inject
  public EditFolderView() {
    this.res = ShelfCBundle.INSTANCE;
    folderDescription =
        new FolderEditableTextAreaUc() {
          @Override
          public void onEditDisabled(String text) {
            descriptionAlertMessageLbl.addStyleName("titleAlertMessageDeActive");
            descriptionAlertMessageLbl.removeStyleName("titleAlertMessageActive");
            editFolderDescSaveButton.getElement().getStyle().setDisplay(Display.NONE);
            editFolderDescSaveButtonCancel.getElement().getStyle().setDisplay(Display.NONE);
            collectionDo.setGoals(text);
            getUiHandlers().updateCollectionInfo(collectionDo.getGooruOid(), null, text);
          }

          @Override
          public void checkCharacterLimit(String text) {
            if (text.length() >= 415) {
              descriptionAlertMessageLbl.addStyleName("titleAlertMessageActive");
              descriptionAlertMessageLbl.removeStyleName("titleAlertMessageDeActive");
            } else {
              descriptionAlertMessageLbl.addStyleName("titleAlertMessageDeActive");
              descriptionAlertMessageLbl.removeStyleName("titleAlertMessageActive");
            }
          }
        };

    folderTitle =
        new FolderEditableLabelUc() {
          @Override
          public void onEditDisabled(String text) {
            titleAlertMessageLbl.addStyleName("titleAlertMessageDeActive");
            titleAlertMessageLbl.removeStyleName("titleAlertMessageActive");
            collectionDo.setTitle(text);
            editFolderSaveButton.getElement().getStyle().setDisplay(Display.NONE);
            editFolderSaveButtonCancel.getElement().getStyle().setDisplay(Display.NONE);
            getUiHandlers().updateCollectionInfo(collectionDo.getGooruOid(), text, null);
          }

          @Override
          public void checkCharacterLimit(String text) {
            if (text.length() >= 50) {
              titleAlertMessageLbl.addStyleName("titleAlertMessageActive");
              titleAlertMessageLbl.removeStyleName("titleAlertMessageDeActive");
            } else {
              titleAlertMessageLbl.addStyleName("titleAlertMessageDeActive");
              titleAlertMessageLbl.removeStyleName("titleAlertMessageActive");
            }
          }
        };
    FolderCBundle.INSTANCE.css().ensureInjected();
    res.css().ensureInjected();
    setWidget(uiBinder.createAndBindUi(this));

    simplePencilFocPanel.addMouseOverHandler(new hideEditPencil());
    simplePencilFocPanel.addMouseOutHandler(new showEditPencil());
    collectionEditImageLbl.addClickHandler(new OnEditImageClick());
    editFolderTitle.addClickHandler(new OnEditImageClick());

    editFolderSaveButton.getElement().getStyle().setDisplay(Display.NONE);
    editFolderSaveButtonCancel.getElement().getStyle().setDisplay(Display.NONE);
    editFolderDescSaveButton.getElement().getStyle().setDisplay(Display.NONE);
    editFolderDescSaveButtonCancel.getElement().getStyle().setDisplay(Display.NONE);
    simplePencilPanel.getElement().getStyle().setDisplay(Display.NONE);
    backToSearchFloPanel.getElement().getStyle().setDisplay(Display.NONE);

    collectionDescriptionTitleContainer.addMouseOverHandler(new OnCollectionDescriptionClick());
    collectionDescriptionTitleContainer.addMouseOutHandler(new OnCollectionDescriptionOut());
    simplePencilPanel.addClickHandler(new OpenCollectionEditDescription());
    editFolderDesc.addClickHandler(new OpenCollectionEditDescription());

    myFolderRightContainer.addMouseOverHandler(new ActionPanelHover());
    myFolderRightContainer.addMouseOutHandler(new ActionPanelOut());

    folderDeleteLabel.setVisible(false);
    infoTabVc.addClickHandler(this);
    contentTabVc.addClickHandler(this);
    backToSearchHtml.addClickHandler(new BackToSearchHtmlClick());
    collectionEditImageLbl.setVisible(false);
  }