add multi file feature

This commit is contained in:
2020-03-17 12:54:38 +01:00
parent e8682e446b
commit ec8d54dca3
7 changed files with 61 additions and 42 deletions

View File

@ -158,19 +158,27 @@ public class E4LifeCycle {
* @param name the name
*/
public void openViewForFile(String name){
File file = new File(name);
File file = new File(getFirstFileName(name));
MPart part = partService.createPart("com.minres.scviewer.e4.application.partdescriptor.waveformviewer"); //$NON-NLS-1$
part.setLabel(file.getName());
MPartStack partStack = (MPartStack)modelService.find("org.eclipse.editorss", app); //$NON-NLS-1$
partStack.getChildren().add(part);
partService.showPart(part, PartState.ACTIVATE);
IEclipseContext ctx=part.getContext();
ctx.modify("input", file); //$NON-NLS-1$
ctx.modify("input", name); //$NON-NLS-1$
//ctx.declareModifiable("input"); //$NON-NLS-1$
ctx.modify("config", confFile); //$NON-NLS-1$
//ctx.declareModifiable("config"); //$NON-NLS-1$
}
private String getFirstFileName(String name) {
if(name.contains(":")) {
String[] tokens = name.split(",");
return tokens[0];
} else
return name;
}
public void setConfigFile(String confFile) {
this.confFile=confFile;
}