X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fgui%2FSwingInterface.java;h=f8a43d0b5e0bf97d77344dfc18b72ed918b3480c;hb=639bce22951d37c77af04aa2b21dd8228d9adeef;hp=92b6dc2bbb097fafd04d5d2c969dd04bbe1b4a87;hpb=dc37f1e959fe36099d157e6d09b5790d4e06897c;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/gui/SwingInterface.java b/src/net/pterodactylus/jsite/gui/SwingInterface.java index 92b6dc2..f8a43d0 100644 --- a/src/net/pterodactylus/jsite/gui/SwingInterface.java +++ b/src/net/pterodactylus/jsite/gui/SwingInterface.java @@ -115,6 +115,9 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh /** The “add project” action. */ private I18nAction addProjectAction; + /** The “insert project” actions. */ + private Map insertProjectActions = new HashMap(); + /** The “clone project” actions. */ private Map cloneProjectActions = new HashMap(); @@ -353,6 +356,17 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh } /** + * Returns the “insert project” action for the given project. + * + * @param project + * The project to get the “insert project” action for + * @return The “insert project” action + */ + I18nAction getInsertProjectAction(Project project) { + return insertProjectActions.get(project); + } + + /** * Returns the “clone project” action for the given project. * * @param project @@ -546,7 +560,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh } }; List availableLanguages = I18n.findAvailableLanguages(); - for (final Locale locale: availableLanguages) { + for (final Locale locale : availableLanguages) { String language = locale.getLanguage(); I18nAction languageAction = new I18nAction("general.language." + language, IconLoader.loadIcon("/flag-" + language + ".png")) { @@ -744,7 +758,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh * The action that triggered the change */ private void changeLanguage(Locale newLocale, I18nAction languageAction) { - for (I18nAction i18nAction: languageActions) { + for (I18nAction i18nAction : languageActions) { i18nAction.setEnabled(i18nAction != languageAction); } I18n.setLocale(newLocale); @@ -804,7 +818,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh */ public void loadingProjectsDone(String directory) { mainWindow.setStatusBarText(I18n.get("mainWindow.statusBar.projectLoadingDone")); - for (Project project: core.getProjects()) { + for (Project project : core.getProjects()) { projectAdded(project, false); } }