loadMapFromPath(path);
setBasePathFrom(path.toFile());
} else if (input instanceof FileEditorInput) {
IFile file = ResourceUtil.getFile(input);
IPath path = file.getLocation();
currentMap = new TMXMapReader().readMap(
((FileEditorInput) input).getFile().getContents(),
path.toFile());
setBasePathFrom(path.toFile());
} else if (input instanceof IURIEditorInput) {
URI uri = ((IURIEditorInput) input).getURI();
File mapFile = new File(uri);
currentMap = new TMXMapReader().readMap(
new ByteArrayInputStream(document.get().getBytes()),mapFile);
} else {
IFile file = ResourceUtil.getFile(input);
if (file != null) {
IPath path = file.getLocation();
currentMap = new TMXMapReader().readMap(
((FileEditorInput) input).getFile().getContents(),
path.toFile());
} else {
currentMap = new TMXMapReader()
.readMap(new ByteArrayInputStream(document.get()
.getBytes()));
}
}
IActionBars actionBars = getEditorSite().getActionBars();