📄 createplaypensuccessfulpanel.java
字号:
package org.fife.rtext.plugins.rtextl10ngen;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import java.util.Locale;
import java.text.MessageFormat;
import java.util.ResourceBundle;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import org.fife.RUtilities;
import org.fife.rtext.RText;
import org.fife.rtext.RTextUtilities;
import org.fife.ui.app.WizardPluginDialog;
import org.fife.ui.app.WizardDialogInfoPanel;
import org.fife.ui.rtextfilechooser.RDirectoryChooser;
/**
* The panel that tells the user their playpen was successfully created.
*
* @author Robert Futrell
* @version 1.0
*/
class CreatePlaypenSuccessfulPanel extends WizardDialogInfoPanel {
private ResourceBundle msg;
private JCheckBox openPlaypenFilesCheckBox;
/*****************************************************************************/
/**
* Constructor.
*
* @param msg The plugin's resource bundle.
*/
public CreatePlaypenSuccessfulPanel(ResourceBundle msg) {
super(msg.getString("Plugin.Wizard.Create.Completed.Header"));
this.msg = msg;
setLayout(new BorderLayout());
JPanel contentPane = new JPanel();
contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
JPanel temp = new JPanel(new BorderLayout());
String desc = msg.getString("Plugin.Wizard.Create.Completed.Desc");
temp.add(new JLabel(desc));//, BorderLayout.WEST);
contentPane.add(temp);
contentPane.add(Box.createVerticalStrut(30));
temp = new JPanel(new BorderLayout());
desc = msg.getString("Plugin.Wizard.Create.Completed.OpenPlaypenFiles.Desc");
openPlaypenFilesCheckBox = new JCheckBox(desc, true);
temp.add(openPlaypenFilesCheckBox);
contentPane.add(temp);
add(contentPane, BorderLayout.NORTH);
}
/*****************************************************************************/
/**
* Called when this panel is "accepted" in the wizard (e.g., the user
* clicks "Next" and <code>validateInput</code> returns <code>null</code>).
* This method opens all files in the playpen if the user requests it.
*/
public void isAccepted() {
if (openPlaypenFilesCheckBox.isSelected()) {
WizardPluginDialog wiz = getWizard();
File playpen = (File)getWizard().getWizardProperty("Playpen");
RText rtext = ((RTextL10nGenPlugin)wiz.getPlugin()).getRText();
RTextUtilities.openAllFilesIn(rtext, playpen);
}
}
/*****************************************************************************/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -