|
|
@ -184,9 +184,6 @@ public class PreferencePane extends BasicPane { |
|
|
|
private JProgressBar gcProgressBar; |
|
|
|
private JProgressBar gcProgressBar; |
|
|
|
private Timer gcProgressTimer; |
|
|
|
private Timer gcProgressTimer; |
|
|
|
private UIButton gcOkButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); |
|
|
|
private UIButton gcOkButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); |
|
|
|
private UIButton gcCancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PreferencePane() { |
|
|
|
public PreferencePane() { |
|
|
|
this.initComponents(); |
|
|
|
this.initComponents(); |
|
|
@ -325,6 +322,12 @@ public class PreferencePane extends BasicPane { |
|
|
|
tryGc(); |
|
|
|
tryGc(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
gcEnableCheckBox.addChangeListener(new ChangeListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
|
|
|
|
gcButton.setEnabled(gcEnableCheckBox.isSelected()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//集群下禁用
|
|
|
|
//集群下禁用
|
|
|
|
if (FineClusterConfig.getInstance().isCluster()) { |
|
|
|
if (FineClusterConfig.getInstance().isCluster()) { |
|
|
@ -700,7 +703,7 @@ public class PreferencePane extends BasicPane { |
|
|
|
saveCommitCheckBox.setSelected(vcsConfigManager.isSaveCommit()); |
|
|
|
saveCommitCheckBox.setSelected(vcsConfigManager.isSaveCommit()); |
|
|
|
useIntervalCheckBox.setSelected(vcsConfigManager.isUseInterval()); |
|
|
|
useIntervalCheckBox.setSelected(vcsConfigManager.isUseInterval()); |
|
|
|
gcEnableCheckBox.setSelected(GcConfig.getInstance().isGcEnable()); |
|
|
|
gcEnableCheckBox.setSelected(GcConfig.getInstance().isGcEnable()); |
|
|
|
|
|
|
|
gcButton.setEnabled(gcEnableCheckBox.isSelected()); |
|
|
|
supportCellEditorDefCheckBox.setSelected(designerEnvManager.isSupportCellEditorDef()); |
|
|
|
supportCellEditorDefCheckBox.setSelected(designerEnvManager.isSupportCellEditorDef()); |
|
|
|
|
|
|
|
|
|
|
|
isDragPermitedCheckBox.setSelected(designerEnvManager.isDragPermited()); |
|
|
|
isDragPermitedCheckBox.setSelected(designerEnvManager.isDragPermited()); |
|
|
@ -881,14 +884,12 @@ public class PreferencePane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void tryGc() { |
|
|
|
private void tryGc() { |
|
|
|
//停止gc线程时使用
|
|
|
|
|
|
|
|
final String uuid = String.valueOf(UUID.randomUUID()); |
|
|
|
|
|
|
|
final SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>() { |
|
|
|
final SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>() { |
|
|
|
private long size = 0; |
|
|
|
private long size = 0; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected Boolean doInBackground() { |
|
|
|
protected Boolean doInBackground() { |
|
|
|
size = WorkContext.getCurrent().get(VcsOperator.class).immediatelyGc(uuid); |
|
|
|
size = WorkContext.getCurrent().get(VcsOperator.class).immediatelyGc(); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -907,7 +908,6 @@ public class PreferencePane extends BasicPane { |
|
|
|
if (null != gcDialog) { |
|
|
|
if (null != gcDialog) { |
|
|
|
gcDialog.setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News")); |
|
|
|
gcDialog.setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News")); |
|
|
|
} |
|
|
|
} |
|
|
|
gcDialogDownPane.remove(gcCancelButton); |
|
|
|
|
|
|
|
gcDialogDownPane.revalidate(); |
|
|
|
gcDialogDownPane.revalidate(); |
|
|
|
gcDialogDownPane.repaint(); |
|
|
|
gcDialogDownPane.repaint(); |
|
|
|
gcDialogDownPane.add(gcOkButton); |
|
|
|
gcDialogDownPane.add(gcOkButton); |
|
|
@ -921,19 +921,6 @@ public class PreferencePane extends BasicPane { |
|
|
|
gcDialog.dispose(); |
|
|
|
gcDialog.dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
gcCancelButton.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
stopGcProgressTimer(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//中断gc 线程
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(uuid)) { |
|
|
|
|
|
|
|
WorkContext.getCurrent().get(VcsOperator.class).cancelImmediatelyGc(uuid); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
gcDialog.dispose(); |
|
|
|
|
|
|
|
worker.cancel(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
gcDialog.addWindowListener(new WindowAdapter() { |
|
|
|
gcDialog.addWindowListener(new WindowAdapter() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void windowClosed(WindowEvent e) { |
|
|
|
public void windowClosed(WindowEvent e) { |
|
|
@ -963,7 +950,6 @@ public class PreferencePane extends BasicPane { |
|
|
|
//中下
|
|
|
|
//中下
|
|
|
|
gcDialogDownPane = new JPanel(); |
|
|
|
gcDialogDownPane = new JPanel(); |
|
|
|
gcDialogDownPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); |
|
|
|
gcDialogDownPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); |
|
|
|
gcDialogDownPane.add(gcCancelButton); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
|
|
|
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
|
|
|
jp.add(gcUpPane); |
|
|
|
jp.add(gcUpPane); |
|
|
|