Add fields to model
This commit is contained in:
parent
d0bddf7d46
commit
f94612cf87
@ -1,10 +1,28 @@
|
|||||||
package app.model;
|
package app.model;
|
||||||
|
|
||||||
|
import app.languages.Java;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data model of the application
|
* Data model of the application
|
||||||
*/
|
*/
|
||||||
public class Model {
|
public class Model {
|
||||||
|
private static String activeFilePath;
|
||||||
|
private static String currentProjectPath;
|
||||||
|
private static ProgrammingLanguage currentProgrammingLanguage;
|
||||||
|
|
||||||
private String text;
|
public static String getActiveFilePath() {
|
||||||
|
return activeFilePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getProjectPath() {
|
||||||
|
return currentProjectPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ProgrammingLanguage getLanguage() {
|
||||||
|
return currentProgrammingLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setLanguage(ProgrammingLanguage language) {
|
||||||
|
Model.currentProgrammingLanguage = language;
|
||||||
|
}
|
||||||
}
|
}
|
28
src/main/java/app/model/ProgrammingLanguage.java
Normal file
28
src/main/java/app/model/ProgrammingLanguage.java
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package app.model;
|
||||||
|
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public interface ProgrammingLanguage {
|
||||||
|
/**
|
||||||
|
* The name of the programming language
|
||||||
|
*/
|
||||||
|
public String getName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The icon of the programming language
|
||||||
|
* @return The path of the icon
|
||||||
|
*/
|
||||||
|
public URL getIcon();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The map containing the regex and corresponding style-classes to be used for syntax highlighting
|
||||||
|
*/
|
||||||
|
public Map<Pattern,String> getPatternMap();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The pattern containing all regexes for syntax highlighting
|
||||||
|
*/
|
||||||
|
public Pattern getPattern();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user