diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/FeatureErrorReporter.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/FeatureErrorReporter.java index a30e3443cc..8f8af04507 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/FeatureErrorReporter.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/FeatureErrorReporter.java @@ -31,7 +31,6 @@ import org.eclipse.pde.internal.core.ibundle.IBundlePluginModel; import org.eclipse.pde.internal.core.ibundle.IManifestHeader; import org.eclipse.pde.internal.core.ifeature.IFeatureModel; -import org.eclipse.pde.internal.core.util.CoreUtility; import org.eclipse.pde.internal.core.util.IdUtil; import org.w3c.dom.Attr; import org.w3c.dom.Element; @@ -460,12 +459,6 @@ private void validateUnpack(Element parent) { } } } - - if ("true".equals(unpack) && !CoreUtility.guessUnpack(pModel.getBundleDescription())) {//$NON-NLS-1$ - String message = NLS.bind(PDECoreMessages.Builders_Feature_missingUnpackFalse, (new String[] {parent.getAttribute("id"), "unpack=\"false\""})); //$NON-NLS-1$ //$NON-NLS-2$ - VirtualMarker marker = report(message, getLine(parent), severity, PDEMarkerFactory.CAT_OTHER); - addMarkerAttribute(marker, PDEMarkerFactory.compilerKey, CompilerFlags.F_UNRESOLVED_PLUGINS); - } } /** diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/PluginExportOperation.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/PluginExportOperation.java index d63a8256ab..849739b819 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/PluginExportOperation.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/PluginExportOperation.java @@ -20,8 +20,6 @@ import org.eclipse.osgi.service.resolver.State; import org.eclipse.pde.core.plugin.TargetPlatform; import org.eclipse.pde.internal.core.TargetPlatformHelper; -import org.eclipse.pde.internal.core.util.CoreUtility; -import org.w3c.dom.Element; public class PluginExportOperation extends FeatureBasedExportOperation { @@ -61,10 +59,4 @@ protected boolean shouldAddPlugin(BundleDescription bundle, Dictionary 0) { - writer.println(); - writer.print(indent2 + "download-size=\"" + getDownloadSize() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ - } - if (getInstallSize() > 0) { - writer.println(); - writer.print(indent2 + "install-size=\"" + getInstallSize() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ - } } private void writeAttribute(String attribute, String value, String indent2, PrintWriter writer) { @@ -209,48 +195,6 @@ public void setFilter(String filter) throws CoreException { firePropertyChanged(P_FILTER, oldValue, filter); } - /** - * Gets the downloadSize. - * @return Returns a int - */ - @Override - public long getDownloadSize() { - return downloadSize; - } - - /** - * Sets the downloadSize. - * @param downloadSize The downloadSize to set - */ - @Override - public void setDownloadSize(long downloadSize) throws CoreException { - ensureModelEditable(); - Object oldValue = Long.valueOf(this.downloadSize); - this.downloadSize = downloadSize; - firePropertyChanged(P_DOWNLOAD_SIZE, oldValue, Long.valueOf(downloadSize)); - } - - /** - * Gets the installSize. - * @return Returns a int - */ - @Override - public long getInstallSize() { - return installSize; - } - - /** - * Sets the installSize. - * @param installSize The installSize to set - */ - @Override - public void setInstallSize(long installSize) throws CoreException { - ensureModelEditable(); - Object oldValue = Long.valueOf(this.installSize); - this.installSize = installSize; - firePropertyChanged(P_INSTALL_SIZE, oldValue, Long.valueOf(installSize)); - } - @Override public void restoreProperty(String name, Object oldValue, Object newValue) throws CoreException { switch (name) { @@ -266,12 +210,6 @@ public void restoreProperty(String name, Object oldValue, Object newValue) throw case P_ARCH: setArch((String) newValue); break; - case P_DOWNLOAD_SIZE: - setDownloadSize(newValue != null ? ((Integer) newValue).intValue() : 0); - break; - case P_INSTALL_SIZE: - setInstallSize(newValue != null ? ((Integer) newValue).intValue() : 0); - break; default: super.restoreProperty(name, oldValue, newValue); break; diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeaturePlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeaturePlugin.java index 368fc62b65..949a2f0b35 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeaturePlugin.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeaturePlugin.java @@ -32,7 +32,6 @@ public class FeaturePlugin extends FeatureData implements IFeaturePlugin { private static final long serialVersionUID = 1L; private boolean fFragment; private String fVersion; - private boolean fUnpack = true; public FeaturePlugin() { } @@ -84,11 +83,6 @@ public String getVersion() { return fVersion; } - @Override - public boolean isUnpack() { - return fUnpack; - } - @Override public void setVersion(String version) throws CoreException { ensureModelEditable(); @@ -97,14 +91,6 @@ public void setVersion(String version) throws CoreException { firePropertyChanged(this, P_VERSION, oldValue, version); } - @Override - public void setUnpack(boolean unpack) throws CoreException { - ensureModelEditable(); - boolean oldValue = fUnpack; - this.fUnpack = unpack; - firePropertyChanged(this, P_UNPACK, Boolean.valueOf(oldValue), Boolean.valueOf(unpack)); - } - @Override public void restoreProperty(String name, Object oldValue, Object newValue) throws CoreException { if (name.equals(P_VERSION)) { @@ -127,10 +113,6 @@ protected void parse(Node node) { if (f != null && f.equalsIgnoreCase("true")) { //$NON-NLS-1$ fFragment = true; } - String unpack = getNodeAttribute(node, "unpack"); //$NON-NLS-1$ - if (unpack != null && unpack.equalsIgnoreCase("false")) { //$NON-NLS-1$ - fUnpack = false; - } } public void loadFrom(IPluginBase plugin) { diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureEntry.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureEntry.java index 0afc0d6b3f..76ff01f0d7 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureEntry.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeatureEntry.java @@ -26,24 +26,11 @@ public interface IFeatureEntry extends IFeatureObject, IIdentifiable, IEnvironme String P_NL = "p_nl"; //$NON-NLS-1$ String P_ARCH = "p_arch"; //$NON-NLS-1$ String P_FILTER = "p_filter"; //$NON-NLS-1$ - String P_DOWNLOAD_SIZE = "p_download_size"; //$NON-NLS-1$ - String P_INSTALL_SIZE = "p_install_size"; //$NON-NLS-1$ /** * Returns an LDAP filter that must be satisfied for this entry */ String getFilter(); - - /** - * Returns estimated download size of this plug-in. - */ - long getDownloadSize(); - - /** - * Returns estimated size of this plug-in when installed. - */ - long getInstallSize(); - /** * Sets an LDAP filter on this plugin */ @@ -52,10 +39,4 @@ public interface IFeatureEntry extends IFeatureObject, IIdentifiable, IEnvironme /** * Sets the estimated download size of this plug-in. */ - void setDownloadSize(long size) throws CoreException; - - /** - * Sets the estimated size of this plug-in when installed. - */ - void setInstallSize(long size) throws CoreException; } diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeaturePlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeaturePlugin.java index 77a7221899..a04b68c6d8 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeaturePlugin.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ifeature/IFeaturePlugin.java @@ -13,25 +13,13 @@ *******************************************************************************/ package org.eclipse.pde.internal.core.ifeature; -import org.eclipse.core.runtime.CoreException; - /** * A base class for plug-in and data entires */ public interface IFeaturePlugin extends IFeatureObject, IVersionable, IFeatureEntry { - /** - * A property that will be carried by the change event - * if 'unpack' field of this object is changed. - */ - public static final String P_UNPACK = "unpack"; //$NON-NLS-1$ - /** * Returns whether this is a reference to a fragment. * @return true if this is a fragment, false otherwise. */ - public boolean isFragment(); - - public boolean isUnpack(); - - public void setUnpack(boolean unpack) throws CoreException; + boolean isFragment(); } diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/CoreUtility.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/CoreUtility.java index 00168d8885..684e52cc4b 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/CoreUtility.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/util/CoreUtility.java @@ -43,14 +43,11 @@ import org.eclipse.pde.core.plugin.IPluginModelBase; import org.eclipse.pde.core.plugin.PluginRegistry; import org.eclipse.pde.internal.build.IPDEBuildConstants; -import org.eclipse.pde.internal.core.FeatureModelManager; import org.eclipse.pde.internal.core.ICoreConstants; import org.eclipse.pde.internal.core.PDECore; import org.eclipse.pde.internal.core.ibundle.IBundle; import org.eclipse.pde.internal.core.ibundle.IBundleModel; import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase; -import org.eclipse.pde.internal.core.ifeature.IFeatureModel; -import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin; public class CoreUtility { @@ -162,7 +159,7 @@ public static void deleteContent(File fileToDelete, IProgressMonitor monitor) { } } - public static boolean guessUnpack(BundleDescription bundle) { + public static boolean guessUnpack1(BundleDescription bundle) { if (bundle == null) { return true; } @@ -210,18 +207,6 @@ public static boolean guessUnpack(BundleDescription bundle) { } } - // check features - FeatureModelManager manager = PDECore.getDefault().getFeatureModelManager(); - IFeatureModel[] models = manager.getModels(); - for (IFeatureModel featureModel : models) { - IFeaturePlugin[] plugins = featureModel.getFeature().getPlugins(); - for (IFeaturePlugin featurePlugin : plugins) { - if (featurePlugin.getId().equals(bundle.getSymbolicName())) { - return featurePlugin.isUnpack(); - } - } - } - IPluginLibrary[] libraries = model.getPluginBase().getLibraries(); if (libraries.length == 0) { return false; diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/core/tests/internal/feature/FeatureDataTestCase.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/core/tests/internal/feature/FeatureDataTestCase.java index 54fd6dd5f9..2c932237a7 100644 --- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/core/tests/internal/feature/FeatureDataTestCase.java +++ b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/core/tests/internal/feature/FeatureDataTestCase.java @@ -52,7 +52,6 @@ public void testSerialization() throws Exception { assertEquals(data.getOS(), data2.getOS()); assertEquals(data.getArch(), data2.getArch()); assertEquals(data.getFilter(), data2.getFilter()); - assertEquals(data.getDownloadSize(), data2.getDownloadSize()); } @Test @@ -76,7 +75,6 @@ private FeatureData newFeatureData() throws CoreException { data.setLabel("Feature1"); data.setArch("x86_64"); data.setOS("win32"); - data.setDownloadSize(1000); return data; } diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/util/ProjectUtils.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/util/ProjectUtils.java index 6c55b160ab..843a69be97 100644 --- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/util/ProjectUtils.java +++ b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/util/ProjectUtils.java @@ -369,7 +369,6 @@ public static IFeaturePlugin addIncludedPlugin(IFeature feature, String id, Stri IFeaturePlugin featurePlugin = feature.getModel().getFactory().createPlugin(); featurePlugin.setId(id); featurePlugin.setVersion(version); - featurePlugin.setUnpack(false); feature.addPlugins(new IFeaturePlugin[] { featurePlugin }); return featurePlugin; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginDetailsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginDetailsSection.java index 0d243d3a70..d84758b549 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginDetailsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginDetailsSection.java @@ -13,8 +13,6 @@ *******************************************************************************/ package org.eclipse.pde.internal.ui.editor.feature; -import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter; - import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; @@ -30,7 +28,6 @@ import org.eclipse.pde.internal.ui.parts.FormEntry; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.forms.IFormPart; import org.eclipse.ui.forms.IManagedForm; @@ -45,14 +42,6 @@ public class PluginDetailsSection extends PDESection implements IPartSelectionLi private FormEntry fVersionText; - private FormEntry fdownloadSizeText; - - private FormEntry fInstallSizeText; - - private Button fUnpackButton; - - private boolean fBlockNotification; - public PluginDetailsSection(PDEFormPage page, Composite parent) { this(page, parent, PDEUIMessages.SiteEditor_PluginDetailsSection_title, PDEUIMessages.SiteEditor_PluginDetailsSection_desc, SWT.NULL); } @@ -67,16 +56,12 @@ public PluginDetailsSection(PDEFormPage page, Composite parent, String title, St @Override public void cancelEdit() { fVersionText.cancelEdit(); - fdownloadSizeText.cancelEdit(); - fInstallSizeText.cancelEdit(); super.cancelEdit(); } @Override public void commit(boolean onSave) { fVersionText.commit(); - fdownloadSizeText.commit(); - fInstallSizeText.commit(); super.commit(onSave); } @@ -110,52 +95,6 @@ public void textValueChanged(FormEntry text) { }); limitTextWidth(fVersionText); fVersionText.setEditable(isEditable()); - - fdownloadSizeText = new FormEntry(container, toolkit, PDEUIMessages.SiteEditor_PluginDetailsSection_downloadSize, null, false); - fdownloadSizeText.setFormEntryListener(new FormEntryAdapter(this) { - - @Override - public void textValueChanged(FormEntry text) { - if (fInput != null) - try { - fInput.setDownloadSize(getLong(text.getValue())); - } catch (CoreException e) { - PDEPlugin.logException(e); - } - } - }); - limitTextWidth(fdownloadSizeText); - fdownloadSizeText.setEditable(isEditable()); - - fInstallSizeText = new FormEntry(container, toolkit, PDEUIMessages.SiteEditor_PluginDetailsSection_installSize, null, false); - fInstallSizeText.setFormEntryListener(new FormEntryAdapter(this) { - - @Override - public void textValueChanged(FormEntry text) { - if (fInput != null) - try { - fInput.setInstallSize(getLong(text.getValue())); - } catch (CoreException e) { - PDEPlugin.logException(e); - } - } - }); - limitTextWidth(fInstallSizeText); - fInstallSizeText.setEditable(isEditable()); - - fUnpackButton = toolkit.createButton(container, PDEUIMessages.SiteEditor_PluginDetailsSection_unpack, SWT.CHECK); - GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 2; - fUnpackButton.setLayoutData(gd); - fUnpackButton.addSelectionListener(widgetSelectedAdapter(e -> { - try { - if (!fBlockNotification) - fInput.setUnpack(fUnpackButton.getSelection()); - } catch (CoreException ex) { - PDEPlugin.logException(ex); - } - })); - toolkit.paintBordersFor(container); section.setClient(container); } @@ -208,45 +147,16 @@ public void selectionChanged(IFormPart part, ISelection selection) { update(); } - @Override - public void setFocus() { - if (fdownloadSizeText != null) - fdownloadSizeText.getText().setFocus(); - } - private void update() { if (fInput != null) { fNameText.setValue(fInput.getLabel()); fVersionText.setValue(fInput.getVersion(), true); - fdownloadSizeText.setValue(fInput.getDownloadSize() >= 0 ? "" + fInput.getDownloadSize() : null, true); //$NON-NLS-1$ - fInstallSizeText.setValue(fInput.getInstallSize() >= 0 ? "" + fInput.getInstallSize() : null, true); //$NON-NLS-1$ - fBlockNotification = true; - fUnpackButton.setSelection(fInput.isUnpack()); - fBlockNotification = false; } else { fNameText.setValue(null); fVersionText.setValue(null, true); - fdownloadSizeText.setValue(null, true); - fInstallSizeText.setValue(null, true); - fBlockNotification = true; - fUnpackButton.setSelection(true); - fBlockNotification = false; } boolean editable = fInput != null && isEditable(); fVersionText.setEditable(editable); - fdownloadSizeText.setEditable(editable); - fInstallSizeText.setEditable(editable); - fUnpackButton.setEnabled(editable); - } - - private long getLong(String svalue) { - if (svalue == null) - return 0; - try { - return Long.parseLong(svalue); - } catch (NumberFormatException e) { - return 0; - } } } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginSection.java index 246cb156a7..b09638ab20 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginSection.java @@ -45,7 +45,6 @@ import org.eclipse.pde.internal.core.ifeature.IFeature; import org.eclipse.pde.internal.core.ifeature.IFeatureModel; import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin; -import org.eclipse.pde.internal.core.util.CoreUtility; import org.eclipse.pde.internal.ui.PDEPlugin; import org.eclipse.pde.internal.ui.PDEUIMessages; import org.eclipse.pde.internal.ui.dialogs.PluginSelectionDialog; @@ -221,7 +220,6 @@ private void doAdd(Object[] candidates) throws CoreException { FeaturePlugin fplugin = (FeaturePlugin) model.getFactory().createPlugin(); fplugin.loadFrom(candidate.getPluginBase()); fplugin.setVersion(ICoreConstants.DEFAULT_VERSION); - fplugin.setUnpack(CoreUtility.guessUnpack(candidate.getBundleDescription())); added[i] = fplugin; } feature.addPlugins(added); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectOperation.java index 843fba3f84..486fc65e29 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectOperation.java @@ -23,7 +23,6 @@ import org.eclipse.pde.internal.core.feature.WorkspaceFeatureModel; import org.eclipse.pde.internal.core.ifeature.IFeature; import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin; -import org.eclipse.pde.internal.core.util.CoreUtility; import org.eclipse.swt.widgets.Shell; public class CreateFeatureProjectOperation extends AbstractCreateFeatureOperation { @@ -43,7 +42,6 @@ protected void configureFeature(IFeature feature, WorkspaceFeatureModel model) t FeaturePlugin fplugin = (FeaturePlugin) model.getFactory().createPlugin(); fplugin.loadFrom(plugin); fplugin.setVersion(ICoreConstants.DEFAULT_VERSION); - fplugin.setUnpack(CoreUtility.guessUnpack(plugin.getPluginModel().getBundleDescription())); added[i] = fplugin; } feature.addPlugins(added);