2024年8月3日14:19:27
parent
1f38db9ee4
commit
e3b648100d
12
pom.xml
12
pom.xml
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
<properties>
|
||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<netty.version>4.1.48.Final</netty.version>
|
||||
<fastjson.version>2.0.27</fastjson.version>
|
||||
<jwt.version>0.9.1</jwt.version>
|
||||
|
|
@ -529,6 +529,14 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>14</source>
|
||||
<target>14</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import javafx.embed.swing.SwingNode;
|
|||
import javafx.geometry.Bounds;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
|
||||
import org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaUI;
|
||||
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
|
||||
import org.fife.ui.rsyntaxtextarea.Theme;
|
||||
import org.fife.ui.rtextarea.RTextScrollPane;
|
||||
|
|
@ -27,6 +28,8 @@ public class RxEditer extends AnchorPane{
|
|||
|
||||
private final RSyntaxTextArea textArea = new RSyntaxTextArea();
|
||||
|
||||
private RTextScrollPane sp;
|
||||
|
||||
public RSyntaxTextArea getTextArea(){
|
||||
return textArea;
|
||||
}
|
||||
|
|
@ -62,6 +65,7 @@ public class RxEditer extends AnchorPane{
|
|||
SwingNode sn = new SwingNode();
|
||||
new Thread(()->{
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
|
||||
textArea.setEditable(true);//编辑器
|
||||
if (style == null || style.equals("")) {
|
||||
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);//java
|
||||
|
|
@ -85,11 +89,27 @@ public class RxEditer extends AnchorPane{
|
|||
line.setValue(linenum);
|
||||
column.setValue(columnnum);
|
||||
});
|
||||
RTextScrollPane sp = new RTextScrollPane(textArea);
|
||||
sp= new RTextScrollPane(textArea);
|
||||
changeStyleViaThemeXml(theme);
|
||||
sp.setBorder(null);
|
||||
sn.setContent(sp);
|
||||
});
|
||||
}).start();
|
||||
|
||||
widthProperty().addListener(new ChangeListener<Number>() {
|
||||
@Override
|
||||
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
|
||||
textArea.setSize(newValue.intValue(),textArea.getHeight());
|
||||
}
|
||||
});
|
||||
|
||||
heightProperty().addListener(new ChangeListener<Number>() {
|
||||
@Override
|
||||
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
|
||||
textArea.setSize(textArea.getWidth(),newValue.intValue());
|
||||
}
|
||||
});
|
||||
|
||||
getChildren().add(sn);
|
||||
setTopAnchor(sn, 0.0);
|
||||
setBottomAnchor(sn, 0.0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue