From 6eb36edc560f9516ea781755f6242de1cbf050ad Mon Sep 17 00:00:00 2001 From: Luca Piccarreta Date: Wed, 6 Mar 2024 16:28:14 +0100 Subject: [PATCH] Removed option for history frame from new host page wizard (#449) --- .../core/wizards/NewHostPageWizard.java | 5 --- .../core/wizards/NewHostPageWizardPage.java | 35 +++---------------- 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/plugins/com.gwtplugins.gwt.eclipse.core/src/com/google/gwt/eclipse/core/wizards/NewHostPageWizard.java b/plugins/com.gwtplugins.gwt.eclipse.core/src/com/google/gwt/eclipse/core/wizards/NewHostPageWizard.java index 0b5a0b32..3a3efe3e 100644 --- a/plugins/com.gwtplugins.gwt.eclipse.core/src/com/google/gwt/eclipse/core/wizards/NewHostPageWizard.java +++ b/plugins/com.gwtplugins.gwt.eclipse.core/src/com/google/gwt/eclipse/core/wizards/NewHostPageWizard.java @@ -167,11 +167,6 @@ protected InputStream getInitialContents() { sb.append("\n"); sb.append(" \n"); - // Inject history frame, if desired - if (wizardPage.isHistorySupportIncluded()) { - sb.append(" \n"); - } - sb.append("\n"); sb.append(" \n"); sb.append(""); diff --git a/plugins/com.gwtplugins.gwt.eclipse.core/src/com/google/gwt/eclipse/core/wizards/NewHostPageWizardPage.java b/plugins/com.gwtplugins.gwt.eclipse.core/src/com/google/gwt/eclipse/core/wizards/NewHostPageWizardPage.java index 928e1f7b..108aa9e9 100644 --- a/plugins/com.gwtplugins.gwt.eclipse.core/src/com/google/gwt/eclipse/core/wizards/NewHostPageWizardPage.java +++ b/plugins/com.gwtplugins.gwt.eclipse.core/src/com/google/gwt/eclipse/core/wizards/NewHostPageWizardPage.java @@ -44,7 +44,6 @@ import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener; import org.eclipse.jdt.internal.ui.wizards.dialogfields.IStringButtonAdapter; import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; -import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogFieldGroup; import org.eclipse.jdt.internal.ui.wizards.dialogfields.Separator; import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField; @@ -55,7 +54,6 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.dialogs.ElementListSelectionDialog; @@ -74,10 +72,12 @@ public class NewHostPageWizardPage extends WizardPage { private class HostPageFieldAdapter implements IDialogFieldListener, IModulesChangeListener { + @Override public void dialogFieldChanged(DialogField field) { validateFields(); } + @Override public void onModulesChanged() { validateFields(); } @@ -86,6 +86,7 @@ public void onModulesChanged() { private class PathFieldAdapter extends HostPageFieldAdapter implements IStringButtonAdapter { + @Override public void changeControlPressed(DialogField field) { IPath path = choosePath(new Path(pathField.getText())); if (path != null) { @@ -97,6 +98,7 @@ public void changeControlPressed(DialogField field) { private class ProjectFieldAdapter extends HostPageFieldAdapter implements IStringButtonAdapter { + @Override public void changeControlPressed(DialogField field) { IJavaProject jproject = chooseProject(); if (jproject != null) { @@ -110,8 +112,6 @@ public void changeControlPressed(DialogField field) { private StringDialogField fileNameField; - private SelectionButtonDialogFieldGroup hostPageElementsButtons; - private IPath hostPagePath; private IProject hostPageProject; @@ -149,13 +149,9 @@ protected NewHostPageWizardPage() { modulesBlock = new EntryPointModulesSelectionBlock("Modules:", new HostPageFieldAdapter()); - - String[] buttonNames = new String[] {"Support for browser history (Back, Forward, bookmarks)"}; - hostPageElementsButtons = new SelectionButtonDialogFieldGroup(SWT.CHECK, - buttonNames, 1); - hostPageElementsButtons.setLabelText("Which elements do you want to include in your page?"); } + @Override public void createControl(Composite parent) { initializeDialogUnits(parent); Composite composite = new Composite(parent, SWT.NONE); @@ -172,7 +168,6 @@ public void createControl(Composite parent) { createFileNameControls(composite, columns); createModulesComponent(composite, columns); - createPageElementsControls(composite, columns); } public String getFileName() { @@ -208,16 +203,10 @@ public void init(IResource selection) { initModules(selection); } - setPageElementsSelection(true); - // Validate the initial field values validateFields(); } - public boolean isHistorySupportIncluded() { - return hostPageElementsButtons.isSelected(0); - } - @Override public void setVisible(boolean visible) { super.setVisible(visible); @@ -286,16 +275,6 @@ private void createModulesComponent(Composite parent, int columns) { modulesBlock.doFillIntoGrid(parent, columns); } - private void createPageElementsControls(Composite composite, int nColumns) { - Control labelControl = hostPageElementsButtons.getLabelControl(composite); - LayoutUtil.setHorizontalSpan(labelControl, nColumns); - - DialogField.createEmptySpace(composite); - - Control buttonGroup = hostPageElementsButtons.getSelectionButtonsGroup(composite); - LayoutUtil.setHorizontalSpan(buttonGroup, nColumns - 1); - } - private void createPathControls(Composite composite, int columns) { pathField.doFillIntoGrid(composite, columns); setFieldWidthHint(pathField); @@ -383,10 +362,6 @@ private void setFocus() { fileNameField.setFocus(); } - private void setPageElementsSelection(boolean historySupport) { - hostPageElementsButtons.setSelection(0, historySupport); - } - private void updateModulesIfProjectChanged() { if (hostPageProject != null) { if (hostPageProject != null