Change the UI

  • shaice

    shaice - 2007-08-30

    Hi all, I'm here again.
    Now I've finished to calculatethe metrics, and I want to add another column in the view to diplay directly the hints related to the over-maximum metrics. I'm workin' on:

    Metrics Table


    Metrics Plugin

    but I cannot add a column to the metric view. I add:

        private TreeColumn hint;


            hint = new TreeColumn(this, SWT.LEFT);

        String[] hints = plugin.getMetricDescriptions(); //HINT
            String[] cols = new String[] {descriptions[i],"","","","","","",hints[i]};

    so I jsut add a new column with the descriptions again.

    But no luck for me, it runs like no line of code was added.. :-(

    Please help me!!
    Thankyou in advance,


    • shaice

      shaice - 2007-08-30

      Resolved. I didn't refresh the Metrics View.

      I've added this little code to add the hint:

           * return the correct Hint if the metric is our of range
           * @author Francesco Agrusti
          private String setHint(Metric metric, TreeItem row) {
              if (metric == null) {
                  return "";
              } else {
                  MetricDescriptor md = MetricsPlugin.getDefault().getMetricDescriptor(metric.getName());
                  if (md.isValueInRange(metric.doubleValue())){
                      return "";
                  } else {
                      return md.getHint();

      see ya


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks