Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
151b60b
commit 8003c93
Showing
6 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package at.mep.gui; | ||
|
||
import at.mep.editor.EditorWrapper; | ||
import com.mathworks.matlab.api.explorer.FileLocation; | ||
import com.mathworks.mde.explorer.Explorer; | ||
import com.mathworks.mlwidgets.explorer.model.navigation.InvalidLocationException; | ||
import com.mathworks.mlwidgets.explorer.model.navigation.NavigationContext; | ||
|
||
/** Created by Gavri on 2017-03-20. */ | ||
public class AutoSwitchCurrentFolder { | ||
public static NavigationContext navigationContext = Explorer.getInstance().getContext(); | ||
|
||
public static void doYourThing() { | ||
if (!EditorWrapper.getFile().exists()) { | ||
// check for "Untitled" as name is not good, since a "Untitled.m" can exist | ||
return; | ||
} | ||
FileLocation fileLocation = new FileLocation(EditorWrapper.getFile().getParent()); | ||
try { | ||
navigationContext.setLocation(fileLocation); | ||
} catch (InvalidLocationException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters