mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
minor changes
This commit is contained in:
@@ -11,5 +11,5 @@
|
|||||||
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;Library&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;DIYLC&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/>
|
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;Library&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;DIYLC&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/>
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.diylc.DIYLCStarter"/>
|
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.diylc.DIYLCStarter"/>
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="diylc-swing"/>
|
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="diylc-swing"/>
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx512m -Ddorg.diylc.debugComponentAreas=true"/>
|
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx512m"/>
|
||||||
</launchConfiguration>
|
</launchConfiguration>
|
||||||
|
|||||||
+16
-6
@@ -17,10 +17,13 @@ public class AutoSavePlugin implements IPlugIn {
|
|||||||
|
|
||||||
private static final String AUTO_SAVE_FILE_NAME = "autoSave.diy";
|
private static final String AUTO_SAVE_FILE_NAME = "autoSave.diy";
|
||||||
|
|
||||||
|
protected static final long autoSaveFrequency = 60 * 1000;
|
||||||
|
|
||||||
private ExecutorService executor;
|
private ExecutorService executor;
|
||||||
|
|
||||||
private IPlugInPort plugInPort;
|
private IPlugInPort plugInPort;
|
||||||
private IView view;
|
private IView view;
|
||||||
|
private long lastSave = 0;
|
||||||
|
|
||||||
public AutoSavePlugin(IView view) {
|
public AutoSavePlugin(IView view) {
|
||||||
this.view = view;
|
this.view = view;
|
||||||
@@ -34,20 +37,23 @@ public class AutoSavePlugin implements IPlugIn {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
boolean wasAbnormal = ConfigurationManager.getInstance().readBoolean(
|
boolean wasAbnormal = ConfigurationManager.getInstance()
|
||||||
IPlugInPort.ABNORMAL_EXIT_KEY, false);
|
.readBoolean(IPlugInPort.ABNORMAL_EXIT_KEY, false);
|
||||||
if (wasAbnormal && new File(AUTO_SAVE_FILE_NAME).exists()) {
|
if (wasAbnormal && new File(AUTO_SAVE_FILE_NAME).exists()) {
|
||||||
int decision = view
|
int decision = view
|
||||||
.showConfirmDialog(
|
.showConfirmDialog(
|
||||||
"It appears that aplication was not closed normally in the previous session. Do you want to open the last auto-saved file?",
|
"It appears that aplication was not closed normally in the previous session. Do you want to open the last auto-saved file?",
|
||||||
"Auto-Save", IView.YES_NO_OPTION, IView.QUESTION_MESSAGE);
|
"Auto-Save", IView.YES_NO_OPTION,
|
||||||
|
IView.QUESTION_MESSAGE);
|
||||||
if (decision == IView.YES_OPTION) {
|
if (decision == IView.YES_OPTION) {
|
||||||
AutoSavePlugin.this.plugInPort.loadProjectFromFile(AUTO_SAVE_FILE_NAME);
|
AutoSavePlugin.this.plugInPort
|
||||||
|
.loadProjectFromFile(AUTO_SAVE_FILE_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Set abnormal flag to true, GUI side of the app must flip to
|
// Set abnormal flag to true, GUI side of the app must flip to
|
||||||
// false when app closes regularly.
|
// false when app closes regularly.
|
||||||
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, true);
|
ConfigurationManager.getInstance().writeValue(
|
||||||
|
IPlugInPort.ABNORMAL_EXIT_KEY, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -64,7 +70,11 @@ public class AutoSavePlugin implements IPlugIn {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
plugInPort.saveProjectToFile(AUTO_SAVE_FILE_NAME, true);
|
Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
|
||||||
|
if (System.currentTimeMillis() - lastSave > autoSaveFrequency) {
|
||||||
|
lastSave = System.currentTimeMillis();
|
||||||
|
plugInPort.saveProjectToFile(AUTO_SAVE_FILE_NAME, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -263,8 +263,8 @@ public class StatusBar extends JPanel implements IPlugIn {
|
|||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append(Utils.toCommaString(selectedComponentNames.subList(0, Math.min(20,
|
builder.append(Utils.toCommaString(selectedComponentNames.subList(0, Math.min(20,
|
||||||
selectedComponentNames.size()))));
|
selectedComponentNames.size()))));
|
||||||
if (selectedComponentNames.size() > 20) {
|
if (selectedComponentNames.size() > 15) {
|
||||||
builder.append(" and " + (selectedComponentNames.size() - 20) + " more");
|
builder.append(" and " + (selectedComponentNames.size() - 15) + " more");
|
||||||
}
|
}
|
||||||
if (!stuckComponentNames.isEmpty()) {
|
if (!stuckComponentNames.isEmpty()) {
|
||||||
builder.append(" (hold <b>Ctrl</b> and drag to unstuck from ");
|
builder.append(" (hold <b>Ctrl</b> and drag to unstuck from ");
|
||||||
|
|||||||
Reference in New Issue
Block a user