Package org.fusesource.ide.fabric8.core.dto

Examples of org.fusesource.ide.fabric8.core.dto.ProfileStatusDTO


  /* (non-Javadoc)
   * @see org.fusesource.ide.commons.ui.form.FormSupport#createTextFields(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected void createTextFields(Composite parent) {
    ProfileDTO profile = node.getProfile();
    String sectionTitle = profile.getId();

    Composite inner = createSectionComposite(sectionTitle, new GridData(GridData.FILL_BOTH));

    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
View Full Code Here


  }

  protected ProfileNode getSelectedProfileNode() {
    Object first = Selections.getFirstSelection(getViewer());
    if (first instanceof ProfileStatusDTO) {
      ProfileStatusDTO status = (ProfileStatusDTO) first;
      String id = status.getProfile();
      VersionNode version = getFabric().getDefaultVersionNode();
      if (version != null) {
        return version.getProfileNode(id);
      }
    }
View Full Code Here

  }

  protected ProfileNode getSelectedProfileNode() {
    Object first = Selections.getFirstSelection(getViewer());
    if (first instanceof ProfileStatusDTO) {
      ProfileStatusDTO status = (ProfileStatusDTO) first;
      String id = status.getProfile();
      VersionNode version = getFabric().getDefaultVersionNode();
      if (version != null) {
        return version.getProfileNode(id);
      }
    }
View Full Code Here

      public void doubleClick(DoubleClickEvent event) {
        FabricNavigator nav = FabricPlugin.getFabricNavigator();
        if (nav != null) {
          Object oSel = Selections.getFirstSelection(event.getSelection());
          if (oSel != null && oSel instanceof ProfileStatusDTO) {
            ProfileStatusDTO s = asProfileStatus(oSel);
            String profileId = s.getProfile();
            ProfileNode profileNode = searchProfile(nav, profileId, getFabric().getVersionsNode());
            if (profileNode != null) nav.selectReveal(new StructuredSelection(profileNode));
          }
        }
      }
View Full Code Here

    int column = 0;

    Function1 function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatusDTO status = asProfileStatus(element);
        if (status != null) {
          return status.getProfile();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Profile");

    function = new FunctionInteger() {
      @Override
      public BigInteger apply(Object element) {
        ProfileStatusDTO status = asProfileStatus(element);
        if (status != null) {
          return status.getCount();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Count");

    function = new FunctionInteger() {
      @Override
      public BigInteger apply(Object element) {
        ProfileStatusDTO status = asProfileStatus(element);
        if (status != null) {
          return status.getMinimumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Minumum");

    function = new FunctionInteger() {
      @Override
      public BigInteger apply(Object element) {
        ProfileStatusDTO status = asProfileStatus(element);
        if (status != null) {
          return status.getMaximumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Maximum");

    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatusDTO status = asProfileStatus(element);
        if (status != null) {
          return toHealth(status);
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Status", new HealthLabelProvider(function));

    function = new Function1() {
      @Override
      public BigDecimal apply(Object element) {
        ProfileStatusDTO status = asProfileStatus(element);
        if (status != null) {
          return status.getHealth(status.getCount());
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Health", new PercentFunctionLabelProvider(function));

    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatusDTO status = asProfileStatus(element);
        if (status != null) {
          return status.getDependentProfiles();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Dependencies");
View Full Code Here

      Object expectedValue) {
   
    if (receiver instanceof ISelection) {
      Object selection = Selections.getFirstSelection((ISelection)receiver);
      if(selection instanceof ProfileStatusDTO){
        ProfileStatusDTO status = (ProfileStatusDTO)selection;
        if(property.equals("requirementsNotEmpty")) {
          return !status.getRequirements().checkIsEmpty();
        }
      }     
    }
         
    return false;
View Full Code Here

            public void doubleClick(DoubleClickEvent event) {
                FabricNavigator nav = FabricPlugin.getFabricNavigator();
                if (nav != null && current != null) {
                    Object oSel = Selections.getFirstSelection(event.getSelection());
                    if (oSel != null && oSel instanceof ProfileStatusDTO) {
                        ProfileStatusDTO s = asProfileStatus(oSel);
                        String profileId = s.getProfile();
                        ProfileNode profileNode = searchProfile(nav, profileId, current.getVersionsNode());
                        if (profileNode != null)
                            nav.selectReveal(new StructuredSelection(profileNode));
                    }
                }
View Full Code Here

        int column = 0;

        Function1 function = new Function1() {
            @Override
            public Object apply(Object element) {
                ProfileStatusDTO status = asProfileStatus(element);
                if (status != null) {
                    return status.getProfile();
                }
                return null;
            }
        };
        column = addColumnFunction(250, column, function, "Profile");

        function = new FunctionInteger() {
            @Override
            public BigInteger apply(Object element) {
                ProfileStatusDTO status = asProfileStatus(element);
                if (status != null) {
                    return status.getCount();
                }
                return null;
            }
        };
        column = addColumnFunction(bounds, column, function, "Count");

        function = new FunctionInteger() {
            @Override
            public BigInteger apply(Object element) {
                ProfileStatusDTO status = asProfileStatus(element);
                if (status != null) {
                    return status.getMinimumInstances();
                }
                return null;
            }
        };
        column = addColumnFunction(bounds, column, function, "Minumum");

        function = new FunctionInteger() {
            @Override
            public BigInteger apply(Object element) {
                ProfileStatusDTO status = asProfileStatus(element);
                if (status != null) {
                    return status.getMaximumInstances();
                }
                return null;
            }
        };
        column = addColumnFunction(bounds, column, function, "Maximum");

        function = new Function1() {
            @Override
            public Object apply(Object element) {
                ProfileStatusDTO status = asProfileStatus(element);
                if (status != null) {
                    return toHealth(status);
                }
                return null;
            }
        };
        column = addColumnFunction(bounds, column, function, "Status", new HealthLabelProvider(function));

        function = new Function1() {
            @Override
            public BigDecimal apply(Object element) {
                ProfileStatusDTO status = asProfileStatus(element);
                if (status != null) {
                    return status.getHealth(status.getCount());
                }
                return null;
            }
        };
        column = addColumnFunction(bounds, column, function, "Health", new PercentFunctionLabelProvider(function));

        function = new Function1() {
            @Override
            public Object apply(Object element) {
                ProfileStatusDTO status = asProfileStatus(element);
                if (status != null) {
                    return status.getDependentProfiles();
                }
                return null;
            }
        };
        column = addColumnFunction(250, column, function, "Dependencies");
View Full Code Here

    }

    protected ProfileNode getSelectedProfileNode() {
        Object first = Selections.getFirstSelection(getViewer());
        if (first instanceof ProfileStatusDTO) {
            ProfileStatusDTO status = (ProfileStatusDTO) first;
            String id = status.getProfile();
            VersionNode version = current == null ? null : current.getDefaultVersionNode();
            if (version != null) {
                return version.getProfileNode(id);
            }
        }
View Full Code Here

  /* (non-Javadoc)
   * @see org.fusesource.ide.fabric8.core.connector.Fabric8ConnectorType#getRequirements()
   */
  @Override
  public RequirementsDTO getRequirements() {
    RequirementsDTO requirements = null;
    try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "requirementsAsJson()");
            J4pExecResponse response = getJolokiaClient().execute(request);
            String json = response.getValue();
      final ModelNode rootNode = JsonHelper.getModelNode(json);
View Full Code Here

TOP

Related Classes of org.fusesource.ide.fabric8.core.dto.ProfileStatusDTO

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.