mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-09 19:43:27 +02:00
Minor changes in UI (resize)
This commit is contained in:
parent
0be7bdbe77
commit
95588188c0
3 changed files with 29 additions and 27 deletions
|
@ -17,5 +17,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
|
||||||
org.eclipse.cdt.managedbuilder.core;bundle-version="[4.0.0,5.0.0)",
|
org.eclipse.cdt.managedbuilder.core;bundle-version="[4.0.0,5.0.0)",
|
||||||
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
|
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
|
||||||
org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)",
|
org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)",
|
||||||
org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)";resolution:=optional
|
org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
|
||||||
|
org.eclipse.cdt.make.core,
|
||||||
|
org.eclipse.cdt.make.ui
|
||||||
Eclipse-LazyStart: true
|
Eclipse-LazyStart: true
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 618 B |
|
@ -28,7 +28,6 @@ import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacroProvider;
|
import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacroProvider;
|
||||||
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.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
@ -45,22 +44,20 @@ import org.eclipse.jface.viewers.ViewerFilter;
|
||||||
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.graphics.Point;
|
||||||
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.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
import org.eclipse.swt.widgets.Event;
|
||||||
|
import org.eclipse.swt.widgets.Listener;
|
||||||
|
|
||||||
|
|
||||||
public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPreferencePageContainer {
|
public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPreferencePageContainer {
|
||||||
/*
|
/*
|
||||||
* String constants
|
* String constants
|
||||||
*/
|
*/
|
||||||
//private static final String PREFIX = "ToolsSettingsBlock"; //$NON-NLS-1$
|
private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 20 };
|
||||||
//private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$
|
|
||||||
//private static final String SETTINGS_LABEL = LABEL + ".Settings"; //$NON-NLS-1$
|
|
||||||
//private static final String TREE_LABEL = LABEL + ".ToolTree"; //$NON-NLS-1$
|
|
||||||
//private static final String OPTIONS_LABEL = LABEL + ".ToolOptions"; //$NON-NLS-1$
|
|
||||||
private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 20, 30 };
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dialog widgets
|
* Dialog widgets
|
||||||
|
@ -96,24 +93,40 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
sashForm = new SashForm(usercomp, SWT.NONE);
|
sashForm = new SashForm(usercomp, SWT.NONE);
|
||||||
sashForm.setOrientation(SWT.HORIZONTAL);
|
sashForm.setOrientation(SWT.HORIZONTAL);
|
||||||
sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
|
sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||||
|
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
layout.numColumns = 2;
|
layout.numColumns = 2;
|
||||||
layout.marginHeight = 5;
|
layout.marginHeight = 5;
|
||||||
layout.marginWidth = 5;
|
|
||||||
sashForm.setLayout(layout);
|
sashForm.setLayout(layout);
|
||||||
createSelectionArea(sashForm);
|
createSelectionArea(sashForm);
|
||||||
createEditArea(sashForm);
|
createEditArea(sashForm);
|
||||||
sashForm.setWeights(DEFAULT_SASH_WEIGHTS);
|
sashForm.setWeights(DEFAULT_SASH_WEIGHTS);
|
||||||
|
sashForm.addListener(SWT.Selection, new Listener() {
|
||||||
|
public void handleEvent(Event event) {
|
||||||
|
if (event.detail == SWT.DRAG) return;
|
||||||
|
int shift = event.x - sashForm.getBounds().x;
|
||||||
|
GridData data = (GridData) containerSC.getLayoutData();
|
||||||
|
if ((data.widthHint + shift) < 20) return;
|
||||||
|
Point computedSize = usercomp.getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||||
|
Point currentSize = usercomp.getShell().getSize();
|
||||||
|
boolean customSize = !computedSize.equals(currentSize);
|
||||||
|
data.widthHint = data.widthHint;
|
||||||
|
sashForm.layout(true);
|
||||||
|
computedSize = usercomp.getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||||
|
if (customSize)
|
||||||
|
computedSize.x = Math.max(computedSize.x, currentSize.x);
|
||||||
|
computedSize.y = Math.max(computedSize.y, currentSize.y);
|
||||||
|
if (computedSize.equals(currentSize)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
propertyObject = page.getElement();
|
propertyObject = page.getElement();
|
||||||
setValues();
|
setValues();
|
||||||
// WorkbenchHelp.setHelp(composite, ManagedBuilderHelpContextIds.MAN_PROJ_BUILD_PROP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createSelectionArea (Composite parent) {
|
protected void createSelectionArea (Composite parent) {
|
||||||
// Create a label and list viewer
|
optionList = new TreeViewer(parent, SWT.SINGLE|SWT.H_SCROLL|SWT.V_SCROLL|SWT.BORDER);
|
||||||
Composite composite = ControlFactory.createComposite(parent, 1);
|
|
||||||
optionList = new TreeViewer(composite, SWT.SINGLE|SWT.H_SCROLL|SWT.V_SCROLL|SWT.BORDER);
|
|
||||||
optionList.addSelectionChangedListener(new ISelectionChangedListener() {
|
optionList.addSelectionChangedListener(new ISelectionChangedListener() {
|
||||||
public void selectionChanged(SelectionChangedEvent event) {
|
public void selectionChanged(SelectionChangedEvent event) {
|
||||||
handleOptionSelection();
|
handleOptionSelection();
|
||||||
|
@ -483,19 +496,6 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
// Call an MBS CallBack function to inform that Settings related to Apply/OK button
|
// Call an MBS CallBack function to inform that Settings related to Apply/OK button
|
||||||
// press have been applied.
|
// press have been applied.
|
||||||
if (setOption == null) setOption = option;
|
if (setOption == null) setOption = option;
|
||||||
|
|
||||||
// if (setOption.getValueHandler().handleValue(
|
|
||||||
// handler,
|
|
||||||
// setOption.getOptionHolder(),
|
|
||||||
// setOption,
|
|
||||||
// setOption.getValueHandlerExtraArgument(),
|
|
||||||
// IManagedOptionValueHandler.EVENT_APPLY)) {
|
|
||||||
// // TODO : Event is handled successfully and returned true.
|
|
||||||
// // May need to do something here say log a message.
|
|
||||||
// } else {
|
|
||||||
// // Event handling Failed.
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
} catch (BuildException e) {
|
} catch (BuildException e) {
|
||||||
} catch (ClassCastException e) {
|
} catch (ClassCastException e) {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue