Set the XML Sandbox title to reflect the currently opened innerPath
This commit is contained in:
parent
699cf24cd7
commit
42b86d6d26
1 changed files with 4 additions and 10 deletions
|
@ -72,6 +72,8 @@ import org.jdom2.JDOMException;
|
||||||
*/
|
*/
|
||||||
public class ModXMLSandbox extends JFrame implements ActionListener {
|
public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
|
|
||||||
|
private static final String baseTitle = "Mod XML Sandbox";
|
||||||
|
|
||||||
private UndoManager undoManager = new UndoManager();
|
private UndoManager undoManager = new UndoManager();
|
||||||
private String mainText = null;
|
private String mainText = null;
|
||||||
|
|
||||||
|
@ -95,7 +97,7 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
|
|
||||||
|
|
||||||
public ModXMLSandbox( File datsDir ) {
|
public ModXMLSandbox( File datsDir ) {
|
||||||
super( "Mod XML Sandbox" );
|
super( baseTitle );
|
||||||
this.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
|
this.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
|
||||||
|
|
||||||
this.datsDir = datsDir;
|
this.datsDir = datsDir;
|
||||||
|
@ -289,7 +291,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
this.pack();
|
this.pack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setVisible( boolean b ) {
|
public void setVisible( boolean b ) {
|
||||||
super.setVisible( b );
|
super.setVisible( b );
|
||||||
|
@ -305,7 +306,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed( ActionEvent e ) {
|
public void actionPerformed( ActionEvent e ) {
|
||||||
Object source = e.getSource();
|
Object source = e.getSource();
|
||||||
|
@ -318,7 +318,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void open() {
|
private void open() {
|
||||||
messageArea.setText( "" );
|
messageArea.setText( "" );
|
||||||
|
|
||||||
|
@ -352,6 +351,7 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
mainArea.setCaretPosition( 0 );
|
mainArea.setCaretPosition( 0 );
|
||||||
areasPane.setSelectedComponent( mainScroll );
|
areasPane.setSelectedComponent( mainScroll );
|
||||||
resultArea.setText( "" );
|
resultArea.setText( "" );
|
||||||
|
this.setTitle( String.format( "%s - %s", innerPath, baseTitle ) );
|
||||||
}
|
}
|
||||||
catch ( IOException f ) {
|
catch ( IOException f ) {
|
||||||
messageArea.setText( f.getMessage() );
|
messageArea.setText( f.getMessage() );
|
||||||
|
@ -370,7 +370,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void patch() {
|
private void patch() {
|
||||||
String mainText = mainArea.getText();
|
String mainText = mainArea.getText();
|
||||||
if ( mainText.length() == 0 ) return;
|
if ( mainText.length() == 0 ) return;
|
||||||
|
@ -396,7 +395,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void findNext() {
|
private void findNext() {
|
||||||
JTextArea currentArea = getCurrentArea();
|
JTextArea currentArea = getCurrentArea();
|
||||||
if ( currentArea == null ) return;
|
if ( currentArea == null ) return;
|
||||||
|
@ -442,7 +440,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void updateCaretStatus() {
|
private void updateCaretStatus() {
|
||||||
JTextArea currentArea = getCurrentArea();
|
JTextArea currentArea = getCurrentArea();
|
||||||
if ( currentArea == null ) return;
|
if ( currentArea == null ) return;
|
||||||
|
@ -460,7 +457,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private JTextArea getCurrentArea() {
|
private JTextArea getCurrentArea() {
|
||||||
if ( areasPane.getSelectedIndex() == 0 )
|
if ( areasPane.getSelectedIndex() == 0 )
|
||||||
return mainArea;
|
return mainArea;
|
||||||
|
@ -472,7 +468,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows a modal prompt with a JTree representing a list of paths.
|
* Shows a modal prompt with a JTree representing a list of paths.
|
||||||
*
|
*
|
||||||
|
@ -524,7 +519,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds TreeNodes, if they don't already exist, based on a shash-delimited string.
|
* Adds TreeNodes, if they don't already exist, based on a shash-delimited string.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue