⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 applicationtemplate.txt

📁 具有不同语法高亮的编辑器实例
💻 TXT
字号:
/*
 * NOTE: This is the beginning of a "template" from which to create a GUI
 * application with the "org.fife Framework."  It has skeleton implementations
 * for all abstract methods in AbstractGUIApplication.
 *
 * We still need to:
 * 1. Make keywords (class name, etc.) into "variables" (e.g. "${className}")
 *    to be filled in by the plugin.
 * 2. etc.
 */
package org.fife.rzip;

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.Vector;
import java.util.zip.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.filechooser.FileFilter;
import javax.swing.table.*;

import org.fife.help.*;
import org.fife.ui.*;
import org.fife.ui.app.*;
import org.fife.ui.rtextfilechooser.*;


public class RZip2 extends AbstractGUIApplication {

	private static final String BUNDLE_NAME			= "org.fife.rzip.RZip2";
	private static final String VERSION_STRING		= "1.0.00";


/*****************************************************************************/


	/**
	 * The constructor for this class.
	 *
	 * @param title The title for this frame.
	 * @param jarFile The name (not full path) of the JAR file containing the
	 *                main class of this application (e.g. "Foobar.jar").
	 */
	public RZip2(String name, String jarFile) {
		super(name, jarFile);
	}


/*****************************************************************************/


	/**
	 * Gets called from the OSXAdapter; this method is needed by the Mac OS X
	 * JVM.  This is a hook for the standard Apple application menu.  This
	 * method should be overridden to show the About dialog.
	 */
	public void about() {
		// TODO: Add code to display the About dialog.
	}


/*****************************************************************************/


	/**
	 * Creates and returns the menu bar used in this application.
	 *
	 * @param prefs This GUI application's preferences.
	 * @return The menu bar.
	 */
	protected JMenuBar createMenuBar(GUIApplicationPreferences prefs) {
		// TODO: Add code to create the menu bar.
		return new JMenuBar();
	}


/*****************************************************************************/


	/**
	 * Creates and returns the splash screen to display while this GUI
	 * application is loading.
	 *
	 * @return The splash screen.  If <code>null</code> is returned, no splash
	 * screen is displayed.
	 */
	protected SplashScreen createSplashScreen() {
		return null;
	}


/*****************************************************************************/


	/**
	 * Creates and returns the status bar to be used by this application.  This
	 * method is called in this <code>GUIApplication</code>'s constructor.
	 *
	 * @param prefs This GUI application's preferences.
	 * @return The status bar.
	 */
	protected org.fife.ui.StatusBar createStatusBar(GUIApplicationPreferences prefs) {
		// TODO: Add code to create a custom status bar.
		return new org.fife.ui.StatusBar();
	}


/*****************************************************************************/


	/**
	 * Creates and returns the toolbar to be used by this application.  This
	 * method is called in this <code>GUIApplication</code>'s constructor.
	 *
	 * @param prefs This GUI application's preferences.
	 * @return The toolbar.
	 */
	protected CustomizableToolBar createToolBar(
						GUIApplicationPreferences prefs) {
		// TODO: Add code to create and return the toolbar.
		return new CustomizableToolBar();
	}


/*****************************************************************************/


	/**
	 * Returns the About dialog for this application.
	 *
	 * @return The About dialog.
	 * @see org.fife.ui.AboutDialog
	 */
	public AboutDialog getAboutDialog() {
		return null;
	}


/*****************************************************************************/


	/**
	 * Returns the Help dialog for this application, or <code>null</code>
	 * if this application does not have a Help dialog.
	 *
	 * @return The Help dialog.
	 */
	public HelpDialog getHelpDialog() {
		return null;
	}


/*****************************************************************************/


	/**
	 * Returns the name of the preferences class for this application.  This
	 * class must be a subclass of <code>GUIApplicationPreferences</code>.
	 *
	 * @return The class name, or <code>null</code> if this GUI application
	 *         does not save preferences.
	 */
	protected String getPreferencesClassName() {
		return null;
	}


/*****************************************************************************/


