-
Notifications
You must be signed in to change notification settings - Fork 0
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
e864902
commit 26df199
Showing
13 changed files
with
150 additions
and
177 deletions.
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
38 changes: 0 additions & 38 deletions
38
src/main/java/com/santiagolizardo/madcommander/components/PathLabel.java
This file was deleted.
Oops, something went wrong.
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
53 changes: 53 additions & 0 deletions
53
src/main/java/com/santiagolizardo/madcommander/components/filelisting/PathTextField.java
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,53 @@ | ||
/** | ||
* This file is part of MadCommander, a file manager with two panels. | ||
* | ||
* MadCommander is free software: you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software | ||
* Foundation, either version 3 of the License, or (at your option) any later | ||
* version. | ||
* | ||
* MadCommander is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* MadCommander. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.santiagolizardo.madcommander.components.filelisting; | ||
|
||
import java.awt.Dimension; | ||
import java.awt.event.KeyAdapter; | ||
import java.awt.event.KeyEvent; | ||
import java.io.File; | ||
import javax.swing.JTextField; | ||
|
||
public class PathTextField extends JTextField { | ||
|
||
private FileListing fileListing; | ||
|
||
public PathTextField(FileListing fileListing) { | ||
super(30); | ||
|
||
this.fileListing = fileListing; | ||
|
||
Dimension preferredSize = getPreferredSize(); | ||
setMaximumSize(new Dimension(Integer.MAX_VALUE, preferredSize.height)); | ||
|
||
addKeyListener(new KeyAdapter() { | ||
|
||
@Override | ||
public void keyPressed(KeyEvent ev) { | ||
if (ev.getKeyCode() == KeyEvent.VK_ENTER) { | ||
String newPathString = getText(); | ||
File newPath = new File(newPathString); | ||
if (newPath.isDirectory()) { | ||
fileListing.setPath(newPathString); | ||
} else { | ||
setText(fileListing.getPath()); | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.