| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2029,36 +2029,28 @@ protected void autoSave() { | |||
| 2029 | 2029 | try { | |
| 2030 | 2030 | if (sketch.isModified() && !sketch.isUntitled()) { | |
| 2031 | 2031 | if (JavaMode.autoSavePromptEnabled) { | |
| 2032 | - final JDialog autoSaveDialog = new JDialog( | ||
| 2033 | - base.getActiveEditor(), this.getSketch().getName(), | ||
| 2034 | - true); | ||
| 2032 | + final JDialog autoSaveDialog = | ||
| 2033 | + new JDialog(base.getActiveEditor(), getSketch().getName(), true); | ||
| 2035 | 2034 | Container container = autoSaveDialog.getContentPane(); | |
| 2036 | 2035 | ||
| 2037 | 2036 | JPanel panelMain = new JPanel(); | |
| 2038 | - panelMain.setBorder(BorderFactory.createEmptyBorder(4, 0, | ||
| 2039 | - 2, 2)); | ||
| 2040 | - panelMain.setLayout(new BoxLayout(panelMain, | ||
| 2041 | - BoxLayout.PAGE_AXIS)); | ||
| 2042 | - | ||
| 2043 | - JPanel panelLabel = new JPanel(new FlowLayout( | ||
| 2044 | - FlowLayout.LEFT)); | ||
| 2045 | - JLabel label = new JLabel( | ||
| 2046 | - "<html><body> There are unsaved" | ||
| 2037 | + panelMain.setBorder(BorderFactory.createEmptyBorder(4, 0, 2, 2)); | ||
| 2038 | + panelMain.setLayout(new BoxLayout(panelMain, BoxLayout.PAGE_AXIS)); | ||
| 2039 | + | ||
| 2040 | + JPanel panelLabel = new JPanel(new FlowLayout(FlowLayout.LEFT)); | ||
| 2041 | + JLabel label = new JLabel("<html><body> There are unsaved" | ||
| 2047 | 2042 | + " changes in your sketch.<br />" | |
| 2048 | 2043 | + " Do you want to save it before" | |
| 2049 | 2044 | + " running? </body></html>"); | |
| 2050 | 2045 | label.setFont(new Font(label.getFont().getName(), | |
| 2051 | 2046 | Font.PLAIN, label.getFont().getSize() + 1)); | |
| 2052 | 2047 | panelLabel.add(label); | |
| 2053 | 2048 | panelMain.add(panelLabel); | |
| 2054 | - final JCheckBox dontRedisplay = new JCheckBox( | ||
| 2055 | - "Remember this decision"); | ||
| 2049 | + final JCheckBox dontRedisplay = new JCheckBox("Remember this decision"); | ||
| 2050 | + JPanel panelButtons = new JPanel(new FlowLayout(FlowLayout.CENTER, 8, 2)); | ||
| 2056 | 2051 | ||
| 2057 | - JPanel panelButtons = new JPanel(new FlowLayout( | ||
| 2058 | - FlowLayout.CENTER, 8, 2)); | ||
| 2059 | 2052 | JButton btnRunSave = new JButton("Save and Run"); | |
| 2060 | 2053 | btnRunSave.addActionListener(new ActionListener() { | |
| 2061 | - | ||
| 2062 | 2054 | @Override | |
| 2063 | 2055 | public void actionPerformed(ActionEvent e) { | |
| 2064 | 2056 | handleSave(true); | |
@@ -2071,9 +2063,9 @@ public void actionPerformed(ActionEvent e) { | |||
| 2071 | 2063 | } | |
| 2072 | 2064 | }); | |
| 2073 | 2065 | panelButtons.add(btnRunSave); | |
| 2066 | + | ||
| 2074 | 2067 | JButton btnRunNoSave = new JButton("Run, Don't Save"); | |
| 2075 | 2068 | btnRunNoSave.addActionListener(new ActionListener() { | |
| 2076 | - | ||
| 2077 | 2069 | @Override | |
| 2078 | 2070 | public void actionPerformed(ActionEvent e) { | |
| 2079 | 2071 | if (dontRedisplay.isSelected()) { | |
@@ -2088,8 +2080,7 @@ public void actionPerformed(ActionEvent e) { | |||
| 2088 | 2080 | panelMain.add(panelButtons); | |
| 2089 | 2081 | ||
| 2090 | 2082 | JPanel panelCheck = new JPanel(); | |
| 2091 | - panelCheck | ||
| 2092 | - .setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); | ||
| 2083 | + panelCheck.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); | ||
| 2093 | 2084 | panelCheck.add(dontRedisplay); | |
| 2094 | 2085 | panelMain.add(panelCheck); | |
| 2095 | 2086 | ||
@@ -2107,7 +2098,6 @@ public void actionPerformed(ActionEvent e) { | |||
| 2107 | 2098 | } catch (Exception e) { | |
| 2108 | 2099 | statusError(e); | |
| 2109 | 2100 | } | |
| 2110 | - | ||
| 2111 | 2101 | } | |
| 2112 | 2102 | ||
| 2113 | 2103 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments