Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 324773 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/editor/feature/RequiresSection.java (-3 / +15 lines)
Lines 14-20 Link Here
14
14
15
import java.util.ArrayList;
15
import java.util.ArrayList;
16
import java.util.Iterator;
16
import java.util.Iterator;
17
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.*;
18
import org.eclipse.jface.action.*;
18
import org.eclipse.jface.action.*;
19
import org.eclipse.jface.viewers.*;
19
import org.eclipse.jface.viewers.*;
20
import org.eclipse.jface.window.Window;
20
import org.eclipse.jface.window.Window;
Lines 23-30 Link Here
23
import org.eclipse.pde.internal.core.*;
23
import org.eclipse.pde.internal.core.*;
24
import org.eclipse.pde.internal.core.feature.FeatureImport;
24
import org.eclipse.pde.internal.core.feature.FeatureImport;
25
import org.eclipse.pde.internal.core.ifeature.*;
25
import org.eclipse.pde.internal.core.ifeature.*;
26
import org.eclipse.pde.internal.ui.PDEPlugin;
26
import org.eclipse.pde.internal.ui.*;
27
import org.eclipse.pde.internal.ui.PDEUIMessages;
28
import org.eclipse.pde.internal.ui.dialogs.FeatureSelectionDialog;
27
import org.eclipse.pde.internal.ui.dialogs.FeatureSelectionDialog;
29
import org.eclipse.pde.internal.ui.dialogs.PluginSelectionDialog;
28
import org.eclipse.pde.internal.ui.dialogs.PluginSelectionDialog;
30
import org.eclipse.pde.internal.ui.editor.*;
29
import org.eclipse.pde.internal.ui.editor.*;
Lines 36-41 Link Here
36
import org.eclipse.swt.SWT;
35
import org.eclipse.swt.SWT;
37
import org.eclipse.swt.custom.BusyIndicator;
36
import org.eclipse.swt.custom.BusyIndicator;
38
import org.eclipse.swt.dnd.Clipboard;
37
import org.eclipse.swt.dnd.Clipboard;
38
import org.eclipse.swt.events.SelectionAdapter;
39
import org.eclipse.swt.events.SelectionEvent;
39
import org.eclipse.swt.graphics.Cursor;
40
import org.eclipse.swt.graphics.Cursor;
40
import org.eclipse.swt.layout.GridData;
41
import org.eclipse.swt.layout.GridData;
41
import org.eclipse.swt.widgets.*;
42
import org.eclipse.swt.widgets.*;
Lines 44-49 Link Here
44
import org.eclipse.ui.actions.ActionFactory;
45
import org.eclipse.ui.actions.ActionFactory;
45
import org.eclipse.ui.forms.widgets.FormToolkit;
46
import org.eclipse.ui.forms.widgets.FormToolkit;
46
import org.eclipse.ui.forms.widgets.Section;
47
import org.eclipse.ui.forms.widgets.Section;
48
import org.osgi.service.prefs.Preferences;
47
49
48
public class RequiresSection extends TableSection implements IPluginModelListener, IFeatureModelListener {
50
public class RequiresSection extends TableSection implements IPluginModelListener, IFeatureModelListener {
49
	private Button fSyncButton;
51
	private Button fSyncButton;
Lines 87-92 Link Here
87
	@Override
89
	@Override
88
	public void createClient(Section section, FormToolkit toolkit) {
90
	public void createClient(Section section, FormToolkit toolkit) {
89
91
92
		final IFeatureModel model = (IFeatureModel) getPage().getModel();
90
		section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
93
		section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
91
		GridData data = new GridData(GridData.FILL_BOTH);
94
		GridData data = new GridData(GridData.FILL_BOTH);
92
		section.setLayoutData(data);
95
		section.setLayoutData(data);
Lines 98-103 Link Here
98
		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
101
		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
99
		gd.horizontalSpan = 2;
102
		gd.horizontalSpan = 2;
100
		fSyncButton.setLayoutData(gd);
103
		fSyncButton.setLayoutData(gd);
104
		fSyncButton.addSelectionListener(new SelectionAdapter() {
105
			@Override
106
			public void widgetSelected(SelectionEvent e) {
107
				Preferences prefs = Platform.getPreferencesService().getRootNode().node(Plugin.PLUGIN_PREFERENCE_SCOPE).node(IPDEUIConstants.PLUGIN_ID);
108
				prefs.putBoolean(model.getFeature().getLabel(), fSyncButton.getSelection());
109
			}
110
		});
101
111
102
		createViewerPartControl(container, SWT.MULTI, 2, toolkit);
112
		createViewerPartControl(container, SWT.MULTI, 2, toolkit);
103
113
Lines 404-409 Link Here
404
			getTablePart().setButtonEnabled(3, false);
414
			getTablePart().setButtonEnabled(3, false);
405
			fSyncButton.setEnabled(false);
415
			fSyncButton.setEnabled(false);
406
		}
416
		}
417
		Preferences prefs = Platform.getPreferencesService().getRootNode().node(Plugin.PLUGIN_PREFERENCE_SCOPE).node(IPDEUIConstants.PLUGIN_ID);
418
		fSyncButton.setSelection(prefs.getBoolean(model.getFeature().getLabel(), false));
407
		model.addModelChangedListener(this);
419
		model.addModelChangedListener(this);
408
		PDECore.getDefault().getModelManager().addPluginModelListener(this);
420
		PDECore.getDefault().getModelManager().addPluginModelListener(this);
409
		PDECore.getDefault().getFeatureModelManager().addFeatureModelListener(this);
421
		PDECore.getDefault().getFeatureModelManager().addFeatureModelListener(this);

Return to bug 324773