mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
get rid of dead code
GitOrigin-RevId: 6341f6007142ad2b9b34f775b217b14887fbf816
This commit is contained in:
committed by
intellij-monorepo-bot
parent
76d2dcee97
commit
0e499010b2
@@ -1,17 +0,0 @@
|
||||
form.preview.title=Form Preview
|
||||
form.menu.preview=Preview
|
||||
form.menu.preview.mnemonic=P
|
||||
form.menu.file.exit=Exit
|
||||
form.menu.laf=Look and Feel
|
||||
form.menu.laf.mnemonic=L
|
||||
form.menu.view.pack=Pack
|
||||
error.cannot.change.look.feel=Cannot change LookAndFeel.\nReason: {0}
|
||||
error.title=Error
|
||||
junit.runner.error=Error: {0}
|
||||
junit.class.not.found=Class not found: "{0}"
|
||||
junit.cannot.instantiate.tests=Cannot instantiate test(s): {0}
|
||||
junit.class.not.derived={0} is not derived from TestCase. Do not provide method name.
|
||||
junit.suite.must.be.static=''{0}.suite()'' method must be static
|
||||
junit.failed.to.invoke.suite=Failed to invoke suite(): {0}
|
||||
junit.method.not.found=Method ''{0}'' not found
|
||||
tests.found.in.package={0} test {0, choice, 0#classes|1#class|2#classes} found in package ''{1}''
|
||||
@@ -1,101 +0,0 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.uiDesigner;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class FormPreviewFrame {
|
||||
private JComponent myComponent;
|
||||
private static final ResourceBundle ourBundle = ResourceBundle.getBundle("RuntimeBundle");
|
||||
|
||||
// Note: this class should not be obfuscated
|
||||
|
||||
public static void main(String[] args) {
|
||||
FormPreviewFrame f = new FormPreviewFrame();
|
||||
|
||||
JFrame frame = new JFrame(ourBundle.getString("form.preview.title"));
|
||||
frame.setContentPane(f.myComponent);
|
||||
frame.setDefaultCloseOperation(3); //WindowConstants.EXIT_ON_CLOSE is not presented in JDK 1.3
|
||||
|
||||
// Add menu bar
|
||||
final JMenuBar menuBar = new JMenuBar();
|
||||
frame.setJMenuBar(menuBar);
|
||||
|
||||
final JMenu menuFile = new JMenu(ourBundle.getString("form.menu.preview"));
|
||||
menuFile.setMnemonic(ourBundle.getString("form.menu.preview.mnemonic").charAt(0));
|
||||
menuFile.add(new JMenuItem(new MyPackAction(frame)));
|
||||
menuFile.add(new JMenuItem(new MyExitAction()));
|
||||
menuBar.add(menuFile);
|
||||
|
||||
final JMenu viewMenu = new JMenu(ourBundle.getString("form.menu.laf"));
|
||||
viewMenu.setMnemonic(ourBundle.getString("form.menu.laf.mnemonic").charAt(0));
|
||||
menuBar.add(viewMenu);
|
||||
|
||||
final UIManager.LookAndFeelInfo[] lafs = UIManager.getInstalledLookAndFeels();
|
||||
for(int i = 0; i < lafs.length; i++){
|
||||
viewMenu.add(new MySetLafAction(frame, lafs[i]));
|
||||
}
|
||||
|
||||
frame.pack();
|
||||
Rectangle screenBounds =
|
||||
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getBounds();
|
||||
frame.setLocation(screenBounds.x + (screenBounds.width - frame.getWidth()) / 2,
|
||||
screenBounds.y + (screenBounds.height - frame.getHeight()) / 2);
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
private static final class MyExitAction extends AbstractAction{
|
||||
MyExitAction() {
|
||||
super(ourBundle.getString("form.menu.file.exit"));
|
||||
}
|
||||
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
private static final class MyPackAction extends AbstractAction{
|
||||
private final JFrame myFrame;
|
||||
|
||||
MyPackAction(final JFrame frame) {
|
||||
super(ourBundle.getString("form.menu.view.pack"));
|
||||
myFrame = frame;
|
||||
}
|
||||
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
myFrame.pack();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class MySetLafAction extends AbstractAction{
|
||||
private final JFrame myFrame;
|
||||
private final UIManager.LookAndFeelInfo myInfo;
|
||||
|
||||
MySetLafAction(final JFrame frame, final UIManager.LookAndFeelInfo info) {
|
||||
super(info.getName());
|
||||
myFrame = frame;
|
||||
myInfo = info;
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try{
|
||||
UIManager.setLookAndFeel(myInfo.getClassName());
|
||||
SwingUtilities.updateComponentTreeUI(myFrame);
|
||||
Dimension prefSize = myFrame.getPreferredSize();
|
||||
if(prefSize.width > myFrame.getWidth() || prefSize.height > myFrame.getHeight()){
|
||||
myFrame.pack();
|
||||
}
|
||||
}
|
||||
catch(Exception exc){
|
||||
JOptionPane.showMessageDialog(
|
||||
myFrame,
|
||||
MessageFormat.format(ourBundle.getString("error.cannot.change.look.feel"), new Object[] {exc.getMessage()}),
|
||||
ourBundle.getString("error.title"),
|
||||
JOptionPane.ERROR_MESSAGE
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user