import javax.swing.text.Document;
import javax.swing.text.DocumentFilter;
+import net.pterodactylus.util.swing.SortedListModel;
import de.todesbaum.jsite.application.Freenet7Interface;
-import de.todesbaum.jsite.application.KeyDialog;
import de.todesbaum.jsite.application.Project;
+import de.todesbaum.jsite.application.WebOfTrustInterface;
import de.todesbaum.jsite.i18n.I18n;
import de.todesbaum.jsite.i18n.I18nContainer;
-import de.todesbaum.util.swing.SortedListModel;
import de.todesbaum.util.swing.TLabel;
import de.todesbaum.util.swing.TWizard;
import de.todesbaum.util.swing.TWizardPage;
/** The freenet interface. */
private Freenet7Interface freenetInterface;
+ /** The web of trust interface. */
+ private WebOfTrustInterface webOfTrustInterface;
+
/** The “browse” action. */
private Action projectLocalPathBrowseAction;
I18nContainer.getInstance().registerRunnable(new Runnable() {
+ @Override
public void run() {
setHeading(I18n.getMessage("jsite.project.heading"));
setDescription(I18n.getMessage("jsite.project.description"));
private void createActions() {
projectLocalPathBrowseAction = new AbstractAction(I18n.getMessage("jsite.project.action.browse")) {
+ @Override
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionLocalPathBrowse();
projectAddAction = new AbstractAction(I18n.getMessage("jsite.project.action.add-project")) {
+ @Override
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionAdd();
projectDeleteAction = new AbstractAction(I18n.getMessage("jsite.project.action.delete-project")) {
+ @Override
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionDelete();
projectCloneAction = new AbstractAction(I18n.getMessage("jsite.project.action.clone-project")) {
+ @Override
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionClone();
projectCopyURIAction = new AbstractAction(I18n.getMessage("jsite.project.action.copy-uri")) {
+ @Override
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionCopyURI();
projectManageKeysAction = new AbstractAction(I18n.getMessage("jsite.project.action.manage-keys")) {
+ @Override
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionManageKeys();
projectResetEditionAction = new AbstractAction(I18n.getMessage("jsite.project.action.reset-edition")) {
+ @Override
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionResetEdition();
I18nContainer.getInstance().registerRunnable(new Runnable() {
+ @Override
@SuppressWarnings("synthetic-access")
public void run() {
projectLocalPathBrowseAction.putValue(Action.NAME, I18n.getMessage("jsite.project.action.browse"));
I18nContainer.getInstance().registerRunnable(new Runnable() {
+ @Override
public void run() {
projectInformationLabel.setText("<html><b>" + I18n.getMessage("jsite.project.project.information") + "</b></html>");
projectNameLabel.setText(I18n.getMessage("jsite.project.project.name") + ":");
}
/**
+ * Sets the web of trust interface to use.
+ *
+ * @param webOfTrustInterface
+ * The web of trust interface to use
+ */
+ public void setWebOfTrustInterface(WebOfTrustInterface webOfTrustInterface) {
+ this.webOfTrustInterface = webOfTrustInterface;
+ }
+
+ /**
* Returns the currently selected project.
*
* @return The currently selected project
KeyDialog keyDialog = new KeyDialog(freenetInterface, wizard);
keyDialog.setPrivateKey(selectedProject.getInsertURI());
keyDialog.setPublicKey(selectedProject.getRequestURI());
+ keyDialog.setOwnIdentities(webOfTrustInterface.getOwnIdentities());
keyDialog.setVisible(true);
if (!keyDialog.wasCancelled()) {
String originalPublicKey = selectedProject.getRequestURI();
/**
* {@inheritDoc}
*/
+ @Override
public void valueChanged(ListSelectionEvent listSelectionEvent) {
int selectedRow = projectList.getSelectedIndex();
Project selectedProject = (Project) projectList.getSelectedValue();
/**
* {@inheritDoc}
*/
+ @Override
public void insertUpdate(DocumentEvent documentEvent) {
setTextField(documentEvent);
}
/**
* {@inheritDoc}
*/
+ @Override
public void removeUpdate(DocumentEvent documentEvent) {
setTextField(documentEvent);
}
/**
* {@inheritDoc}
*/
+ @Override
public void changedUpdate(DocumentEvent documentEvent) {
setTextField(documentEvent);
}
/**
* {@inheritDoc}
*/
+ @Override
public void lostOwnership(Clipboard clipboard, Transferable contents) {
/* ignore. */
}