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 {
|
||||
|
||||
private static final String baseTitle = "Mod XML Sandbox";
|
||||
|
||||
private UndoManager undoManager = new UndoManager();
|
||||
private String mainText = null;
|
||||
|
||||
|
@ -95,7 +97,7 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
|||
|
||||
|
||||
public ModXMLSandbox( File datsDir ) {
|
||||
super( "Mod XML Sandbox" );
|
||||
super( baseTitle );
|
||||
this.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
|
||||
|
||||
this.datsDir = datsDir;
|
||||
|
@ -289,7 +291,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
|||
this.pack();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setVisible( boolean b ) {
|
||||
super.setVisible( b );
|
||||
|
@ -305,7 +306,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void actionPerformed( ActionEvent e ) {
|
||||
Object source = e.getSource();
|
||||
|
@ -318,7 +318,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void open() {
|
||||
messageArea.setText( "" );
|
||||
|
||||
|
@ -352,6 +351,7 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
|||
mainArea.setCaretPosition( 0 );
|
||||
areasPane.setSelectedComponent( mainScroll );
|
||||
resultArea.setText( "" );
|
||||
this.setTitle( String.format( "%s - %s", innerPath, baseTitle ) );
|
||||
}
|
||||
catch ( IOException f ) {
|
||||
messageArea.setText( f.getMessage() );
|
||||
|
@ -370,7 +370,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void patch() {
|
||||
String mainText = mainArea.getText();
|
||||
if ( mainText.length() == 0 ) return;
|
||||
|
@ -396,7 +395,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void findNext() {
|
||||
JTextArea currentArea = getCurrentArea();
|
||||
if ( currentArea == null ) return;
|
||||
|
@ -442,7 +440,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void updateCaretStatus() {
|
||||
JTextArea currentArea = getCurrentArea();
|
||||
if ( currentArea == null ) return;
|
||||
|
@ -460,7 +457,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private JTextArea getCurrentArea() {
|
||||
if ( areasPane.getSelectedIndex() == 0 )
|
||||
return mainArea;
|
||||
|
@ -472,7 +468,6 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
|||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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