Package opus.gwt.management.console.client.overlays

Examples of opus.gwt.management.console.client.overlays.Project


  }

  public void handleProjectInformation(String projectName){
    applicationsFlowPanel.clear();
   
    final Project project = clientFactory.getProjects().get(projectName);
    HashMap<String, Application> applicationsMap = clientFactory.getApplications();
    JsArrayString applicationsArray = project.getApps();
    active = project.isActive();
   
    if(active) {
      activeButton.setText("Deactivate project");
    } else {
      activeButton.setText("Activate project");
    }
   
    for(int i = 0; i < applicationsArray.length() - 1; i++) {
     
      final Application app = applicationsMap.get(applicationsArray.get(i));
      final FlowPanel application = new FlowPanel();
      final FocusPanel applicationLabel = new FocusPanel();
     
      final Label appName = new Label(app.getName());
      final Label httpLabel = new Label("HTTP");
      final Label httpsLabel = new Label("HTTPS");
      final Label settingsLabel = new Label("Settings");
     
      Image appIcon = new Image();
     
      if(app.getIconURL().split("//").length < 2) {
        appIcon = new Image(JSVarHandler.getCommunityBaseURL() + app.getIconURL());
      } else {
        appIcon = new Image(app.getIconURL());
      }
     
      appIcon.setSize("64px", "64px");
     
      application.add(appIcon);
      application.add(appName);
      application.add(httpLabel);
      application.add(httpsLabel);
      application.add(settingsLabel);
      application.setStyleName(manager.appIcon());
     
      applicationLabel.add(application);

      applicationLabel.addMouseOverHandler(new MouseOverHandler() {
        public void onMouseOver(MouseOverEvent event){
          if(project.isActive()) {
            applicationLabel.setStyleName(manager.appIconActive());
            appName.addStyleName(manager.text());
            httpLabel.addStyleName(manager.link());
            httpsLabel.addStyleName(manager.link());
            settingsLabel.addStyleName(manager.link());
          }
        }
      });
      applicationLabel.addMouseOutHandler(new MouseOutHandler() {
        public void onMouseOut(MouseOutEvent event){
          applicationLabel.setStyleName(manager.appIcon());
          appName.removeStyleName(manager.text());
          httpLabel.removeStyleName(manager.link());
          httpsLabel.removeStyleName(manager.link());
          settingsLabel.removeStyleName(manager.link());
        }
      });
     
      httpLabel.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
          if(project.isActive()) {
            Window.Location.assign(project.getURLS().get(0) + app.getAppName());
          }
        }
      });
     
      httpsLabel.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
          if(project.isActive()) {
            Window.Location.assign(project.getURLS().get(1) + app.getAppName());
          }
        }
      });
     
      settingsLabel.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
          if(project.isActive()) {
            eventBus.fireEvent(new PanelTransitionEvent(PanelTransitionEvent.TransitionTypes.SETTINGS, app.getAppName()));
          }
        }
      });
     
View Full Code Here


    processProjects();
  }
 
  private void processProjects() {
    for(int i = 0; i < projectsArray.length(); i++) {
      Project proj = projectsArray.get(i);
      projectsMap.put(proj.getName(), proj);
    }
  }
View Full Code Here

TOP

Related Classes of opus.gwt.management.console.client.overlays.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.