	/**
	 * Returns the fully-qualified class name of the resource bundle for this
	 * application.  This is used by <code>getResourceBundle</code> to locate
	 * the class.
	 *
	 * @return The fully-qualified class name of the resource bundle.
	 * @see #getResourceBundle
	 */
	public String getResourceBundleClassName() {
		return BUNDLE_NAME;
	}


/*****************************************************************************/


	/**
	 * Returns the version string for this application.
	 *
	 * @return The version string.
	 */
	public String getVersionString() {
		return VERSION_STRING;
	}


/*****************************************************************************/


	/**
	 * Gets called from the OSXAdapter; this method is needed by the Mac OS X
	 * JVM.  This is a hook for the standard Apple application menu.  This
	 * method gets called when we receive an open event from the finder on
	 * Mac OS X, and should be overridden to do whatever makes sense in your
	 * application to "open a file."
	 */
	public void openFile(final String fileName) {
		// TODO: Add code to open a file here.
	}


/*****************************************************************************/


	/**
	 * Gets called from the OSXAdapter; this method is needed by the Mac OS X
	 * JVM.  This is a hook for the standard Apple application menu.  This
	 * method should be overridden to show the Options dialog.
	 */
	public void preferences() {
		// TODO: Add code to show preferences dialog here.
	}


/*****************************************************************************/

	/**
	 * This is called in the GUI application's constructor.  It is a chance
	 * for subclasses to do initialization of stuff that will be needed
	 * by the class before the appliction is displayed on-screen.
	 *
	 * @param prefs The preferences of the application.
	 * @param splashScreen The "splash screen" for this application.  This
	 *                            value may be <code>null</code>.
	 */
	public void preDisplayInit(GUIApplicationPreferences prefs,
								SplashScreen splashScreen) {
		// TODO: Add initialization code here.
	}


/*****************************************************************************/

	/**
	 * This is called in the GUI application's constructor.  It is a chance
	 * for subclasses to do initialization of stuff that will be needed by
	 * their menu bar before it gets created.
	 *
	 * @param prefs The preferences of the application.
	 * @param splashScreen The "splash screen" for this application.  This
	 *                            value may be <code>null</code>.
	 */
	protected void preMenuBarInit(GUIApplicationPreferences prefs,
								SplashScreen splashScreen) {
		// TODO: Add initialization code here.
	}


/*****************************************************************************/

	/**
	 * This is called in the GUI application's constructor.  It is a chance
	 * for subclasses to do initialization of stuff that will be needed by
	 * their status bar before it gets created.
	 *
	 * @param prefs The preferences of the application.
	 * @param splashScreen The "splash screen" for this application.  This
	 *                            value may be <code>null</code>.
	 */
	protected void preStatusBarInit(GUIApplicationPreferences prefs,
									SplashScreen splashScreen) {
		// TODO: Add initialization code here.
	}


/*****************************************************************************/

	/**
	 * This is called in the GUI application's constructor.  It is a chance
	 * for subclasses to do initialization of stuff that will be needed by
	 * their toolbar before it gets created.
	 *
	 * @param prefs The preferences of the application.
	 * @param splashScreen The "splash screen" for this application.  This
	 *                            value may be <code>null</code>.
	 */
	protected void preToolBarInit(GUIApplicationPreferences prefs,
								SplashScreen splashScreen) {
		// TODO: Add initialization code here.
	}


/*****************************************************************************/


	/**
	 * Gets called from the OSXAdapter; this method is needed by the Mac OS X
	 * JVM.  This is a hook for the standard Apple application menu.  This
	 * method should be overridden to terminate the application.
	 */
	public void quit() {
		// TODO: Add custom exit routine here.
	}


/*****************************************************************************/


	/**
	 * Program entry point.
	 */
	public static void main(String[] args) {

		try {
			UIManager.setLookAndFeel(
						UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {}

		JFrame frame = new RZip2("Bare-bones application", "RZip.jar");
		frame.setVisible(true);

	}


/*****************************************************************************/

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -