Skip to content
Snippets Groups Projects
Commit 3f6d6389 authored by Eddie Groh's avatar Eddie Groh
Browse files

Added simple Metrics View

Issue-Ref: 4310
Issue-Url: af3#4310


Signed-off-by: default avatarEddie Groh <groh@fortiss.org>
parent 402e981e
No related branches found
No related tags found
1 merge request!210Setting up Metric extraction plugin for AF3 : Issue 4310
...@@ -3,5 +3,6 @@ ...@@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="res"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
Manifest-Version: 1.0 Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: org.fortiss.tooling.ext.quality.ui Bundle-Name: %pluginName
Bundle-SymbolicName: org.fortiss.tooling.ext.quality.ui;singleton:=true Bundle-SymbolicName: org.fortiss.tooling.ext.quality.ui;singleton:=true
Bundle-Version: 1.0.0 Bundle-Version: 1.0.0
Automatic-Module-Name: org.fortiss.tooling.ext.quality.ui Automatic-Module-Name: org.fortiss.tooling.ext.quality.ui
......
org.fortiss.tooling.ext.quality.ui/icons/library.png

675 B

...@@ -8,4 +8,14 @@ ...@@ -8,4 +8,14 @@
contributor="org.fortiss.tooling.ext.quality.ui.ModelQualityExtractionMenu"> contributor="org.fortiss.tooling.ext.quality.ui.ModelQualityExtractionMenu">
</contextMenuContribution> </contextMenuContribution>
</extension> </extension>
<extension
point="org.eclipse.ui.views">
<view
class="org.fortiss.tooling.ext.quality.ui.view.fx.MetricsFXViewPart"
icon="icons/library.png"
id="org.fortiss.tooling.ext.quality.ui.metricsView"
name="Metrics"
restorable="true">
</view>
</extension>
</plugin> </plugin>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.TreeTableView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<SplitPane fx:id="metricsSplitPane"
dividerPositions="0.5" maxHeight="1.7976931348623157E308"
maxWidth="1.7976931348623157E308" minHeight="-Infinity"
minWidth="-Infinity" orientation="VERTICAL" prefHeight="400.0"
prefWidth="1035.0" xmlns="http://javafx.com/javafx/13"
xmlns:fx="http://javafx.com/fxml/1">
<items>
<BorderPane maxHeight="-Infinity" minHeight="-Infinity"
prefHeight="25.0" prefWidth="626.0">
<center>
<Label fx:id="topLabel" alignment="CENTER"
contentDisplay="CENTER" prefHeight="51.0" prefWidth="247.0"
textAlignment="CENTER" BorderPane.alignment="CENTER" />
</center>
<left>
<Button fx:id="refreshButton" mnemonicParsing="false"
onAction="#onRefreshMetricsSubmit" text="Refresh Metrics"
BorderPane.alignment="CENTER" />
</left>
</BorderPane>
</items>
</SplitPane>
/*-------------------------------------------------------------------------+
| Copyright 2023 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.ext.quality.ui.view.fx;
/**
* Interface for views displaying the Metrics view
*
* @author groh
*/
public interface IMetricsViewPart {
/** View ID for reuse library views. */
// Keep in sync with plugin.xml
public static String REUSE_LIBRARY_VIEW_ID = "org.fortiss.tooling.ext.quality.ui.metricsView";
}
/*-------------------------------------------------------------------------+
| Copyright 2023 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.ext.quality.ui.view.fx;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import org.fortiss.tooling.common.ui.javafx.layout.CompositeFXControllerBase;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.SplitPane;
/**
* FX Controller for the Metrics view.
*
* @author groh
*/
@SuppressWarnings("unchecked")
public class MetricsFXController extends CompositeFXControllerBase<SplitPane, Node> {
/** The refresh {@link Button} to refresh the metrics. */
@FXML
private Button refreshButton;
/** The central top {@link Label} to display short messages. */
@FXML
private Label topLabel;
/** Time format when displaying updating time. */
private final DateTimeFormatter timeFormat = DateTimeFormatter.ofPattern("HH:mm:ss");
/** {@inheritDoc} */
@Override
public String getFXMLLocation() {
return "MetricsViewFx.fxml";
}
/** {@inheritDoc} */
@Override
public void initialize() {
}
/**
* Is triggered when the refresh button is pressed.
*/
public void onRefreshMetricsSubmit() {
LocalDateTime currentTime = LocalDateTime.now();
topLabel.setText("View was updated at " + timeFormat.format(currentTime));
}
}
/*-------------------------------------------------------------------------+
| Copyright 2023 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.ext.quality.ui.view.fx;
import org.eclipse.ui.part.ViewPart;
import org.fortiss.tooling.common.ui.javafx.AF3FXViewPart;
/**
* {@link ViewPart} for the FX implementation of the metrics view.
*
* @author groh
*/
public class MetricsFXViewPart extends AF3FXViewPart implements IMetricsViewPart {
/** The FX Controller for this view. */
private static final MetricsFXController VIEW_CONTROLLER = new MetricsFXController();
/**
* Constructor.
*
* @throws Exception
*/
public MetricsFXViewPart() throws Exception {
super(VIEW_CONTROLLER, null);
}
/**
* Returns the initialized {@link MetricsFXController} for the reuse
* version of the {@link AF3FXViewPart}.
*
* @return The view controller for the metrics view
*/
public static MetricsFXController getMetricsFXController() {
return VIEW_CONTROLLER;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment