1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 20:05:35 +02:00

Fix for bugzilla 75529 -- [Managed Build] Shouldn't go to the beginning on configuration changing

Just tweaked the logic to check for a previously selected tool or option (which the tab was storing anyway). If one was selected, that selection is made in tree viewer.
This commit is contained in:
Sean Evoy 2005-01-31 19:30:52 +00:00
parent 81f165b355
commit 4017f92c70

View file

@ -17,12 +17,9 @@ import java.util.List;
import java.util.ListIterator; import java.util.ListIterator;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.ui.dialogs.AbstractCOptionPage;
import org.eclipse.cdt.ui.dialogs.ICOptionContainer;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.IOptionCategory; import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.ITool; import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.ui.properties.BuildOptionSettingsPage; import org.eclipse.cdt.managedbuilder.ui.properties.BuildOptionSettingsPage;
import org.eclipse.cdt.managedbuilder.ui.properties.BuildPropertyPage; import org.eclipse.cdt.managedbuilder.ui.properties.BuildPropertyPage;
import org.eclipse.cdt.managedbuilder.ui.properties.BuildSettingsPage; import org.eclipse.cdt.managedbuilder.ui.properties.BuildSettingsPage;
@ -31,6 +28,8 @@ import org.eclipse.cdt.managedbuilder.ui.properties.BuildToolsSettingsStore;
import org.eclipse.cdt.managedbuilder.ui.properties.ResourceBuildPropertyPage; import org.eclipse.cdt.managedbuilder.ui.properties.ResourceBuildPropertyPage;
import org.eclipse.cdt.managedbuilder.ui.properties.ToolListContentProvider; import org.eclipse.cdt.managedbuilder.ui.properties.ToolListContentProvider;
import org.eclipse.cdt.managedbuilder.ui.properties.ToolListLabelProvider; import org.eclipse.cdt.managedbuilder.ui.properties.ToolListLabelProvider;
import org.eclipse.cdt.ui.dialogs.AbstractCOptionPage;
import org.eclipse.cdt.ui.dialogs.ICOptionContainer;
import org.eclipse.cdt.utils.ui.controls.ControlFactory; import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
@ -47,13 +46,13 @@ import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Layout; import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
@ -404,15 +403,24 @@ public class ToolsSettingsBlock extends AbstractCOptionPage {
} }
settingsStore = store; settingsStore = store;
// Select the first tool in the list // Determine what the selection in the tree should be
Object[] elements = null;
Object primary = null; Object primary = null;
if( element instanceof IProject){ if (selectedTool != null) {
elements = provider.getElements(parent.getSelectedConfiguration()); // There is a selected tool defined
} else if ( element instanceof IFile) { primary = selectedTool;
elements = provider.getElements(resParent.getCurrentResourceConfig()); } else if (selectedCategory != null) {
// There is a selected option or category
primary = selectedCategory;
} else {
// Select the first tool in the list
Object[] elements = null;
if( element instanceof IProject){
elements = provider.getElements(parent.getSelectedConfiguration());
} else if ( element instanceof IFile) {
elements = provider.getElements(resParent.getCurrentResourceConfig());
}
primary = elements.length > 0 ? elements[0] : null;
} }
primary = elements.length > 0 ? elements[0] : null;
if (primary != null) { if (primary != null) {
optionList.setSelection(new StructuredSelection(primary)); optionList.setSelection(new StructuredSelection(primary));