Skip to content

Commit

Permalink
Adjust according to review
Browse files Browse the repository at this point in the history
  • Loading branch information
pstuecker committed Apr 5, 2024
1 parent 56a0f7b commit 14cb816
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.eclipse.emf.common.command.CommandStackListener;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EContentAdapter;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
Expand Down Expand Up @@ -687,16 +688,17 @@ private void readPlanProModel() {
getToolboxFile());
}

private void readLayoutInformationen() {
private void readLayoutInformation() {
final Path layoutPath = getToolboxFile().getLayoutPath();
if (layoutPath != null && layoutPath.toFile().exists()) {
layoutinfoValidationResult = new ValidationResult(
PlanPro_Layoutinfo.class);
serviceProvider.validationService.checkLoad(getToolboxFile(),
path -> {
layoutInfo = serviceProvider.validationService
.checkLoad(getToolboxFile(), path -> {
getToolboxFile().openLayout();
return toolboxFile.getLayoutResource();
}, null, layoutinfoValidationResult);
}, this::readLayoutFromResource,
layoutinfoValidationResult);

layoutinfoValidationResult = serviceProvider.validationService
.validateSource(
Expand All @@ -705,6 +707,10 @@ private void readLayoutInformationen() {
}
}

private PlanPro_Layoutinfo readLayoutFromResource(final Resource res) {
return (PlanPro_Layoutinfo) res.getContents().getFirst();
}

private void removeContentAdapter(final EObject object) {
if (object != null && contentAdapter != null) {
object.eAdapters().remove(contentAdapter);
Expand Down Expand Up @@ -870,7 +876,7 @@ protected void readModel() throws IOException {
readMergeModel();
} else {
readPlanProModel();
readLayoutInformationen();
readLayoutInformation();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ class PlanProSchnittstelleExtensions {
static def boolean containsUnfilledManagementValues(
PlanPro_Schnittstelle schnittstelle, XMLResource resource) {
val objman = schnittstelle?.LSTPlanung?.objektmanagement
val Iterable<Pair<EStructuralFeature, EObject>> unfilledValues = objman.
unfilledValues
var requiresDefaults = !unfilledValues.empty
return requiresDefaults
return !objman.unfilledValues.empty
}

static def void fixManagementDefaults(PlanPro_Schnittstelle schnittstlle) {
Expand Down

0 comments on commit 14cb816

Please sign in to comment.