OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN=Failed to open Editor
OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED=The derivative hierarchy is corrupted\!
OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND=No Derivatives found
+
+DeleteTaxonBaseHandler_CONFIRM_DELETION=Confirm Deletion
+DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT=Element has to be Synonym, Misapplication or Concept
+DeleteTaxonBaseHandler_REALLY_DELETE_TAXON=Are you sure you want to delete the selected taxon?
OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN=Öffnen des Editors fehlgeschlagen
OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED=Die Derivathierarchie ist korrumpiert\!
OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND=Keine Derivate gefunden
+
+DeleteTaxonBaseHandler_CONFIRM_DELETION=Löschen bestätigen
+DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT=Element muss Synonym, Misapplication oder Konzept sein
+DeleteTaxonBaseHandler_REALLY_DELETE_TAXON=Wollen Sie wirklich das ausgewählte Taxon löschen?
public static String DeleteDerivateOperation_CONFIRM;
public static String DeleteDerivateOperation_DELETE_FAILED;
public static String DeleteDerivateOperation_REALLY_DELETE;
+ public static String DeleteTaxonBaseHandler_CONFIRM_DELETION;
+ public static String DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT;
+ public static String DeleteTaxonBaseHandler_REALLY_DELETE_TAXON;
public static String DerivateDropListener_MOVE_TO;
public static String DerivateView_DERIVATIVE_EDITOR;
public static String DerivateView_SAVING_HIERARCHY;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.Messages;
import eu.etaxonomy.taxeditor.editor.Page;
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
import eu.etaxonomy.taxeditor.editor.name.operation.DeleteMisapplicationOperation;
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
/**
- * <p>DeleteTaxonBaseHandler class.</p>
- *
* @author n.hoffmann
* @created 21.04.2009
* @version 1.0
public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler, IPostOperationEnabled {
TaxonNameEditor editor;
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
/** {@inheritDoc} */
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
return null;
}
- /**
- * @param editor
- * @param selectedElement
- * @param operation
- * @param commandName
- */
protected void doExecute(ExecutionEvent event, TaxonNameEditor editor, Object selectedElement) {
AbstractPostOperation operation = null;
String commandName = null;
}
else if (selectedElement instanceof Taxon){
//TODO: how to get the actual classification
- if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Are you sure you want to delete the selected taxon?")){
+ if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), Messages.DeleteTaxonBaseHandler_CONFIRM_DELETION, Messages.DeleteTaxonBaseHandler_REALLY_DELETE_TAXON)){
return ;
}
}
else {
- throw new IllegalArgumentException("Element has to be Synonym, Misapplication or Concept");
+ throw new IllegalArgumentException(Messages.DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT);
}
AbstractUtility.executeOperation(operation);
UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URI is invalid.\r
UriWithLabelElement_INVALID_URL=Invalid URI\r
UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Open in external browser\r
+\r
+ChangeConnectionHandler_ALREADY_CONNECTING=Already connecting\r
+ChangeConnectionHandler_CONFIRM_DATASOURCE=Confirm Datasource Connection\r
+ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=You are currently connecting to a different datasource already.\r
+ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE=Chosen datasource is not available\r
+ChangeConnectionHandler_REALLY_WANT_TO_CONNECT=Do you really want to connect to this datasource?\n\n\r
+ChangeConnectionHandler_NOT_AVAILABLE_REASONS=This could mean that either the database server is not running or the machine is not reachable.\n\n Please also make sure that you are connected to the network when trying to connect to a remote datasource.\r
+\r
+LoginDialog_CANCEL_MESSAGE=Aborting the login procedure will close the database.\r
+LoginDialog_LOGIN=Login\r
+LoginDialog_PASSWORD=Password\r
+LoginDialog_REALLY_CANCEL=Do you really want to cancel?\r
+LoginDialog_USER_LOGIN=User Login\r
+LoginDialog_USER_NAME=Username\r
UriWithLabelElement_URL_NOT_SAVED=URI wird nicht gespeichert\!
UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnte nicht geöffnet werden. URI ist ung\u00FCtlig.
UriWithLabelElement_INVALID_URL=Ung\u00FCltige URI
-UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Im Browser öffnen
\ No newline at end of file
+UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Im Browser öffnen
+
+ChangeConnectionHandler_ALREADY_CONNECTING=Verbindung wird aufgebaut
+ChangeConnectionHandler_CONFIRM_DATASOURCE=Verbindung bestätigen
+ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=Es wird schon eine Verbindung zu einer Datenquelle aufgebaut
+ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE=Gewählte Datenquelle nicht verfügbar
+ChangeConnectionHandler_REALLY_WANT_TO_CONNECT=Wollen Sie sich wirklich mit dieser Datenquelle verbinden?\n\n
+ChangeConnectionHandler_NOT_AVAILABLE_REASONS=Eventuell ist der Server nicht verfügbar oder erreichbar.\n\nStellen Sie bitte auch sicher, dass sie Netzzugang haben, wenn sie sich zu einer Remote-Datenquelle verbinden.
+
+LoginDialog_CANCEL_MESSAGE=Ein Abbruch wird die Verbindung zur Datenquelle schließen.
+LoginDialog_LOGIN=Login
+LoginDialog_PASSWORD=Passwort
+LoginDialog_REALLY_CANCEL=Wollen Sie wirklich abbrechen?
+LoginDialog_USER_LOGIN=Benutzer Login
+LoginDialog_USER_NAME=Benutzername
public static String LanguageEditorPreferencePage_EditorHasToRestart;
public static String LanguageEditorPreferencePage_PleaseRestart;
public static String LanguageEditorPreferencePage_RestartRequired;
+ public static String LoginDialog_CANCEL_MESSAGE;
+ public static String LoginDialog_LOGIN;
+ public static String LoginDialog_PASSWORD;
+ public static String LoginDialog_REALLY_CANCEL;
+ public static String LoginDialog_USER_LOGIN;
+ public static String LoginDialog_USER_NAME;
public static String OrderPreferencePage_NewNavigatorWindowRequired;
public static String OrderPreferencePage_PleaseReopenNavigator;
public static String CdmDataSourceViewPart_1;
public static String CdmDataSourceViewPart_7;
public static String CdmDataSourceViewPart_8;
public static String CdmDataSourceViewPart_9;
+ public static String ChangeConnectionHandler_ALREADY_CONNECTING;
+ public static String ChangeConnectionHandler_CONFIRM_DATASOURCE;
+ public static String ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY;
+ public static String ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE;
+ public static String ChangeConnectionHandler_REALLY_WANT_TO_CONNECT;
+ public static String ChangeConnectionHandler_NOT_AVAILABLE_REASONS;
public static String UriWithLabelElement_COULD_NOT_OPEN_BROWSER;
public static String UriWithLabelElement_INVALID_URL;
public static String UriWithLabelElement_OPEN_EXTERNAL_BROWSER;
// $Id$
/**
* Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
+ * European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
- *
+ *
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import eu.etaxonomy.taxeditor.Messages;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* TODO wrap in a LoginModule
* @version 1.0
*/
public class LoginDialog extends Dialog {
-
+
private static Text text_password;
private static Text text_username;
- private String title;
+ private final String title;
- /**
- * <p>Constructor for LoginDialog.</p>
- *
- * @param parentShell a {@link org.eclipse.swt.widgets.Shell} object.
- */
public LoginDialog(Shell parentShell) {
super(parentShell);
- title = "Login";
+ title = Messages.LoginDialog_LOGIN;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
+
/** {@inheritDoc} */
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
//add controls to composite as necessary
-
+
// Label for the heading
final CLabel titleLabel = new CLabel(composite, SWT.NONE);
- titleLabel.setText("User Login");
+ titleLabel.setText(Messages.LoginDialog_USER_LOGIN);
// Label for the username
final CLabel userNameLabel = new CLabel(composite, SWT.NONE);
- userNameLabel.setText("Username");
+ userNameLabel.setText(Messages.LoginDialog_USER_NAME);
// Textfield for the username
text_username = new Text(composite, SWT.BORDER);
// Label for the password
final CLabel passwordLabel = new CLabel(composite, SWT.NONE);
- passwordLabel.setText("Password");
+ passwordLabel.setText(Messages.LoginDialog_PASSWORD);
// Textfield for the password
text_password = new Text(composite, SWT.PASSWORD | SWT.BORDER);
text_password.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
-
+
+
return composite;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
/** {@inheritDoc} */
+ @Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
if (title != null) {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
/** {@inheritDoc} */
@Override
protected void okPressed() {
String username = text_username.getText();
String password = text_password.getText();
-
+
boolean result = CdmStore.getLoginManager().authenticate(username, password);
-
+
if(result){
super.okPressed();
}
-
- }
-
+
+ }
+
@Override
- protected void cancelPressed() {
+ protected void cancelPressed() {
if(CdmStore.getLoginManager().getAuthenticatedUser() != null){
super.cancelPressed();
}else{
// if there is no active user and the current user chooses to cancel, we close the connection
- boolean result = MessageDialog.openConfirm(getShell(), "Do you really want to cancel", "Aborting the login procedure will close the database.");
-
+ boolean result = MessageDialog.openConfirm(getShell(), Messages.LoginDialog_REALLY_CANCEL, Messages.LoginDialog_CANCEL_MESSAGE);
+
if(result){
- CdmStore.close(StoreUtil.getMonitor());
+ CdmStore.close(AbstractUtility.getMonitor());
super.cancelPressed();
}
}
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
- * <p>FilteredNamedAreaSelectionDialog class.</p>
- *
* @author n.hoffmann
* @created May 11, 2010
* @version 1.0
}
private Collection<TermVocabulary<NamedArea>> selectedVocabularies;
- private final ArrayList<TermVocabulary> preselectedVocabularies;
+ private ArrayList<TermVocabulary> preselectedVocabularies;
/**
return getSelectionFromDialog(dialog);
}
- /**
- * <p>Constructor for FilteredNamedAreaSelectionDialog.</p>
- *
- * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
- * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
- * @param title a {@link java.lang.String} object.
- * @param multi a boolean.
- * @param namedArea a {@link eu.etaxonomy.cdm.model.location.NamedArea} object.
- * @param preselectedVocabularyUuids the {@link UUID}s of the pre-selected Vocabularies
- */
protected NamedAreaSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, NamedArea namedArea, UUID... preselectedVocabularyUuids) {
super(shell, conversation, title, multi, NamedAreaSelectionDialog.class.getCanonicalName(), namedArea);
- preselectedVocabularies = new ArrayList<TermVocabulary>();
- for(int i=0;i<preselectedVocabularyUuids.length;i++){
- TermVocabulary preselectedVocabulary = CdmStore.getService(IVocabularyService.class).find(preselectedVocabularyUuids[i]);
- preselectedVocabularies.add(preselectedVocabulary);
+ if(preselectedVocabularyUuids.length>0){
+ preselectedVocabularies = new ArrayList<TermVocabulary>();
+ for(int i=0;i<preselectedVocabularyUuids.length;i++){
+ TermVocabulary preselectedVocabulary = CdmStore.getService(IVocabularyService.class).find(preselectedVocabularyUuids[i]);
+ preselectedVocabularies.add(preselectedVocabulary);
+ }
+ selectedVocabularies.retainAll(preselectedVocabularies);
+ initModel();//re-init to consider pre-selected vocabularies
}
- selectedVocabularies.retainAll(preselectedVocabularies);
- initModel();//re-init to consider pre-selected vocabularies
}
/** {@inheritDoc} */
for(TermVocabulary<NamedArea> vocabulary : getAvailableVocabularies()){
IncludeNamedAreaVocabulary action = new IncludeNamedAreaVocabulary(vocabulary);
menuManager.add(action);
- if(preselectedVocabularies.isEmpty() || preselectedVocabularies.contains(vocabulary)) {
+ if(preselectedVocabularies==null || preselectedVocabularies.isEmpty() || preselectedVocabularies.contains(vocabulary)) {
action.setChecked(true);
}
}
/** {@inheritDoc} */
@Override
public void setEnabled(boolean enabled) {
+
button_selection.setEnabled(enabled);
if (isDeletable){
button_remove.setEnabled(enabled);
if (isEditable) {
updateButtonStates();
}
+
}
/* (non-Javadoc)
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
+import eu.etaxonomy.taxeditor.Messages;
import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
CdmMetaDataAwareDataSourceContainer container = (CdmMetaDataAwareDataSourceContainer) ((IStructuredSelection) selection).getFirstElement();
if(CdmStore.isConnecting()){
- MessagingUtils.warningDialog("Already connecting", this, "You are currently connecting to a different datasource already.");
+ MessagingUtils.warningDialog(Messages.ChangeConnectionHandler_ALREADY_CONNECTING, this, Messages.ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY);
return null;
}
try {
container.getCdmSource().checkConnection();
- boolean confirmed = MessagingUtils.confirmDialog("Confirm Datasource Connection", "Do you really want to connect to this datasource?\n\n"
+ boolean confirmed = MessagingUtils.confirmDialog(Messages.ChangeConnectionHandler_CONFIRM_DATASOURCE, Messages.ChangeConnectionHandler_REALLY_WANT_TO_CONNECT
+ container.getCdmSource().getName());
if(confirmed){
CdmDataSourceRepository.changeDataSource(container.getCdmSource());
}
} catch (Exception e) {
- MessagingUtils.warningDialog("Chosen datasource is not available", this, "This could mean that either the database server is " +
- "not running or the machine is not reachable.\n\n" +
- "Please also make sure that you are connected to the network when trying to connect to a remote datasource.");
+ MessagingUtils.warningDialog(Messages.ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE, this, Messages.ChangeConnectionHandler_NOT_AVAILABLE_REASONS);
MessagingUtils.warn(getClass(), e);
return null;
}
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import eu.etaxonomy.taxeditor.view.datasource.CdmMetaDataAwareDataSourceContainer;
/**
- * <p>DeleteDataSourceHandler class.</p>
- *
* @author n.hoffmann
* @created 15.04.2009
* @version 1.0
*/
public class DeleteDataSourceHandler extends AbstractDataSourceHandler {
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.store.datasource.handler.AbstractDataSourceHandler#specificExecute(org.eclipse.core.commands.ExecutionEvent)
- */
/** {@inheritDoc} */
@Override
public boolean specificExecute(ExecutionEvent event) {
ISelection selection = HandlerUtil.getActivePart(event).getSite().getSelectionProvider().getSelection();
if(selection instanceof IStructuredSelection){
Object[] selectedObjects = ((IStructuredSelection) selection).toArray();
-
+
if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you want to delete the selected datasources?")){
return false;
}
- // Delete from persistent data sources
+ // Delete from persistent data sources
for(Object object : selectedObjects){
CdmPersistentDataSource dataSource = (CdmPersistentDataSource) ((CdmMetaDataAwareDataSourceContainer) object).getCdmSource();
CdmDataSourceRepository.delete(dataSource);
}
-
+
return true;
}
return false;