/plugins/ImageViewer/tags/1.0/src/imageviewer/OptionPane.java

# · Java · 68 lines · 32 code · 9 blank · 27 comment · 0 complexity · 8885650f779ed07c747ba7631b7e11fe MD5 · raw file

  1. /*
  2. Copyright (c) 2009, Dale Anson
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without modification,
  5. are permitted provided that the following conditions are met:
  6. * Redistributions of source code must retain the above copyright notice,
  7. this list of conditions and the following disclaimer.
  8. * Redistributions in binary form must reproduce the above copyright notice,
  9. this list of conditions and the following disclaimer in the documentation
  10. and/or other materials provided with the distribution.
  11. * Neither the name of the author nor the names of its contributors
  12. may be used to endorse or promote products derived from this software without
  13. specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  18. ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  21. ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. package imageviewer;
  26. import java.awt.*;
  27. import java.awt.event.*;
  28. import java.io.*;
  29. import javax.swing.*;
  30. import javax.swing.event.*;
  31. import org.gjt.sp.jedit.AbstractOptionPane;
  32. import org.gjt.sp.jedit.jEdit;
  33. public class OptionPane extends AbstractOptionPane {
  34. private JCheckBox vfsMouseOver = null;
  35. private JCheckBox pvMouseOver = null;
  36. public OptionPane() {
  37. this("");
  38. }
  39. public OptionPane( String name ) {
  40. super( name );
  41. }
  42. public void _init() {
  43. setBorder( BorderFactory.createEmptyBorder( 6, 6, 6, 6 ) );
  44. addComponent( new JLabel( "<html><h3>Image Viewer</h3>" ) );
  45. vfsMouseOver = new JCheckBox( jEdit.getProperty( "imageviewer.allowVFSMouseOver.label", "Show images on mouse over in File System Browser" ) );
  46. vfsMouseOver.setSelected( jEdit.getBooleanProperty( "imageviewer.allowVFSMouseOver", true ) );
  47. pvMouseOver = new JCheckBox( jEdit.getProperty( "imageviewer.allowPVMouseOver.label", "Show images on mouse over in ProjectViewer" ) );
  48. pvMouseOver.setSelected( jEdit.getBooleanProperty( "imageviewer.allowPVMouseOver", true ) );
  49. addComponent( vfsMouseOver );
  50. addComponent( pvMouseOver );
  51. }
  52. public void _save() {
  53. jEdit.setBooleanProperty( "imageviewer.allowVFSMouseOver", vfsMouseOver.isSelected() );
  54. jEdit.setBooleanProperty( "imageviewer.allowPVMouseOver", pvMouseOver.isSelected() );
  55. }
  56. }