Advertisement
JoshDreamland

bits

Oct 18th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.13 KB | None | 0 0
  1.  
  2.   FindDialog.addDialogCreationListener(new FindDialogCreationListener() {
  3.     @Override void dialogCreated(FindDialog findDialog) {
  4.       findDialog.setLocationRelativeTo(LGM.frame);
  5.     }
  6.   }
  7.  
  8.   class CustomFileChooserProvider implements JoshEdit.FileChooserProvider {
  9.     @Override
  10.     JFileChooser get() {
  11.       CustomFileChooser fc = new CustomFileChooser("/org/lateralgm", "LAST_GAMEINFO_DIR"); //$NON-NLS-1$ //$NON-NLS-2$
  12.       fc.setFileFilter(new CustomFileFilter(
  13.         Messages.getString("JoshText.TYPE_TXT"), ".txt")); //$NON-NLS-1$ //$NON-NLS-2$
  14.     }
  15.   }
  16.  
  17.     public class CustomJEFileChooser implements JEFileChooser {
  18.         CustomFileChooser fileChooser = new CustomFileChooser();
  19.  
  20.         @Override
  21.         public String getLoadFilename() {
  22.             fileChooser.setDialogTitle(Messages.getString("JoshText.SAVE_TITLE")); //$NON-NLS-1$
  23.             if (fileChooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) return null;
  24.             return fileChooser.getSelectedFile().getPath();
  25.         }
  26.  
  27.         @Override
  28.         public String getSaveFilename()
  29.         {
  30.             fileChooser.setDialogTitle(Messages.getString("JoshText.LOAD_TITLE")); //$NON-NLS-1$
  31.             if (fileChooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION) return null;
  32.             return fileChooser.getSelectedFile().getPath();
  33.         }
  34.        
  35.     }
  36.  
  37.  
  38.  
  39.     private class CustomJScrollPane extends JScrollPane
  40.         {
  41.         /** More ECJ */
  42.         private static final long serialVersionUID = 1;
  43.  
  44.         public CustomJScrollPane(JComponent c)
  45.             {
  46.             super(c);
  47.             // TODO Auto-generated constructor stub
  48.             }
  49.  
  50.         @Override
  51.         public void paintComponent(Graphics g)
  52.             {
  53.             // gtk does not outline the scroll component like the other look and feels
  54.             // nimbus and the default and all the other ones put a border around the line
  55.             // numbering as well as code area, gtk tries to put a border right between the
  56.             // the two, this class gets around that by masking its back color to that of the
  57.             // line number area
  58.             //super.paint(g);
  59.             g.setColor(lines.bgColor);
  60.             g.fillRect(-1,-1,getWidth() + 11,getHeight() + 1);
  61.             // paint children, the line number panel and code area
  62.             this.paintChildren(g);
  63.             return;
  64.             }
  65.  
  66.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement