X-Git-Url: https://code.grnet.gr/git/pithos-web-client/blobdiff_plain/f6445935289ba68a8feb08ba41dde1d44433fb6d..c8f8690d6f1bb17e72ce5e0e4f1962c5446a2b23:/src/gr/grnet/pithos/web/client/AbstractPropertiesDialog.java diff --git a/src/gr/grnet/pithos/web/client/AbstractPropertiesDialog.java b/src/gr/grnet/pithos/web/client/AbstractPropertiesDialog.java index fc2a7b9..9bc9475 100644 --- a/src/gr/grnet/pithos/web/client/AbstractPropertiesDialog.java +++ b/src/gr/grnet/pithos/web/client/AbstractPropertiesDialog.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 GRNET S.A. All rights reserved. + * Copyright 2011-2012 GRNET S.A. All rights reserved. * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following @@ -38,9 +38,7 @@ import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.user.client.Event.NativePreviewEvent; import com.google.gwt.user.client.ui.DialogBox; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.TabPanel; -import com.google.gwt.user.client.ui.TextBox; +import com.google.gwt.user.client.ui.VerticalPanel; /** * Abstract class, parent of all 'File properties' dialog boxes. @@ -50,20 +48,7 @@ public abstract class AbstractPropertiesDialog extends DialogBox { protected static final String MULTIPLE_VALUES_TEXT = "(Multiple values)"; - /** - * Text box with the tags associated with the file - */ - protected TextBox tags = new TextBox(); - - protected String initialTagText; - - /** - * A FlowPanel with all user tags - */ - protected FlowPanel allTagsContent; - - - protected TabPanel inner = null; + protected VerticalPanel inner = null; protected Pithos app; @@ -75,16 +60,14 @@ public abstract class AbstractPropertiesDialog extends DialogBox { app = _app; // Enable IE selection for the dialog (must disable it upon closing it) Pithos.enableIESelection(); - - setAnimationEnabled(true); - } /** * Accepts any change and updates the file + * @return * */ - protected abstract void accept(); + protected abstract boolean accept(); @Override protected void onPreviewNativeEvent(NativePreviewEvent preview) { @@ -96,20 +79,15 @@ public abstract class AbstractPropertiesDialog extends DialogBox { // enter or escape is pressed. switch (evt.getKeyCode()) { case KeyCodes.KEY_ENTER: - accept(); - case KeyCodes.KEY_ESCAPE: + if (accept()) + closeDialog(); + break; + case KeyCodes.KEY_ESCAPE: closeDialog(); break; } } - - - public void selectTab(int _tab) { - inner.selectTab(_tab); - } - - /** * Enables IE selection prevention and hides the dialog * (we disable the prevention on creation of the dialog)