Permalink
Browse files

Removes more unused features

  • Loading branch information...
UrsKR committed Jun 7, 2012
1 parent add8a61 commit 496eefc0bd0a165134cfe6100816b92c7f0127ea
@@ -59,8 +59,7 @@ public DefaultDialogConfiguration(P dialogPage, IDialogButtonConfiguration butto
public DefaultDialogConfiguration(P dialogPage, IDialogButtonConfiguration buttonConfiguration,
IDialogVisibilitySetting dialogVisibilitySetting) {
- this(dialogPage, buttonConfiguration, DialogHeaderPanelConfiguration.createVisibleWithoutIcon(), null, null, null,
- (IDialogVisibilitySetting) null);
+ this(dialogPage, buttonConfiguration, DialogHeaderPanelConfiguration.createVisibleWithoutIcon(), null, null, (IDialogVisibilitySetting) null);
}
/**
@@ -70,29 +69,19 @@ public DefaultDialogConfiguration(P dialogPage, IDialogButtonConfiguration butto
public DefaultDialogConfiguration(P dialogPage, IDialogButtonConfiguration buttonConfiguration,
Dimension customizedPreferedSize, IDialogPreferences preferences) {
this(dialogPage, buttonConfiguration, DialogHeaderPanelConfiguration.createVisibleWithoutIcon(),
- customizedPreferedSize, preferences, null);
- }
-
- public DefaultDialogConfiguration(P dialogPage, IDialogButtonConfiguration buttonConfiguration,
- IDialogHeaderPanelConfiguration headerPanelConfiguration,
- Dimension customizedPreferedSize, IDialogPreferences preferences,
- JComponent[] additionalButtons) {
- this(dialogPage, buttonConfiguration, headerPanelConfiguration, customizedPreferedSize, preferences,
- additionalButtons, (IDialogVisibilitySetting) null);
+ customizedPreferedSize, preferences, (IDialogVisibilitySetting) null);
}
/**
* Use {@link DefaultDialogConfigurationBuilder} to create a configuration
*/
public DefaultDialogConfiguration(P dialogPage, IDialogButtonConfiguration buttonConfiguration,
IDialogHeaderPanelConfiguration headerPanelConfiguration,
- Dimension customizedPreferedSize, IDialogPreferences preferences,
- JComponent[] additionalButtons,
- final IVetoDialogCloseHandler vetoDialogCloseHandler) {
+ Dimension customizedPreferedSize, IDialogPreferences preferences, final IVetoDialogCloseHandler vetoDialogCloseHandler) {
super(buttonConfiguration, headerPanelConfiguration, preferences);
this.dialogPage = dialogPage;
this.customizedPreferedSize = customizedPreferedSize;
- this.additionalButtons = additionalButtons;
+ this.additionalButtons = new JComponent[0];
this.dialogVisibilitySetting = null;
this.vetoDialogCloseHandler = new IVetoDialogCloseHandler() {
@@ -107,20 +96,17 @@ public boolean handleDialogAboutToClose(IDialogResult result, Component parentCo
public DefaultDialogConfiguration(P dialogPage, IDialogButtonConfiguration buttonConfiguration,
IDialogHeaderPanelConfiguration headerPanelConfiguration,
Dimension customizedPreferedSize, IDialogPreferences preferences,
- JComponent[] additionalButtons, IDialogVisibilitySetting dialogVisibilitySetting) {
+ IDialogVisibilitySetting dialogVisibilitySetting) {
super(buttonConfiguration, headerPanelConfiguration, preferences);
this.dialogPage = dialogPage;
this.customizedPreferedSize = customizedPreferedSize;
- this.additionalButtons = additionalButtons;
+ this.additionalButtons = new JComponent[0];
this.dialogVisibilitySetting = dialogVisibilitySetting;
this.vetoDialogCloseHandler = new IVetoDialogCloseHandler() {
@Override
public boolean handleDialogAboutToClose(IDialogResult result, Component parentComponent) {
updateDialogVisibilitySetting(result);
- if (result.isCanceled()) {
- return performCancel(parentComponent);
- }
- return performOk(parentComponent);
+ return true;
}
};
@@ -173,16 +159,6 @@ public IVetoDialogCloseHandler getVetoCloseHandler() {
return vetoDialogCloseHandler;
}
- @Deprecated
- public boolean performOk(Component parentComponent) {
- return true;
- }
-
- @Deprecated
- public boolean performCancel(Component parentComponent) {
- return true;
- }
-
@Override
public Dimension getCustomizedPreferedSize() {
return customizedPreferedSize;
@@ -9,11 +9,8 @@
import net.sf.anathema.lib.gui.dialog.userdialog.buttons.IDialogButtonConfiguration;
import net.sf.anathema.lib.gui.dialog.userdialog.page.IDialogPage;
-import javax.swing.JComponent;
import java.awt.Component;
import java.awt.Dimension;
-import java.util.ArrayList;
-import java.util.List;
public class DefaultDialogConfigurationBuilder<P extends IDialogPage> {
@@ -22,7 +19,6 @@
private IDialogHeaderPanelConfiguration headerPanelConfiguration = DialogHeaderPanelConfiguration.createVisibleWithoutIcon();
private Dimension customizedPreferedSize = null;
private IDialogPreferences preferences = null;
- private final List<JComponent> additionalButtons = new ArrayList<JComponent>();
private IVetoDialogCloseHandler vetoDialogCloseHander = new IVetoDialogCloseHandler() {
@Override
@@ -37,8 +33,7 @@ public DefaultDialogConfigurationBuilder(P dialogPage) {
public DefaultDialogConfiguration<P> build() {
return new DefaultDialogConfiguration<P>(dialogPage, buttonConfiguration, headerPanelConfiguration,
- customizedPreferedSize, preferences, additionalButtons.toArray(new JComponent[additionalButtons.size()]),
- vetoDialogCloseHander);
+ customizedPreferedSize, preferences, vetoDialogCloseHander);
}
public void setButtonConfiguration(IDialogButtonConfiguration buttonConfiguration) {
@@ -54,17 +54,4 @@
* This method is called just before the wizard becomes visible, to give the wizard the
* opportunity to add any lazily created pages.*/
void addPages();
-
- /** Returns the successor of the given page.
- * This method is typically called by a wizard page
- * @param page the page
- * @return the next page, or null if none */
- IWizardPage getNextPage(IWizardPage page);
-
- /** Returns the predecessor of the given page.
- * This method is typically called by a wizard page
- * @param page the page
- * @return the previous page, or null if none */
-
- IWizardPage getPreviousPage(IWizardPage page);
}
@@ -4,12 +4,6 @@
import net.sf.anathema.lib.gui.dialog.core.IPageContent;
import net.sf.anathema.lib.message.IBasicMessage;
-/**
- * Interface for a wizard page.
- *
- * The class {@link AbstractWizardPage} provides an abstract implementation of this interface. However,
- * clients are also free to implement this interface if WizardPage does not suit their needs.
- */
public interface IWizardPage extends IPage {
/**
@@ -43,26 +37,11 @@
*/
boolean canCancel();
- /** Returns the wizard that hosts this wizard page.
- * @deprecated As of 29.05.2009 (gebhard) - use listeners or other ways to retrieve the required
- * information
- */
- @Deprecated
- IWizardConfiguration getWizard();
-
/**
* Sets the current message for this page. May be <code>null</code> to indicate no
* message. An error message should describe some error state, as opposed to an information
* message which may simply provide instruction or information to the user.
* @param message the message
*/
void setMessage(IBasicMessage message);
-
- /** Initializes all widgets from the data attached to this wizard page. This method will be called
- * from the wizard container after creating the content.
- * @deprecated As of 10.12.2004 (gebhard)
- * @see #getContent() */
- @Deprecated
- void initializeFromData();
-
}
@@ -89,7 +89,7 @@ protected void execute(Component parentComponent) {
nextButton = new JButton(nextAction);
- IDialogButtonConfiguration buttonConfiguration = getWizard().getButtonConfiguration();
+ IDialogButtonConfiguration buttonConfiguration = configuration.getButtonConfiguration();
final IActionConfiguration okActionConfiguration = buttonConfiguration
.getOkActionConfiguration();
@@ -187,8 +187,8 @@ public void updateButtons() {
IWizardPage page = getCurrentPage();
nextButton.setEnabled(page.canFlipToNextPage());
backButton.setEnabled(page.getPreviousPage() != null);
- finishButton.setEnabled(getWizard().canFinish());
- cancelButton.setEnabled(getWizard().canCancel());
+ finishButton.setEnabled(configuration.canFinish());
+ cancelButton.setEnabled(configuration.canCancel());
if (finishButton.isEnabled()) {
setDefaultButton(finishButton);
}
@@ -222,7 +222,7 @@ public final IDialogResult show() {
/** For internal use only (demos) */
public ISwingFrameOrDialog getConfiguredDialog() {
- IWizardPage startingPage = getWizard().getStartingPage();
+ IWizardPage startingPage = configuration.getStartingPage();
if (startingPage == null) {
throw new RuntimeException("Starting page may not be null in IWizard.getStartingPage()"); //$NON-NLS-1$
}
@@ -238,10 +238,6 @@ public ISwingFrameOrDialog getConfiguredDialog() {
return configuredDialog;
}
- protected final IWizardConfiguration getWizard() {
- return configuration;
- }
-
private void performFinish(Component parentComponent) {
currentPage.getNextPage();
currentPage.leave();
@@ -2,7 +2,6 @@
import com.google.common.base.Preconditions;
import net.sf.anathema.lib.gui.dialog.input.RequestFinishListener;
-import net.sf.anathema.lib.gui.dialog.wizard.IWizardConfiguration;
import net.sf.anathema.lib.gui.dialog.wizard.IWizardPage;
import net.sf.anathema.lib.gui.wizard.workflow.CheckInputListener;
import net.sf.anathema.lib.gui.wizard.workflow.ICondition;
@@ -17,7 +16,6 @@
private IBasicMessage message = new BasicMessage("!!! UNSET-MESSAGE !!!");
private final Announcer<RequestFinishListener> requestFinishListeners = Announcer.to(RequestFinishListener.class);
- private IWizardConfiguration wizard = null;
private IAnathemaWizardPage previousPage = null;
protected final Map<ICondition, IAnathemaWizardPage> followUpPagesByCondition = new HashMap<ICondition, IAnathemaWizardPage>();
@@ -73,15 +71,6 @@ public boolean canCancel() {
return true;
}
- @Override
- public IWizardConfiguration getWizard() {
- return wizard;
- }
-
- @Override
- public void initializeFromData() {
- }
-
@Override
public void addRequestFinishListener(RequestFinishListener requestFinishListener) {
requestFinishListeners.addListener(requestFinishListener);
@@ -54,13 +54,4 @@ public IWizardPage getStartingPage() {
public void addPages() {
}
- @Override
- public IWizardPage getNextPage(IWizardPage page) {
- return page != null ? page.getNextPage() : null;
- }
-
- @Override
- public IWizardPage getPreviousPage(IWizardPage page) {
- return page != null ? page.getPreviousPage() : null;
- }
}
@@ -55,11 +55,6 @@ protected void initModelListening(CheckInputListener inputListener) {
model.addListener(inputListener);
}
- @Override
- public void initializeFromData() {
- // nothing to do
- }
-
@Override
protected void initPageContent() {
final IListObjectSelectionView<V> listView = view.addSelectionView();

0 comments on commit 496eefc

Please sign in to comment.