Skip to content

Commit 6f3c04f

Browse files
author
jantje
committed
Include paths and files and lib paths now work #1126
Also persistency works The libs are not yet added to the command line
1 parent df5e29d commit 6f3c04f

File tree

2 files changed

+41
-63
lines changed

2 files changed

+41
-63
lines changed

io.sloeber.autoBuild.ui/src/io/sloeber/autoBuild/ui/tabs/FileListControlFieldEditor.java

+40-52
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,11 @@
3939
public class FileListControlFieldEditor extends FieldEditor {
4040

4141
// file list control
42-
private FileListControl list;
42+
private FileListControl myListControl;
4343
private int browseType;
4444
private Composite topLayout;
4545
private static final String DEFAULT_SEPARATOR = ";"; //$NON-NLS-1$
4646

47-
//values
48-
// private String[] values = null;
49-
5047
/**
5148
* Creates a file list control field editor.
5249
*
@@ -60,10 +57,10 @@ public class FileListControlFieldEditor extends FieldEditor {
6057
* the browseType of the file list control
6158
*/
6259
public FileListControlFieldEditor(String name, String labelText, Composite parent, int type) {
63-
super(name, labelText, parent);
60+
super();
6461
browseType = type;
65-
// Set the browse strategy for the list editor
66-
list.setType(type);
62+
init(name, labelText);
63+
createControl(parent);
6764
}
6865

6966
/**
@@ -82,13 +79,33 @@ public FileListControlFieldEditor(String name, String labelText, Composite paren
8279
* the browseType of the file list control
8380
*/
8481
public FileListControlFieldEditor(String name, String labelText, String tooltip, String contextId, Composite parent,
85-
int type) {
82+
String value, int type) {
8683
this(name, labelText, parent, type);
8784
// can't use setToolTip(tooltip) as label not created yet
8885
getLabelControl(parent).setToolTipText(tooltip);
8986
if (!contextId.isEmpty())
90-
PlatformUI.getWorkbench().getHelpSystem().setHelp(list.getListControl(), contextId);
87+
PlatformUI.getWorkbench().getHelpSystem().setHelp(myListControl.getListControl(), contextId);
88+
myListControl.setList(parseString(value));
9189
}
90+
/**
91+
* Creates a file list control field editor.
92+
*
93+
* @param name
94+
* the name of the preference this field editor works on
95+
* @param labelText
96+
* the label text of the field editor
97+
* @param parent
98+
* the parent of the field editor's control
99+
* @param value
100+
* the field editor's value
101+
* @param type
102+
* the browseType of the file list control
103+
*/
104+
// public FileListControlFieldEditor(String name, String labelText, Composite parent, String value, int type) {
105+
// this(name, labelText, parent, type);
106+
// browseType = type;
107+
// // this.values = parseString(value);
108+
// }
92109

93110
/**
94111
* Sets the field editor's tool tip text to the argument, which
@@ -128,26 +145,6 @@ public String getToolTipText() {
128145
return getLabelControl().getToolTipText();
129146
}
130147

131-
/**
132-
* Creates a file list control field editor.
133-
*
134-
* @param name
135-
* the name of the preference this field editor works on
136-
* @param labelText
137-
* the label text of the field editor
138-
* @param parent
139-
* the parent of the field editor's control
140-
* @param value
141-
* the field editor's value
142-
* @param type
143-
* the browseType of the file list control
144-
*/
145-
public FileListControlFieldEditor(String name, String labelText, Composite parent, String value, int type) {
146-
this(name, labelText, parent, type);
147-
browseType = type;
148-
// this.values = parseString(value);
149-
}
150-
151148
/**
152149
* Sets the filter-path for the underlying Browse dialog. Only applies when
153150
* browseType is 'file' or 'dir'.
@@ -157,7 +154,7 @@ public FileListControlFieldEditor(String name, String labelText, Composite paren
157154
* @since 7.0
158155
*/
159156
public void setFilterPath(String filterPath) {
160-
list.setFilterPath(filterPath);
157+
myListControl.setFilterPath(filterPath);
161158
}
162159

163160
/**
@@ -169,7 +166,7 @@ public void setFilterPath(String filterPath) {
169166
* @since 7.0
170167
*/
171168
public void setFilterExtensions(String[] filterExtensions) {
172-
list.setFilterExtensions(filterExtensions);
169+
myListControl.setFilterExtensions(filterExtensions);
173170
}
174171

175172
/**
@@ -188,8 +185,8 @@ protected void doFillIntoGrid(Composite parent, int numColumns) {
188185
gddata.horizontalSpan = 2;
189186
topLayout.setLayoutData(gddata);
190187
// file list control
191-
list = new FileListControl(topLayout, getLabelText(), getType(), false);
192-
list.addChangeListener(new IFileListChangeListener() {
188+
myListControl = new FileListControl(topLayout, getLabelText(), browseType, false);
189+
myListControl.addChangeListener(new IFileListChangeListener() {
193190

194191
@Override
195192
public void fileListChanged(FileListControl fileList, String oldValue[], String newValue[]) {
@@ -205,41 +202,32 @@ private void handleFileListChange(FileListControl fileList, String oldValue[], S
205202
fireValueChanged(VALUE, createList(oldValue), createList(newValue));
206203
}
207204

208-
/**
209-
* Returns the browseType of this field editor's file list control
210-
*
211-
* @return
212-
*/
213-
private int getType() {
214-
return browseType;
215-
}
216-
217205
/**
218206
* @return the file list control
219207
*/
220208
protected List getListControl() {
221-
return list.getListControl();
209+
return myListControl.getListControl();
222210
}
223211

224212
/* (non-Javadoc)
225213
* @see org.eclipse.jface.preference.FieldEditor#doLoad()
226214
*/
227215
@Override
228216
protected void doLoad() {
229-
list.selectionChanged();
217+
myListControl.selectionChanged();
230218
}
231219

232220
/* (non-Javadoc)
233221
* @see org.eclipse.jface.preference.FieldEditor#doLoadDefault()
234222
*/
235223
@Override
236224
protected void doLoadDefault() {
237-
if (list != null) {
238-
list.removeAll();
225+
if (myListControl != null) {
226+
myListControl.removeAll();
239227
String s = getPreferenceStore().getDefaultString(getPreferenceName());
240228
String[] array = parseString(s);
241-
list.setList(array);
242-
list.selectionChanged();
229+
myListControl.setList(array);
230+
myListControl.selectionChanged();
243231
}
244232
}
245233

@@ -248,13 +236,13 @@ protected void doLoadDefault() {
248236
*/
249237
@Override
250238
protected void doStore() {
251-
String s = createList(list.getItems());
239+
String s = createList(myListControl.getItems());
252240
if (s != null)
253241
getPreferenceStore().setValue(getPreferenceName(), s);
254242
}
255243

256244
public String[] getStringListValue() {
257-
return list.getItems();
245+
return myListControl.getItems();
258246
}
259247

260248
/**
@@ -319,12 +307,12 @@ protected void adjustForNumColumns(int numColumns) {
319307

320308
@Override
321309
public Label getLabelControl(Composite parent) {
322-
return list.getLabelControl();
310+
return myListControl.getLabelControl();
323311
}
324312

325313
@Override
326314
public void setEnabled(boolean enabled, Composite parent) {
327-
list.setEnabled(enabled);
315+
myListControl.setEnabled(enabled);
328316
}
329317

330318
}

io.sloeber.autoBuild.ui/src/io/sloeber/autoBuild/ui/tabs/ToolSettingsTab.java

+1-11
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.HashMap;
2222
import java.util.Map;
2323
import java.util.Set;
24-
import java.util.Vector;
2524

2625
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
2726
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
@@ -107,20 +106,11 @@ public class ToolSettingsTab extends AbstractAutoBuildPropertyTab {
107106
private Composite mySettingsPageContainer;
108107
private ScrolledComposite containerSC;
109108

110-
/*
111-
* Bookeeping variables
112-
*/
113-
// private Map<String, List<AbstractToolSettingUI>> configToPageListMap;
114-
// private IPreferenceStore settingsStore;
115-
// private AbstractToolSettingUI currentSettingsPage;
116109
private ToolListContentProvider listprovider;
117110
private IResource mySelectedResource;
118111

119-
// private IResourceInfo fInfo;
120-
121112
private boolean displayFixedTip = CDTPrefUtil.getBool(CDTPrefUtil.KEY_TIPBOX);
122113
private int[] defaultWeights = new int[] { 4, 1 };
123-
private int[] hideTipBoxWeights = new int[] { 1, 0 };
124114

125115
private boolean isIndexerAffected;
126116
private static String COMMAND_LINE_PATTERN = "command Line Pattern"; //$NON-NLS-1$
@@ -503,7 +493,7 @@ public void modifyText(ModifyEvent e) {
503493
// if (displayFixedTip==false), tooltip was already set in FileListControlFieldEditor constructor.
504494
String tooltipHoverStr = displayFixedTip ? null : tipStr;
505495
fieldEditor = new FileListControlFieldEditor(optId, nameStr, tooltipHoverStr, contextId,
506-
mySettingsPageContainer, curOption.getBrowseType());
496+
mySettingsPageContainer, optionValue, curOption.getBrowseType());
507497
if (curOption.getBrowseFilterPath() != null) {
508498
String filterPath = AutoBuildCommon.resolve(curOption.getBrowseFilterPath(),
509499
myAutoConfDesc);

0 commit comments

Comments
 (0)