Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ Import-Package: com.google.common.base;version="15.0.0",
org.eclipse.emf.ecore.resource,
org.eclipse.emf.ecore.util,
org.eclipse.emf.ecore.xmi,
org.eclipse.emf.ecp.ui.view;version="1.17.1",
org.eclipse.emf.ecp.ui.view.swt;version="1.17.1",
org.eclipse.emf.ecp.view.spi.custom.model;version="1.17.1",
org.eclipse.emf.ecp.view.spi.model;version="1.17.1",
org.eclipse.emf.edit.domain,
org.eclipse.emf.edit.provider,
org.eclipse.jface.dialogs,
org.eclipse.jface.layout,
org.eclipse.jface.operation,
Expand Down Expand Up @@ -82,6 +79,8 @@ Import-Package: com.google.common.base;version="15.0.0",
org.eclipse.set.utils.widgets,
org.eclipse.set.utils.xml,
org.eclipse.swt.widgets,
org.eclipse.ui.forms,
org.eclipse.ui.forms.widgets,
org.osgi.service.component.annotations;version="1.3.0",
org.osgi.service.event;version="1.4.0",
org.slf4j;version="1.7.2"
Expand All @@ -90,7 +89,6 @@ Require-Bundle: com.google.guava,
org.eclipse.xtend.lib,
org.eclipse.xtend.lib.macro,
org.eclipse.set.rcp.compatibility;bundle-version="0.1.0";resolution:=optional,
org.eclipse.emf.edit,
org.eclipse.set.core.services,
org.apache.commons.lang3;bundle-version="3.1.0",
org.eclipse.nebula.widgets.nattable.core,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,40 @@ ValidMsg=gültig
ValidationNotSupportedMsg=Überprfung nicht untersttzt
YesMsg=Ja
NoSubworks=Kein Untergewerk vorhanden.
ExportFileName=Validierungsmeldungen

ExportValidationMsg=Export als CSV
ExportValidationTitleMsg=Export als CSV
ProgressMsg=Öffne Validierungssicht
ShowValidationTableMsg=Zeige Meldungen in neuer Sicht
SourceMsg=Quelltext
ValidationReport.Supported.Version=Unterstütztes XML-Schema
ValidationReport.Used.Version=Verwendetes XML-Schema (in Datei)
ValidationReport.ModelInfo=Modellinformationen
ValidationReport.FunctionalModelInfo=Fachliche Modellinformationen
ValidationReport.Validity=Gültigkeit
ValidationReport.Messages=Validierungsmeldungen
ValidationReport.Subworks=Untergewerke
ValidationReport.GeladeneDatei=Geladene Datei
ValidationReport.ContainerContents = PlanPro-Container

ValidationReport_Report_Title=Validierungsmeldungen
ValidationReport_ModelInfo=Modellinformationen
ValidationReport_FunctionalModelInfo=Fachliche Modellinformationen

ValidationReport_Supported_Version=Unterstütztes XML-Schema
ValidationReport_Used_Version=Verwendetes XML-Schema (in Datei)
ValidationReport_Version_PlanPro=PlanPro
ValidationReport_Version_Signalbegriffe=Signalbegriffe


ValidationReport_Validity=Gültigkeit
ValidationReport_Validity_XSD_VALID=XSD-Gültigkeit
ValidationReport_Validity_EMF_VALID=EMF-Gültigkeit
ValidationReport_Validity_ModelLoaded=Verarbeitbar

ValidationReport_Messages=Validierungsmeldungen
ValidationReport_Subworks=Untergewerke
ValidationReport_Subwork_Model_Content=Enthalten

ValidationReport_GeladeneDatei=Geladene Datei
ValidationReport_GeladeneDatei_DateiName=Dateiname
ValidationReport_GeladeneDatei_TimeStamp=Zeitstempel
ValidationReport_GeladeneDatei_MD5=MD5
ValidationReport_GeladeneDatei_GUID=GUID


