Skip to content

Commit 1fe98b0

Browse files
author
jan
committed
fix regression in json selection page; remove update flag
The update flag is to be replaced by a time based setting together with the other options
1 parent 48ab9cf commit 1fe98b0

File tree

3 files changed

+70
-411
lines changed

3 files changed

+70
-411
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package io.sloeber.ui;
2+
3+
import org.eclipse.cdt.core.parser.util.StringUtil;
4+
import org.eclipse.cdt.ui.newui.MultiLineTextFieldEditor;
5+
import org.eclipse.swt.SWT;
6+
import org.eclipse.swt.layout.GridData;
7+
import org.eclipse.swt.widgets.Composite;
8+
import org.eclipse.swt.widgets.Text;
9+
10+
11+
/**
12+
* A class to change MultiLineTextFieldEditor so it puts the label on top of the
13+
* text field and the text field expands bot horizontal and verical
14+
* Note I needed a FLAT parent FieldEditorPreferencePage (GRID did not work)
15+
* public ThirdPartyHardwareSelectionPage() {
16+
* super(org.eclipse.jface.preference.FieldEditorPreferencePage.FLAT);
17+
*/
18+
public class JsonMultiLineTextFieldEditor extends MultiLineTextFieldEditor{
19+
20+
public JsonMultiLineTextFieldEditor(String name, String labelText, int width, int strategy, Composite parent) {
21+
super( name, labelText, width,strategy, parent);
22+
}
23+
24+
/**
25+
* I want 1 column
26+
*/
27+
@Override
28+
public int getNumberOfControls() {
29+
return 1;
30+
}
31+
32+
33+
/**
34+
* I want a GridData that has horizontal fill
35+
*/
36+
@Override
37+
protected void doFillIntoGrid(Composite parent, int numColumns) {
38+
super.doFillIntoGrid( parent, numColumns) ;
39+
40+
Text textField = getTextControl(parent);
41+
textField.setLayoutData( new GridData(SWT.FILL,SWT.BEGINNING,true,false));
42+
43+
}
44+
45+
public void setText(String[] text) {
46+
String actualText=StringUtil.join(text, System.lineSeparator());
47+
getPreferenceStore().setValue(getPreferenceName(), actualText);
48+
setStringValue(actualText );
49+
}
50+
51+
}

0 commit comments

Comments
 (0)