refactor to integrate design browser

This commit is contained in:
2020-10-04 16:20:16 +02:00
parent 563b6e2b01
commit cc9be70708
15 changed files with 655 additions and 83 deletions

View File

@ -11,6 +11,7 @@
package com.minres.scviewer.e4.application.handlers;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.e4.core.contexts.IEclipseContext;
@ -39,12 +40,12 @@ public class OpenHandler {
part.setLabel(files.get(0).getName());
MPartStack partStack = (MPartStack)modelService.find("org.eclipse.editorss", app); //$NON-NLS-1$
partStack.getChildren().add(part);
partService.showPart(part, PartState.ACTIVATE);
partService.showPart(part, PartState.CREATE);
final IEclipseContext ctx=part.getContext();
files.stream()
.map(x -> x.getAbsolutePath())
.reduce((s1, s2) -> s1 + "," + s2)
.ifPresent(s -> ctx.modify("input", s)); //$NON-NLS-1$
List<String> inputs=new ArrayList<>();
for(File f: files)
inputs.add(f.getAbsolutePath());
ctx.modify("input", inputs);
ctx.modify("config", ""); //$NON-NLS-1$
}