mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
bug 290997: [Contribution] VS-style option tooltip display in Property Pages
patch from Miwako Tokugawa
This commit is contained in:
parent
bd8212e8aa
commit
9fa4bd5b07
9 changed files with 311 additions and 38 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.ui; singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.ui; singleton:=true
|
||||||
Bundle-Version: 5.1.0.qualifier
|
Bundle-Version: 5.2.0.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin
|
Bundle-Activator: org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2009 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Intel Corporation - initial API and implementation
|
* Intel Corporation - initial API and implementation
|
||||||
|
* Miwako Tokugawa (Intel Corporation) - Fixed-location tooltip support
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
||||||
|
|
||||||
|
@ -33,16 +34,19 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
private Button show_mng;
|
private Button show_mng;
|
||||||
private Button show_tool;
|
private Button show_tool;
|
||||||
private Button show_exp;
|
private Button show_exp;
|
||||||
|
private Button show_tipbox;
|
||||||
|
|
||||||
private Button b_0;
|
private Button b_0;
|
||||||
private Button b_1;
|
private Button b_1;
|
||||||
private Button b_2;
|
private Button b_2;
|
||||||
private Button b_3;
|
private Button b_3;
|
||||||
|
private Button b_4;
|
||||||
|
|
||||||
private Button s_0;
|
private Button s_0;
|
||||||
private Button s_1;
|
private Button s_1;
|
||||||
private Button s_2;
|
private Button s_2;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void createControls(Composite parent) {
|
public void createControls(Composite parent) {
|
||||||
super.createControls(parent);
|
super.createControls(parent);
|
||||||
usercomp.setLayout(new GridLayout(1, false));
|
usercomp.setLayout(new GridLayout(1, false));
|
||||||
|
@ -62,6 +66,10 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
show_exp = new Button(usercomp, SWT.CHECK);
|
show_exp = new Button(usercomp, SWT.CHECK);
|
||||||
show_exp.setText(UIMessages.getString("PropertyPageDefsTab.10")); //$NON-NLS-1$
|
show_exp.setText(UIMessages.getString("PropertyPageDefsTab.10")); //$NON-NLS-1$
|
||||||
show_exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
show_exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
|
show_tipbox = new Button(usercomp, SWT.CHECK);
|
||||||
|
show_tipbox.setText(UIMessages.getString("PropertyPageDefsTab.16")); //$NON-NLS-1$
|
||||||
|
show_tipbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
Group saveGrp = new Group(usercomp, SWT.NONE);
|
Group saveGrp = new Group(usercomp, SWT.NONE);
|
||||||
saveGrp.setText(UIMessages.getString("PropertyPageDefsTab.11")); //$NON-NLS-1$
|
saveGrp.setText(UIMessages.getString("PropertyPageDefsTab.11")); //$NON-NLS-1$
|
||||||
|
@ -101,6 +109,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
show_mng.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG));
|
show_mng.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG));
|
||||||
show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM));
|
show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM));
|
||||||
show_exp.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_EXPORT));
|
show_exp.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_EXPORT));
|
||||||
|
show_tipbox.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_TIPBOX));
|
||||||
|
|
||||||
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES)) {
|
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES)) {
|
||||||
case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_BOTH: b_0.setSelection(true); break;
|
case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_BOTH: b_0.setSelection(true); break;
|
||||||
|
@ -116,11 +125,13 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void performOK() {
|
protected void performOK() {
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_DTREE, show_tree.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_DTREE, show_tree.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOMNG, !show_mng.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOMNG, !show_mng.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_EXPORT, show_exp.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_EXPORT, show_exp.getSelection());
|
||||||
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_TIPBOX, show_tipbox.getSelection());
|
||||||
int x = 0;
|
int x = 0;
|
||||||
if (b_1.getSelection()) x = 1;
|
if (b_1.getSelection()) x = 1;
|
||||||
else if (b_2.getSelection()) x = 2;
|
else if (b_2.getSelection()) x = 2;
|
||||||
|
@ -133,21 +144,27 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
CDTPrefUtil.setInt(CDTPrefUtil.KEY_POSSAVE, x);
|
CDTPrefUtil.setInt(CDTPrefUtil.KEY_POSSAVE, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void performDefaults() {
|
protected void performDefaults() {
|
||||||
show_tree.setSelection(false);
|
show_tree.setSelection(false);
|
||||||
show_mng.setSelection(true);
|
show_mng.setSelection(true);
|
||||||
show_tool.setSelection(true);
|
show_tool.setSelection(true);
|
||||||
show_exp.setSelection(false);
|
show_exp.setSelection(false);
|
||||||
|
show_tipbox.setSelection(false);
|
||||||
b_0.setSelection(true);
|
b_0.setSelection(true);
|
||||||
b_1.setSelection(false);
|
b_1.setSelection(false);
|
||||||
b_2.setSelection(false);
|
b_2.setSelection(false);
|
||||||
b_3.setSelection(false);
|
b_3.setSelection(false);
|
||||||
|
b_4.setSelection(false);
|
||||||
s_0.setSelection(true);
|
s_0.setSelection(true);
|
||||||
s_1.setSelection(false);
|
s_1.setSelection(false);
|
||||||
s_2.setSelection(false);
|
s_2.setSelection(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void performApply(ICResourceDescription src, ICResourceDescription dst) { performOK(); }
|
protected void performApply(ICResourceDescription src, ICResourceDescription dst) { performOK(); }
|
||||||
|
@Override
|
||||||
protected void updateData(ICResourceDescription cfg) {} // Do nothing. Data is read once after creation
|
protected void updateData(ICResourceDescription cfg) {} // Do nothing. Data is read once after creation
|
||||||
|
@Override
|
||||||
protected void updateButtons() {} // Do nothing. No buttons to update
|
protected void updateButtons() {} // Do nothing. No buttons to update
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2007 Rational Software Corporation and others.
|
* Copyright (c) 2004, 2009 Rational Software Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Rational Software - Initial API and implementation
|
* IBM Rational Software - Initial API and implementation
|
||||||
* Intel corp. 2007 - modification for new CDT model.
|
* Intel corp. 2007 - modification for new CDT model.
|
||||||
|
* Miwako Tokugawa (Intel Corporation) - Fixed-location tooltip support
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.ui.properties;
|
package org.eclipse.cdt.managedbuilder.ui.properties;
|
||||||
|
|
||||||
|
@ -21,10 +22,11 @@ public abstract class AbstractToolSettingUI extends FieldEditorPreferencePage {
|
||||||
|
|
||||||
protected AbstractCBuildPropertyTab buildPropPage;
|
protected AbstractCBuildPropertyTab buildPropPage;
|
||||||
protected IResourceInfo fInfo;
|
protected IResourceInfo fInfo;
|
||||||
private boolean dirty = false;
|
private boolean dirty = false;
|
||||||
|
private boolean toolTipBoxNeeded = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param style
|
*
|
||||||
*/
|
*/
|
||||||
protected AbstractToolSettingUI(IResourceInfo info) {
|
protected AbstractToolSettingUI(IResourceInfo info) {
|
||||||
this(info, GRID);
|
this(info, GRID);
|
||||||
|
@ -41,6 +43,7 @@ public abstract class AbstractToolSettingUI extends FieldEditorPreferencePage {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
|
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void createFieldEditors() {
|
protected void createFieldEditors() {
|
||||||
// Get the preference store for the build settings
|
// Get the preference store for the build settings
|
||||||
IPreferenceStore settings = getToolSettingsPrefStore();
|
IPreferenceStore settings = getToolSettingsPrefStore();
|
||||||
|
@ -48,15 +51,32 @@ public abstract class AbstractToolSettingUI extends FieldEditorPreferencePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the tool settings preference store
|
* @return the tool settings preference store
|
||||||
*/
|
*/
|
||||||
protected ToolSettingsPrefStore getToolSettingsPrefStore() {
|
protected ToolSettingsPrefStore getToolSettingsPrefStore() {
|
||||||
return ToolSettingsPrefStore.getDefault();
|
return ToolSettingsPrefStore.getDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param flag indicating that tooltip box need to be displayed
|
||||||
|
* @since 5.2
|
||||||
|
*/
|
||||||
|
protected void setToolTipBoxNeeded(boolean flag) {
|
||||||
|
toolTipBoxNeeded = flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if this page needs to have a tool tip box.
|
||||||
|
* @since 5.2
|
||||||
|
*/
|
||||||
|
protected boolean isToolTipBoxNeeded() {
|
||||||
|
return toolTipBoxNeeded;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method called when the value of a dialog field changes
|
* Method called when the value of a dialog field changes
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent event) {
|
public void propertyChange(PropertyChangeEvent event) {
|
||||||
super.propertyChange(event);
|
super.propertyChange(event);
|
||||||
if (event.getProperty().equals(FieldEditor.VALUE)) {
|
if (event.getProperty().equals(FieldEditor.VALUE)) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2003, 2008 IBM Corporation and others.
|
* Copyright (c) 2003, 2009 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Rational Software - Initial API and implementation
|
* IBM Rational Software - Initial API and implementation
|
||||||
* ARM Ltd. - basic tooltip support
|
* ARM Ltd. - basic tooltip support
|
||||||
|
* Miwako Tokugawa (Intel Corporation) - Fixed-location tooltip support
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.ui.properties;
|
package org.eclipse.cdt.managedbuilder.ui.properties;
|
||||||
|
|
||||||
|
@ -41,11 +42,17 @@ import org.eclipse.jface.preference.FileFieldEditor;
|
||||||
import org.eclipse.jface.preference.StringFieldEditor;
|
import org.eclipse.jface.preference.StringFieldEditor;
|
||||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||||
import org.eclipse.osgi.util.TextProcessor;
|
import org.eclipse.osgi.util.TextProcessor;
|
||||||
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.ModifyEvent;
|
import org.eclipse.swt.events.ModifyEvent;
|
||||||
import org.eclipse.swt.events.ModifyListener;
|
import org.eclipse.swt.events.ModifyListener;
|
||||||
import org.eclipse.swt.graphics.Point;
|
import org.eclipse.swt.graphics.Point;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
|
import org.eclipse.swt.widgets.Combo;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.Event;
|
||||||
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
import org.eclipse.swt.widgets.Listener;
|
||||||
|
import org.eclipse.swt.widgets.Text;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
|
@ -59,12 +66,44 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
private int curr = -1;
|
private int curr = -1;
|
||||||
private Map<FieldEditor, Composite> fieldEditorsToParentMap =
|
private Map<FieldEditor, Composite> fieldEditorsToParentMap =
|
||||||
new HashMap<FieldEditor, Composite>();
|
new HashMap<FieldEditor, Composite>();
|
||||||
|
/** True if the user selected "Display tool option tips at a fixed location" in Preferences */
|
||||||
|
private boolean displayFixedTip;
|
||||||
|
/** type of mouse action the displayFixedTip responds to.
|
||||||
|
** currently set to Enter rather than Hover since the former seems more responsive **/
|
||||||
|
private final static int selectAction = SWT.MouseEnter;
|
||||||
|
|
||||||
|
private class TipInfo {
|
||||||
|
private String name;
|
||||||
|
private String tip;
|
||||||
|
|
||||||
|
public TipInfo(String name, String tip) {
|
||||||
|
this.name = name;
|
||||||
|
this.tip = tip;
|
||||||
|
}
|
||||||
|
protected String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
protected String getTip() {
|
||||||
|
return tip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public BuildOptionSettingsUI(AbstractCBuildPropertyTab page,
|
public BuildOptionSettingsUI(AbstractCBuildPropertyTab page,
|
||||||
IResourceInfo info, IHoldsOptions optionHolder,
|
IResourceInfo info, IHoldsOptions optionHolder,
|
||||||
IOptionCategory _category) {
|
IOptionCategory _category) {
|
||||||
|
this(page, info, optionHolder, _category, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 5.2
|
||||||
|
*/
|
||||||
|
public BuildOptionSettingsUI(AbstractCBuildPropertyTab page,
|
||||||
|
IResourceInfo info, IHoldsOptions optionHolder,
|
||||||
|
IOptionCategory _category, boolean _displayFixedTip) {
|
||||||
super(info);
|
super(info);
|
||||||
this.category = _category;
|
this.category = _category;
|
||||||
|
this.displayFixedTip = _displayFixedTip;
|
||||||
this.optionHolder = optionHolder;
|
this.optionHolder = optionHolder;
|
||||||
buildPropPage = page;
|
buildPropPage = page;
|
||||||
if (info instanceof MultiItemsHolder) {
|
if (info instanceof MultiItemsHolder) {
|
||||||
|
@ -123,10 +162,14 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
|
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#Editors()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void createFieldEditors() {
|
protected void createFieldEditors() {
|
||||||
|
// true if he user selected "Display tool option tips at a fixed location" in Preferences AND
|
||||||
|
// and we are displaying the tool tip box on this page because one or more option has non-empty tool tip.
|
||||||
|
boolean pageHasToolTipBox = isToolTipBoxNeeded();
|
||||||
|
|
||||||
// Get the preference store for the build settings
|
// Get the preference store for the build settings
|
||||||
super.createFieldEditors();
|
super.createFieldEditors();
|
||||||
// Iterate over the options in the category and create a field editor
|
// Iterate over the options in the category and create a field editor
|
||||||
|
@ -138,7 +181,6 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
IHoldsOptions holder = (IHoldsOptions)options[index][0];
|
IHoldsOptions holder = (IHoldsOptions)options[index][0];
|
||||||
if (holder == null) break; // The array may not be full
|
if (holder == null) break; // The array may not be full
|
||||||
IOption opt = (IOption)options[index][1];
|
IOption opt = (IOption)options[index][1];
|
||||||
String optId = getToolSettingsPrefStore().getOptionId(opt);
|
|
||||||
|
|
||||||
// check to see if the option has an applicability calculator
|
// check to see if the option has an applicability calculator
|
||||||
IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator();
|
IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator();
|
||||||
|
@ -146,6 +188,15 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
|
|
||||||
if (applicabilityCalculator == null || applicabilityCalculator.isOptionVisible(config, holder, opt)) {
|
if (applicabilityCalculator == null || applicabilityCalculator.isOptionVisible(config, holder, opt)) {
|
||||||
|
|
||||||
|
String optId = getToolSettingsPrefStore().getOptionId(opt);
|
||||||
|
String nameStr = TextProcessor.process(opt.getName());
|
||||||
|
String tipStr = TextProcessor.process(opt.getToolTip());
|
||||||
|
String contextId = opt.getContextId();
|
||||||
|
|
||||||
|
if (pageHasToolTipBox && (tipStr==null || tipStr.trim().length()==0)) {
|
||||||
|
tipStr = Messages.getString("BuildOptionSettingsUI.0"); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Figure out which type the option is and add a proper field
|
// Figure out which type the option is and add a proper field
|
||||||
// editor for it
|
// editor for it
|
||||||
|
@ -160,11 +211,11 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
// browse button of the appropriate type.
|
// browse button of the appropriate type.
|
||||||
switch (opt.getBrowseType()) {
|
switch (opt.getBrowseType()) {
|
||||||
case IOption.BROWSE_DIR: {
|
case IOption.BROWSE_DIR: {
|
||||||
stringField = new DirectoryFieldEditor(optId, TextProcessor.process(opt.getName()), fieldEditorParent);
|
stringField = new DirectoryFieldEditor(optId, nameStr, fieldEditorParent);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case IOption.BROWSE_FILE: {
|
case IOption.BROWSE_FILE: {
|
||||||
stringField = new FileFieldEditor(optId, TextProcessor.process(opt.getName()), fieldEditorParent) {
|
stringField = new FileFieldEditor(optId, nameStr, fieldEditorParent) {
|
||||||
/**
|
/**
|
||||||
* Do not perform validity check on the file name due to losing focus,
|
* Do not perform validity check on the file name due to losing focus,
|
||||||
* see http://bugs.eclipse.org/289448
|
* see http://bugs.eclipse.org/289448
|
||||||
|
@ -178,7 +229,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case IOption.BROWSE_NONE: {
|
case IOption.BROWSE_NONE: {
|
||||||
final StringFieldEditorM local = new StringFieldEditorM(optId, TextProcessor.process(opt.getName()), fieldEditorParent);
|
final StringFieldEditorM local = new StringFieldEditorM(optId, nameStr, fieldEditorParent);
|
||||||
stringField = local;
|
stringField = local;
|
||||||
local.getTextControl().addModifyListener(new ModifyListener() {
|
local.getTextControl().addModifyListener(new ModifyListener() {
|
||||||
public void modifyText(ModifyEvent e) {
|
public void modifyText(ModifyEvent e) {
|
||||||
|
@ -191,22 +242,33 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
throw new BuildException(null);
|
throw new BuildException(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Label label = stringField.getLabelControl(fieldEditorParent);
|
||||||
stringField.getTextControl(fieldEditorParent).setToolTipText(TextProcessor.process(opt.getToolTip()));
|
Text text = stringField.getTextControl(fieldEditorParent);
|
||||||
stringField.getLabelControl(fieldEditorParent).setToolTipText(TextProcessor.process(opt.getToolTip()));
|
if (pageHasToolTipBox) {
|
||||||
PlatformUI.getWorkbench().getHelpSystem().setHelp(stringField.getTextControl(fieldEditorParent), opt.getContextId());
|
label.setData(new TipInfo(nameStr,tipStr));
|
||||||
|
label.addListener(selectAction, tipSetListener);
|
||||||
|
text.setData(new TipInfo(nameStr,tipStr));
|
||||||
|
text.addListener(selectAction, tipSetListener);
|
||||||
|
} else {
|
||||||
|
label.setToolTipText(tipStr);
|
||||||
|
text.setToolTipText(tipStr);
|
||||||
|
}
|
||||||
|
if (!contextId.equals(AbstractPage.EMPTY_STR)) {
|
||||||
|
PlatformUI.getWorkbench().getHelpSystem().setHelp(text, contextId);
|
||||||
|
}
|
||||||
fieldEditor = stringField;
|
fieldEditor = stringField;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case IOption.BOOLEAN: {
|
case IOption.BOOLEAN: {
|
||||||
fieldEditor = new TriStateBooleanFieldEditor(
|
fieldEditor = new TriStateBooleanFieldEditor(
|
||||||
optId,
|
optId,
|
||||||
TextProcessor.process(opt.getName()),
|
nameStr,
|
||||||
opt.getToolTip(),
|
tipStr,
|
||||||
fieldEditorParent,
|
fieldEditorParent,
|
||||||
opt.getContextId(),
|
contextId,
|
||||||
ohs,
|
ohs,
|
||||||
curr);
|
curr);
|
||||||
|
// tipStr is handled in TriStateBooleanFieldEditor constructor
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case IOption.ENUMERATED: {
|
case IOption.ENUMERATED: {
|
||||||
|
@ -228,7 +290,19 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
String[] enumValidNames = new String[enumValidList.size()];
|
String[] enumValidNames = new String[enumValidList.size()];
|
||||||
enumValidList.copyInto(enumValidNames);
|
enumValidList.copyInto(enumValidNames);
|
||||||
|
|
||||||
fieldEditor = new BuildOptionComboFieldEditor(optId, TextProcessor.process(opt.getName()), TextProcessor.process(opt.getToolTip()), opt.getContextId(), enumValidNames, sel, fieldEditorParent);
|
// if (displayFixedTip==false), tooltip was already set in BuildOptionComboFieldEditor constructor.
|
||||||
|
String tooltipHoverStr = displayFixedTip ? null : tipStr;
|
||||||
|
fieldEditor = new BuildOptionComboFieldEditor(optId, nameStr,
|
||||||
|
tooltipHoverStr, contextId, enumValidNames, sel, fieldEditorParent);
|
||||||
|
|
||||||
|
if (pageHasToolTipBox) {
|
||||||
|
Combo combo = ((BuildOptionComboFieldEditor)fieldEditor).getComboControl();
|
||||||
|
Label label = fieldEditor.getLabelControl(fieldEditorParent);
|
||||||
|
combo.setData(new TipInfo(nameStr,tipStr));
|
||||||
|
combo.addListener(selectAction, tipSetListener);
|
||||||
|
label.setData(new TipInfo(nameStr,tipStr));
|
||||||
|
label.addListener(selectAction, tipSetListener);
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case IOption.INCLUDE_PATH:
|
case IOption.INCLUDE_PATH:
|
||||||
|
@ -245,8 +319,17 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
case IOption.UNDEF_INCLUDE_FILES:
|
case IOption.UNDEF_INCLUDE_FILES:
|
||||||
case IOption.UNDEF_LIBRARY_PATHS:
|
case IOption.UNDEF_LIBRARY_PATHS:
|
||||||
case IOption.UNDEF_LIBRARY_FILES:
|
case IOption.UNDEF_LIBRARY_FILES:
|
||||||
case IOption.UNDEF_MACRO_FILES: {
|
case IOption.UNDEF_MACRO_FILES:
|
||||||
fieldEditor = new FileListControlFieldEditor(optId, TextProcessor.process(opt.getName()), TextProcessor.process(opt.getToolTip()), opt.getContextId(), fieldEditorParent, opt.getBrowseType());
|
{
|
||||||
|
// if (displayFixedTip==false), tooltip was already set in FileListControlFieldEditor constructor.
|
||||||
|
String tooltipHoverStr = displayFixedTip ? null : tipStr;
|
||||||
|
fieldEditor = new FileListControlFieldEditor(optId, nameStr,
|
||||||
|
tooltipHoverStr, contextId, fieldEditorParent, opt.getBrowseType());
|
||||||
|
if (pageHasToolTipBox) {
|
||||||
|
Label label = fieldEditor.getLabelControl(fieldEditorParent);
|
||||||
|
label.setData(new TipInfo(nameStr,tipStr));
|
||||||
|
label.addListener(selectAction, tipSetListener);
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -455,6 +538,10 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
fieldEditor.setEnabled(true, parent);
|
fieldEditor.setEnabled(true, parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean hasStr(String tipStr) {
|
||||||
|
return (tipStr!=null && tipStr.trim().length()>0);
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
||||||
|
@ -583,6 +670,35 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
public void setValues() {
|
public void setValues() {
|
||||||
updateFields();
|
updateFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if the page needs to have the tool tip box.
|
||||||
|
* @since 5.2
|
||||||
|
*/
|
||||||
|
protected boolean needToolTipBox(IHoldsOptions optionHolder, IOptionCategory category) {
|
||||||
|
if (optionHolder instanceof ITool) { // option category page
|
||||||
|
Object[][] options = category.getOptions(fInfo, optionHolder);
|
||||||
|
for (int index = 0; index < options.length; ++index) {
|
||||||
|
IHoldsOptions holder = (IHoldsOptions)options[index][0];
|
||||||
|
if (holder == null) break; // The array may not be full
|
||||||
|
IOption opt = (IOption)options[index][1];
|
||||||
|
String tipStr = TextProcessor.process(opt.getToolTip());
|
||||||
|
|
||||||
|
// check to see if the option has an applicability calculator
|
||||||
|
IOptionApplicability applicabilityCalculator = opt.getApplicabilityCalculator();
|
||||||
|
IBuildObject config = fInfo;
|
||||||
|
|
||||||
|
if (applicabilityCalculator == null || applicabilityCalculator.isOptionVisible(config, holder, opt)) {
|
||||||
|
if (hasStr(tipStr)) {
|
||||||
|
return true; // an option with a tip string was found.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// A tool option summary page does not list individual options
|
||||||
|
// so never should have the box
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The items shown in an enumerated option may depend on other option values.
|
* The items shown in an enumerated option may depend on other option values.
|
||||||
|
@ -633,7 +749,7 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
enumValidList.copyInto(enumValidNames);
|
enumValidList.copyInto(enumValidNames);
|
||||||
|
|
||||||
if ( selectNewEnum ) {
|
if ( selectNewEnum ) {
|
||||||
// apparantly the currently selected enum value is not part anymore of the enum list
|
// apparently the currently selected enum value is not part anymore of the enum list
|
||||||
// select a new value.
|
// select a new value.
|
||||||
String selection = null;
|
String selection = null;
|
||||||
if ( selectDefault ) {
|
if ( selectDefault ) {
|
||||||
|
@ -649,6 +765,16 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
fieldEditor.load();
|
fieldEditor.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final Listener tipSetListener = new Listener() {
|
||||||
|
public void handleEvent(Event event) {
|
||||||
|
Object data = event.widget.getData();
|
||||||
|
if (data!=null && buildPropPage!=null) {
|
||||||
|
TipInfo obj = (TipInfo)data;
|
||||||
|
((ToolSettingsTab)buildPropPage).updateTipText(obj.getName(), obj.getTip());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -664,8 +790,15 @@ public class BuildOptionSettingsUI extends AbstractToolSettingUI {
|
||||||
holders = ho;
|
holders = ho;
|
||||||
current = curr;
|
current = curr;
|
||||||
button = getChangeControl(parent);
|
button = getChangeControl(parent);
|
||||||
button.setToolTipText(tooltip);
|
if (displayFixedTip && isToolTipBoxNeeded()) {
|
||||||
if (!contextId.equals(AbstractPage.EMPTY_STR)) PlatformUI.getWorkbench().getHelpSystem().setHelp(button, contextId);
|
button.setData(new TipInfo(labelText,tooltip));
|
||||||
|
button.addListener(selectAction, tipSetListener);
|
||||||
|
} else {
|
||||||
|
button.setToolTipText(tooltip);
|
||||||
|
}
|
||||||
|
if (!contextId.equals(AbstractPage.EMPTY_STR)) {
|
||||||
|
PlatformUI.getWorkbench().getHelpSystem().setHelp(button, contextId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2008 BitMethods Inc and others.
|
* Copyright (c) 2004, 2009 BitMethods Inc and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* BitMethods Inc - Initial API and implementation
|
* BitMethods Inc - Initial API and implementation
|
||||||
* ARM Ltd. - basic tooltip support
|
* ARM Ltd. - basic tooltip support
|
||||||
|
* Miwako Tokugawa (Intel Corporation) - Fixed-location tooltip support
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.ui.properties;
|
package org.eclipse.cdt.managedbuilder.ui.properties;
|
||||||
|
|
||||||
|
@ -147,8 +148,8 @@ public class FileListControlFieldEditor extends FieldEditor {
|
||||||
topLayout = new Composite(parent, SWT.NONE);
|
topLayout = new Composite(parent, SWT.NONE);
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
layout.numColumns = numColumns;
|
layout.numColumns = numColumns;
|
||||||
layout.marginWidth = 7;
|
layout.marginWidth = 0;
|
||||||
layout.marginHeight = 5;
|
layout.marginHeight = 0;
|
||||||
layout.makeColumnsEqualWidth = false;
|
layout.makeColumnsEqualWidth = false;
|
||||||
topLayout.setLayout(layout);
|
topLayout.setLayout(layout);
|
||||||
GridData gddata = new GridData(GridData.FILL_HORIZONTAL);
|
GridData gddata = new GridData(GridData.FILL_HORIZONTAL);
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Intel Corporation - Initial API and implementation
|
* Intel Corporation - Initial API and implementation
|
||||||
|
* Miwako Tokugawa (Intel Corporation) - Fixed-location tooltip support
|
||||||
* QNX Software Systems - [269571] Apply button failure on tool changes
|
* QNX Software Systems - [269571] Apply button failure on tool changes
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.ui.properties;
|
package org.eclipse.cdt.managedbuilder.ui.properties;
|
||||||
|
@ -32,6 +33,7 @@ import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
|
import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacroProvider;
|
import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacroProvider;
|
||||||
|
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||||
import org.eclipse.cdt.ui.newui.PageLayout;
|
import org.eclipse.cdt.ui.newui.PageLayout;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.jface.preference.IPreferencePageContainer;
|
import org.eclipse.jface.preference.IPreferencePageContainer;
|
||||||
|
@ -46,8 +48,12 @@ 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.custom.StyleRange;
|
||||||
|
import org.eclipse.swt.custom.StyledText;
|
||||||
import org.eclipse.swt.events.ControlAdapter;
|
import org.eclipse.swt.events.ControlAdapter;
|
||||||
import org.eclipse.swt.events.ControlEvent;
|
import org.eclipse.swt.events.ControlEvent;
|
||||||
|
import org.eclipse.swt.graphics.Font;
|
||||||
|
import org.eclipse.swt.graphics.FontData;
|
||||||
import org.eclipse.swt.graphics.Point;
|
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;
|
||||||
|
@ -61,7 +67,10 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
* Dialog widgets
|
* Dialog widgets
|
||||||
*/
|
*/
|
||||||
private TreeViewer optionList;
|
private TreeViewer optionList;
|
||||||
|
private StyledText tipText;
|
||||||
|
private StyleRange styleRange;
|
||||||
private SashForm sashForm;
|
private SashForm sashForm;
|
||||||
|
private SashForm sashForm2;
|
||||||
private Composite settingsPageContainer;
|
private Composite settingsPageContainer;
|
||||||
private ScrolledComposite containerSC;
|
private ScrolledComposite containerSC;
|
||||||
|
|
||||||
|
@ -77,6 +86,10 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
|
|
||||||
private IResourceInfo fInfo;
|
private IResourceInfo fInfo;
|
||||||
|
|
||||||
|
private boolean displayFixedTip = CDTPrefUtil.getBool(CDTPrefUtil.KEY_TIPBOX);
|
||||||
|
private int[] defaultWeights = new int[] {4, 1};
|
||||||
|
private int[] hideTipBoxWeights = new int[] {1, 0};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createControls(Composite par) {
|
public void createControls(Composite par) {
|
||||||
super.createControls(par);
|
super.createControls(par);
|
||||||
|
@ -94,9 +107,17 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
layout.numColumns = 2;
|
layout.numColumns = 2;
|
||||||
layout.marginHeight = 5;
|
layout.marginHeight = 5;
|
||||||
sashForm.setLayout(layout);
|
sashForm.setLayout(layout);
|
||||||
createSelectionArea(sashForm);
|
if (displayFixedTip==false) {
|
||||||
createEditArea(sashForm);
|
createSelectionArea(sashForm);
|
||||||
|
createEditArea(sashForm);
|
||||||
|
} else {
|
||||||
|
createSelectionArea(sashForm);
|
||||||
|
sashForm2 = new SashForm(sashForm, SWT.NONE);
|
||||||
|
sashForm2.setOrientation(SWT.VERTICAL);
|
||||||
|
createEditArea(sashForm2);
|
||||||
|
createTipArea(sashForm2);
|
||||||
|
sashForm2.setWeights(defaultWeights);
|
||||||
|
}
|
||||||
usercomp.addControlListener(new ControlAdapter() {
|
usercomp.addControlListener(new ControlAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void controlResized(ControlEvent e) {
|
public void controlResized(ControlEvent e) {
|
||||||
|
@ -108,7 +129,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void specificResize() {
|
private void specificResize() {
|
||||||
Point p1 = optionList.getTree().computeSize(-1, -1);
|
Point p1 = optionList.getTree().computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||||
Point p2 = optionList.getTree().getSize();
|
Point p2 = optionList.getTree().getSize();
|
||||||
Point p3 = usercomp.getSize();
|
Point p3 = usercomp.getSize();
|
||||||
p1.x += calcExtra();
|
p1.x += calcExtra();
|
||||||
|
@ -146,6 +167,33 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param name - header of the tooltip help
|
||||||
|
* @param tip - tooltip text
|
||||||
|
* @since 5.2
|
||||||
|
*/
|
||||||
|
protected void updateTipText(String name, String tip) {
|
||||||
|
if (tipText==null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
tipText.setText(name+"\n\n"+tip); //$NON-NLS-1$
|
||||||
|
styleRange.length = name.length();
|
||||||
|
tipText.setStyleRange(styleRange);
|
||||||
|
tipText.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* Method resetTipText
|
||||||
|
* @since 7.0
|
||||||
|
*/
|
||||||
|
private void resetTipText() {
|
||||||
|
if (tipText==null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
tipText.setText(Messages.getString("ToolSettingsTab.0")); //$NON-NLS-1$
|
||||||
|
tipText.update();
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* Method displayOptionsForCategory
|
* Method displayOptionsForCategory
|
||||||
|
@ -176,9 +224,15 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
this,
|
this,
|
||||||
fInfo,
|
fInfo,
|
||||||
optionHolder,
|
optionHolder,
|
||||||
category);
|
category,
|
||||||
|
displayFixedTip);
|
||||||
|
boolean needToolTipBox = false;
|
||||||
|
if (displayFixedTip==true) {
|
||||||
|
needToolTipBox = ((BuildOptionSettingsUI)currentSettingsPage).needToolTipBox(optionHolder,category);
|
||||||
|
}
|
||||||
pages.add(currentSettingsPage);
|
pages.add(currentSettingsPage);
|
||||||
currentSettingsPage.setContainer(this);
|
currentSettingsPage.setContainer(this);
|
||||||
|
currentSettingsPage.setToolTipBoxNeeded(needToolTipBox);
|
||||||
if (currentSettingsPage.getControl() == null) {
|
if (currentSettingsPage.getControl() == null) {
|
||||||
currentSettingsPage.createControl(settingsPageContainer);
|
currentSettingsPage.createControl(settingsPageContainer);
|
||||||
}
|
}
|
||||||
|
@ -191,11 +245,25 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
if (children[i] != currentControl)
|
if (children[i] != currentControl)
|
||||||
children[i].setVisible(false);
|
children[i].setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (displayFixedTip==true) {
|
||||||
|
if (currentSettingsPage.isToolTipBoxNeeded()==false) {
|
||||||
|
// eliminate the option tip box
|
||||||
|
sashForm2.setWeights(hideTipBoxWeights);
|
||||||
|
sashForm2.layout();
|
||||||
|
} else {
|
||||||
|
// display the option tip box
|
||||||
|
sashForm2.setWeights(defaultWeights);
|
||||||
|
sashForm2.layout();
|
||||||
|
}
|
||||||
|
}
|
||||||
currentSettingsPage.setVisible(true);
|
currentSettingsPage.setVisible(true);
|
||||||
currentSettingsPage.updateFields();
|
currentSettingsPage.updateFields();
|
||||||
|
|
||||||
if (oldPage != null && oldPage != currentSettingsPage)
|
if (oldPage != null && oldPage != currentSettingsPage) {
|
||||||
oldPage.setVisible(false);
|
oldPage.setVisible(false);
|
||||||
|
resetTipText();
|
||||||
|
}
|
||||||
|
|
||||||
// Set the size of the scrolled area
|
// Set the size of the scrolled area
|
||||||
containerSC.setMinSize(currentSettingsPage.computeSize());
|
containerSC.setMinSize(currentSettingsPage.computeSize());
|
||||||
|
@ -241,6 +309,12 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
children[i].setVisible(false);
|
children[i].setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (displayFixedTip==true) {
|
||||||
|
// eliminate the tool tip area
|
||||||
|
sashForm2.setWeights(hideTipBoxWeights);
|
||||||
|
sashForm2.layout();
|
||||||
|
}
|
||||||
|
|
||||||
// Make the current page visible
|
// Make the current page visible
|
||||||
currentSettingsPage.setVisible(true);
|
currentSettingsPage.setVisible(true);
|
||||||
|
|
||||||
|
@ -257,12 +331,34 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
containerSC.setMinSize(currentSettingsPage.computeSize());
|
containerSC.setMinSize(currentSettingsPage.computeSize());
|
||||||
settingsPageContainer.layout();
|
settingsPageContainer.layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* Add the fixed-location tool tip box.
|
||||||
|
*/
|
||||||
|
private void createTipArea (Composite parent) {
|
||||||
|
tipText = new StyledText(parent, SWT.V_SCROLL|SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.WRAP);
|
||||||
|
tipText.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||||
|
tipText.setText(Messages.getString("ToolSettingsTab.0")); //$NON-NLS-1$
|
||||||
|
|
||||||
|
styleRange = new StyleRange();
|
||||||
|
styleRange.start = 0;
|
||||||
|
FontData data = new FontData();
|
||||||
|
data.setHeight(10);
|
||||||
|
//data.setName("sans");
|
||||||
|
data.setStyle(SWT.BOLD);
|
||||||
|
Font font = new Font(parent.getDisplay(),data);
|
||||||
|
styleRange.font = font;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* Add the tabs relevant to the project to edit area tab folder.
|
* Add the tabs relevant to the project to edit area tab folder.
|
||||||
*/
|
*/
|
||||||
protected void createEditArea(Composite parent) {
|
protected void createEditArea(Composite parent) {
|
||||||
containerSC = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
|
int style = (SWT.H_SCROLL | SWT.V_SCROLL);
|
||||||
|
if (displayFixedTip) {
|
||||||
|
style |= SWT.BORDER;
|
||||||
|
}
|
||||||
|
containerSC = new ScrolledComposite(parent, style);
|
||||||
containerSC.setExpandHorizontal(true);
|
containerSC.setExpandHorizontal(true);
|
||||||
containerSC.setExpandVertical(true);
|
containerSC.setExpandVertical(true);
|
||||||
|
|
||||||
|
@ -573,7 +669,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the "dirty" state
|
* @return the "dirty" state
|
||||||
*/
|
*/
|
||||||
public boolean isDirty() {
|
public boolean isDirty() {
|
||||||
// Check each settings page
|
// Check each settings page
|
||||||
|
@ -593,12 +689,13 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the build macro provider to be used for macro resolution
|
* @return the build macro provider to be used for macro resolution
|
||||||
* In case the "Build Macros" tab is available, returns the BuildMacroProvider
|
* In case the "Build Macros" tab is available, returns the BuildMacroProvider
|
||||||
* supplied by that tab.
|
* supplied by that tab.
|
||||||
* Unlike the default provider, that provider also contains
|
* Unlike the default provider, that provider also contains
|
||||||
* the user-modified macros that are not applied yet
|
* the user-modified macros that are not applied yet
|
||||||
* If the "Build Macros" tab is not available, returns the default BuildMacroProvider
|
* If the "Build Macros" tab is not available, returns the default BuildMacroProvider
|
||||||
|
*
|
||||||
* @noreference This method is not intended to be referenced by clients.
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
*/
|
*/
|
||||||
public BuildMacroProvider obtainMacroProvider(){
|
public BuildMacroProvider obtainMacroProvider(){
|
||||||
|
|
|
@ -103,6 +103,8 @@ PreferredToolchainsTab.0=Preferred toolchain will be selected by default in Wiza
|
||||||
PreferredToolchainsTab.1=Make toolchain(s) preferred
|
PreferredToolchainsTab.1=Make toolchain(s) preferred
|
||||||
PreferredToolchainsTab.2=Make toolchain(s) not preferred
|
PreferredToolchainsTab.2=Make toolchain(s) not preferred
|
||||||
PreferredToolchainsTab.3=Preferred toolchain(s):
|
PreferredToolchainsTab.3=Preferred toolchain(s):
|
||||||
|
ToolSettingsTab.0=Hover over an option to display its tooltip
|
||||||
|
BuildOptionSettingsUI.0=No tooltip is available for this option
|
||||||
StdProjectTypeHandler.0=-- Other Toolchain --
|
StdProjectTypeHandler.0=-- Other Toolchain --
|
||||||
StdProjectTypeHandler.2=Default
|
StdProjectTypeHandler.2=Default
|
||||||
StdProjectTypeHandler.3=creation Make project: IBuilder is null
|
StdProjectTypeHandler.3=creation Make project: IBuilder is null
|
||||||
|
|
|
@ -37,6 +37,8 @@ public class CDTPrefUtil {
|
||||||
public static final String KEY_DTREE = "properties.data.hierarchy.enable"; //$NON-NLS-1$
|
public static final String KEY_DTREE = "properties.data.hierarchy.enable"; //$NON-NLS-1$
|
||||||
public static final String KEY_NOTOOLM = "properties.toolchain.modification.disable"; //$NON-NLS-1$
|
public static final String KEY_NOTOOLM = "properties.toolchain.modification.disable"; //$NON-NLS-1$
|
||||||
public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$
|
public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$
|
||||||
|
/** @since 5.2 */
|
||||||
|
public static final String KEY_TIPBOX = "properties.option.tipbox.enable"; //$NON-NLS-1$
|
||||||
// string keys
|
// string keys
|
||||||
public static final String KEY_PREFTC = "wizard.preferred.toolchains"; //$NON-NLS-1$
|
public static final String KEY_PREFTC = "wizard.preferred.toolchains"; //$NON-NLS-1$
|
||||||
public static final String KEY_CONFSET = "workingsets.selected.configs"; //$NON-NLS-1$
|
public static final String KEY_CONFSET = "workingsets.selected.configs"; //$NON-NLS-1$
|
||||||
|
|
|
@ -289,6 +289,7 @@ PropertyPageDefsTab.12=Save size and position
|
||||||
PropertyPageDefsTab.13=Save size only
|
PropertyPageDefsTab.13=Save size only
|
||||||
PropertyPageDefsTab.14=Do not save at all
|
PropertyPageDefsTab.14=Do not save at all
|
||||||
PropertyPageDefsTab.15=Center dialogs on screen
|
PropertyPageDefsTab.15=Center dialogs on screen
|
||||||
|
PropertyPageDefsTab.16=Display tool option tips at a fixed location
|
||||||
PropertyPageDefsTab.4=Display "Tool Chain Editor" tab
|
PropertyPageDefsTab.4=Display "Tool Chain Editor" tab
|
||||||
PropertyPageDefsTab.5=Discovery profiles naming rule
|
PropertyPageDefsTab.5=Discovery profiles naming rule
|
||||||
PropertyPageDefsTab.6=Show disc. page names if they are unique. Else names + profile IDs.
|
PropertyPageDefsTab.6=Show disc. page names if they are unique. Else names + profile IDs.
|
||||||
|
|
Loading…
Add table
Reference in a new issue