ValidationReport_ContainerContents =PlanPro-Container
ModelLoaderImpl_loadMsg=PlanPro-Datei wird geladen
ModelSession_ChangeIndicator=(geändert)
NilTestProblem_Message=Die nach Datenmodell erforderliche Angabe ist nicht vorhanden.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
OSGI-INF/,\
viewmodel/,\
plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,105 @@ public class Messages {
* Speichern PlanPro Daten
*/
public String SaveToolboxFile;

/**
* Modellinformationen
*/
public String ValidationReport_ModelInfo;

/**
* Fachliche Modellinformationen
*/
public String ValidationReport_FunctionalModelInfo;

/**
* Gültigkeit
*/
public String ValidationReport_Validity;

/**
* XSD-Gültigkeit
*/
public String ValidationReport_Validity_XSD_VALID;

/**
* EMF-Gültigkeit
*/
public String ValidationReport_Validity_EMF_VALID;

/**
* Verarbeitbar
*/
public String ValidationReport_Validity_ModelLoaded;

/**
* Validierungsmeldungen
*/
public String ValidationReport_Messages;

/**
* Untergewerke
*/
public String ValidationReport_Subworks;

/**
* Enthalten
*/
public String ValidationReport_Subwork_Model_Content;

/**
* Geladene Datei
*/
public String ValidationReport_GeladeneDatei;

/**
* Dateiname
*/
public String ValidationReport_GeladeneDatei_DateiName;

/**
* Zeitstempel
*/
public String ValidationReport_GeladeneDatei_TimeStamp;

/**
* MD5
*/
public String ValidationReport_GeladeneDatei_MD5;

/**
* GUID
*/
public String ValidationReport_GeladeneDatei_GUID;

/**
* PlanPro-Container
*/
public String ValidationReport_ContainerContents;

/**
* PlanPro
*/
public String ValidationReport_Version_PlanPro;

/**
* Signalbegriffe
*/
public String ValidationReport_Version_Signalbegriffe;

/**
* Verwendetes XML-Schema (in Datei)
*/
public String ValidationReport_Used_Version;

/**
* Unterstütztes XML-Schema
*/
public String ValidationReport_Supported_Version;

/**
* Validierungsmeldungen
*/
public String ValidationReport_Report_Title;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
/**
* Copyright (c) 2026 DB InfraGO AG and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
*/
package org.eclipse.set.feature.validation.parts;

import java.util.Collection;
import java.util.function.Function;
import java.util.stream.Collectors;

import org.eclipse.set.feature.validation.Messages;
import org.eclipse.set.model.validationreport.ValidationReport;
import org.eclipse.set.model.validationreport.VersionInfo;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.xtext.xbase.lib.Pair;

/**
* The section control for loaded file information
*
* @author truong
*/
public class ModelInfoSection {

protected class GroupSectionControl {
Composite viewSection;
Group group;

public GroupSectionControl(final Composite viewSection,
final String groupName) {
this.viewSection = viewSection;
createGroup(groupName);
}

private void createGroup(final String groupName) {
group = new Group(viewSection, SWT.NONE);
group.setText(groupName);
group.setLayout(new GridLayout(2, false));
group.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
}

public GroupSectionControl addTextControl(final String labelText,
final String text) {
final TextFieldWithLabelControl textFieldWithLabelControl = new TextFieldWithLabelControl(
group, labelText, text);
textFieldWithLabelControl.createControl();
return this;
}
}

protected record TextFieldWithLabelControl(Composite parent,
String labelText, String text) {
public void createControl() {
final Label label = new Label(parent, SWT.NONE);
label.setText(labelText);

final Text textField = new Text(parent, SWT.BORDER);
textField.setLayoutData(
new GridData(SWT.FILL, SWT.CENTER, true, false));
textField.setEnabled(false);
textField.setText(text);
}
}

Messages messages;
Composite parent;

/**
* @param parent
* the parent composite
* @param messages
* the {@link Messages}
*/
public ModelInfoSection(final Composite parent, final Messages messages) {
this.messages = messages;
this.parent = parent;
}

protected void createModelInformationGroup(
final ValidationReport validationReport) {
final Composite section = createExpandedSecion(
messages.ValidationReport_ModelInfo);

final GroupSectionControl loadedFileGroup = new GroupSectionControl(
section, messages.ValidationReport_GeladeneDatei);
loadedFileGroup //
.addTextControl(
messages.ValidationReport_GeladeneDatei_DateiName,
validationReport.getFileInfo().getFileName())
.addTextControl(
messages.ValidationReport_GeladeneDatei_TimeStamp,
validationReport.getFileInfo().getTimeStamp())
.addTextControl(messages.ValidationReport_GeladeneDatei_MD5,
validationReport.getFileInfo().getChecksum())
.addTextControl(messages.ValidationReport_GeladeneDatei_GUID,
validationReport.getFileInfo().getGuid());

final GroupSectionControl validityGroup = new GroupSectionControl(
section, messages.ValidationReport_Validity);
validityGroup //
.addTextControl(messages.ValidationReport_Validity_XSD_VALID,
validationReport.getXsdValid())
.addTextControl(messages.ValidationReport_Validity_EMF_VALID,
validationReport.getEmfValid())
.addTextControl(messages.ValidationReport_Validity_ModelLoaded,
validationReport.getModelLoaded());

final Pair<String, String> usedVersion = transformVersionInfo(
validationReport.getFileInfo().getUsedVersion());
final GroupSectionControl loadedVersionGroup = new GroupSectionControl(
section, messages.ValidationReport_Used_Version);
loadedVersionGroup //
.addTextControl(messages.ValidationReport_Version_PlanPro,
usedVersion.getKey())
.addTextControl(
messages.ValidationReport_Version_Signalbegriffe,
usedVersion.getValue());

final Pair<String, String> supportedVersions = transformVersionInfo(
validationReport.getSupportedVersion());
final GroupSectionControl supportVersionGroup = new GroupSectionControl(
section, messages.ValidationReport_Supported_Version);
supportVersionGroup //
.addTextControl(messages.ValidationReport_Version_PlanPro,
supportedVersions.getKey())
.addTextControl(
messages.ValidationReport_Version_Signalbegriffe,
supportedVersions.getValue());
}

protected void createFunctionalInformationenGroup(
final ValidationReport validationReport) {
final Composite expandedSecion = createExpandedSecion(
messages.ValidationReport_FunctionalModelInfo);
final GroupSectionControl subworkGroup = new GroupSectionControl(
expandedSecion, messages.ValidationReport_Subworks);
subworkGroup.addTextControl(
messages.ValidationReport_Subwork_Model_Content,
validationReport.getSubworkTypes());

final GroupSectionControl containerContentsGroup = new GroupSectionControl(
expandedSecion, messages.ValidationReport_ContainerContents);
containerContentsGroup.addTextControl(
messages.ValidationReport_Subwork_Model_Content,
validationReport.getFileInfo().getContainerContents());
}

private Composite createExpandedSecion(final String sectionTitle) {
final Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FillLayout());
container.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
final FormToolkit formToolkit = new FormToolkit(parent.getDisplay());
final ExpandableComposite ec = formToolkit
.createExpandableComposite(container,
ExpandableComposite.TWISTIE
| ExpandableComposite.TITLE_BAR
| ExpandableComposite.EXPANDED);
ec.setBackground(parent.getBackground());
ec.setText(sectionTitle);
final Composite section = new Composite(ec, SWT.NONE);
section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
section.setLayout(new GridLayout(2, true));
ec.setClient(section);
return section;
}

private static Pair<String, String> transformVersionInfo(
final VersionInfo versionInfo) {
final Function<Collection<String>, String> toString = versions -> versions
.stream()
.collect(Collectors.joining(", ")); //$NON-NLS-1$
return new Pair<>(toString.apply(versionInfo.getPlanProVersions()),
toString.apply(versionInfo.getSignalbegriffeVersions()));
}
}
Loading
Loading