Skip to content

Commit 819797c

Browse files
HeikoKlareakurtakov
authored andcommitted
Unify access to static members
Applies the following cleanup rules concerning static member access to all projects in order to be conform with defined save actions: * change non-static accesses to static members using declaring type * change indirect accesses to static members to direct accesses
1 parent d6049bd commit 819797c

File tree

16 files changed

+34
-29
lines changed

16 files changed

+34
-29
lines changed

bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/CSSRenderingUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public Image createImage(Control styleControl, String classId,
232232
return null;
233233
}
234234
if (classId != null)
235-
ControlElement.setCSSClass(styleControl, classId);
235+
WidgetElement.setCSSClass(styleControl, classId);
236236

237237
CSSStyleDeclaration styleDeclarations = csseng.getViewCSS()
238238
.getComputedStyle(tempEment, "");

examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/Snippet070GenericSelectionDialog.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
import java.util.stream.Collectors;
2020

2121
import org.eclipse.jface.dialogs.AbstractSelectionDialog;
22-
import org.eclipse.jface.dialogs.Dialog;
2322
import org.eclipse.jface.dialogs.IDialogConstants;
2423
import org.eclipse.jface.viewers.ArrayContentProvider;
2524
import org.eclipse.jface.viewers.IStructuredSelection;
2625
import org.eclipse.jface.viewers.LabelProvider;
2726
import org.eclipse.jface.viewers.ListViewer;
2827
import org.eclipse.jface.viewers.StructuredSelection;
2928
import org.eclipse.jface.widgets.WidgetFactory;
29+
import org.eclipse.jface.window.Window;
3030
import org.eclipse.swt.SWT;
3131
import org.eclipse.swt.layout.FillLayout;
3232
import org.eclipse.swt.layout.GridData;
@@ -49,7 +49,7 @@ public Snippet070GenericSelectionDialog(final Shell shell) {
4949
"SelectionDialog with generics", "Select one or more of the Model elements");
5050

5151
int open = genericSelectionDialog.open();
52-
if (Dialog.OK == open) {
52+
if (Window.OK == open) {
5353
Collection<Model> result = genericSelectionDialog.getResult();
5454
text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
5555
text.setText(result.stream().map(Object::toString)

examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ErrorMessagesPage.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import org.eclipse.ui.forms.editor.FormPage;
4141
import org.eclipse.ui.forms.events.HyperlinkAdapter;
4242
import org.eclipse.ui.forms.events.HyperlinkEvent;
43+
import org.eclipse.ui.forms.widgets.ExpandableComposite;
4344
import org.eclipse.ui.forms.widgets.Form;
4445
import org.eclipse.ui.forms.widgets.FormText;
4546
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -126,7 +127,7 @@ public void widgetDisposed(DisposeEvent e) {
126127
TableWrapLayout layout = new TableWrapLayout();
127128
form.getBody().setLayout(layout);
128129
Section section = toolkit.createSection(form.getBody(),
129-
Section.TITLE_BAR);
130+
ExpandableComposite.TITLE_BAR);
130131
section.setText("Local field messages");
131132
Composite sbody = toolkit.createComposite(section);
132133
section.setClient(sbody);

examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/FreeFormPage.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private static void createFormTextSection(final ScrolledForm form, FormToolkit t
108108
Section section =
109109
toolkit.createSection(
110110
form.getBody(),
111-
Section.TWISTIE | Section.DESCRIPTION);
111+
ExpandableComposite.TWISTIE | Section.DESCRIPTION);
112112
section.setActiveToggleColor(
113113
toolkit.getHyperlinkGroup().getActiveForeground());
114114
section.setToggleColor(

examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/NewStylePage.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import org.eclipse.jface.action.Action;
2020
import org.eclipse.jface.action.ControlContribution;
21+
import org.eclipse.jface.action.IAction;
2122
import org.eclipse.jface.dialogs.IMessageProvider;
2223
import org.eclipse.jface.dialogs.MessageDialog;
2324
import org.eclipse.swt.SWT;
@@ -502,7 +503,7 @@ private void addRemoveMessage(Button button, IMessageManager mm) {
502503

503504
private void addToolBar(FormToolkit toolkit, ScrolledForm form, boolean add) {
504505
if (add) {
505-
Action haction = new Action("hor", Action.AS_RADIO_BUTTON) {
506+
Action haction = new Action("hor", IAction.AS_RADIO_BUTTON) {
506507
@Override
507508
public void run() {
508509
}
@@ -512,7 +513,7 @@ public void run() {
512513
haction.setImageDescriptor(ExamplesPlugin.getDefault()
513514
.getImageRegistry().getDescriptor(
514515
ExamplesPlugin.IMG_HORIZONTAL));
515-
Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) {
516+
Action vaction = new Action("ver", IAction.AS_RADIO_BUTTON) {
516517
@Override
517518
public void run() {
518519
}
@@ -542,7 +543,7 @@ protected Control createControl(Composite parent) {
542543

543544
private void addMenu(FormToolkit toolkit, ScrolledForm form, boolean add) {
544545
if (add) {
545-
Action haction = new Action("hor", Action.AS_RADIO_BUTTON) {
546+
Action haction = new Action("hor", IAction.AS_RADIO_BUTTON) {
546547
@Override
547548
public void run() {
548549
}
@@ -553,7 +554,7 @@ public void run() {
553554
haction.setImageDescriptor(ExamplesPlugin.getDefault()
554555
.getImageRegistry().getDescriptor(
555556
ExamplesPlugin.IMG_HORIZONTAL));
556-
Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) {
557+
Action vaction = new Action("ver", IAction.AS_RADIO_BUTTON) {
557558
@Override
558559
public void run() {
559560
}

examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ScrolledPropertiesBlock.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*******************************************************************************/
1414
package org.eclipse.ui.forms.examples.internal.rcp;
1515
import org.eclipse.jface.action.Action;
16+
import org.eclipse.jface.action.IAction;
1617
import org.eclipse.jface.viewers.IStructuredContentProvider;
1718
import org.eclipse.jface.viewers.ITableLabelProvider;
1819
import org.eclipse.jface.viewers.LabelProvider;
@@ -117,7 +118,7 @@ protected void createMasterPart(final IManagedForm managedForm,
117118
@Override
118119
protected void createToolBarActions(IManagedForm managedForm) {
119120
final ScrolledForm form = managedForm.getForm();
120-
Action haction = new Action("hor", Action.AS_RADIO_BUTTON) {
121+
Action haction = new Action("hor", IAction.AS_RADIO_BUTTON) {
121122
@Override
122123
public void run() {
123124
sashForm.setOrientation(SWT.HORIZONTAL);
@@ -129,7 +130,7 @@ public void run() {
129130
haction.setImageDescriptor(ExamplesPlugin.getDefault()
130131
.getImageRegistry()
131132
.getDescriptor(ExamplesPlugin.IMG_HORIZONTAL));
132-
Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) {
133+
Action vaction = new Action("ver", IAction.AS_RADIO_BUTTON) {
133134
@Override
134135
public void run() {
135136
sashForm.setOrientation(SWT.VERTICAL);

examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SecondPage.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ protected void createFormContent(IManagedForm managedForm) {
6161

6262
private Section createTableSection(final ScrolledForm form,
6363
FormToolkit toolkit, String title, boolean addTextClient) {
64-
Section section = toolkit.createSection(form.getBody(), Section.TWISTIE
65-
| Section.TITLE_BAR);
64+
Section section = toolkit.createSection(form.getBody(), ExpandableComposite.TWISTIE
65+
| ExpandableComposite.TITLE_BAR);
6666
section.setActiveToggleColor(toolkit.getHyperlinkGroup()
6767
.getActiveForeground());
6868
section.setToggleColor(toolkit.getColors().getColor(

examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/SingleHeaderEditor.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.eclipse.core.runtime.IProgressMonitor;
1717
import org.eclipse.jface.action.Action;
1818
import org.eclipse.jface.action.ControlContribution;
19+
import org.eclipse.jface.action.IAction;
1920
import org.eclipse.swt.SWT;
2021
import org.eclipse.swt.widgets.Button;
2122
import org.eclipse.swt.widgets.Composite;
@@ -82,7 +83,7 @@ public boolean isSaveAsAllowed() {
8283
}
8384

8485
private void addToolBar(Form form) {
85-
Action haction = new Action("hor", Action.AS_RADIO_BUTTON) {
86+
Action haction = new Action("hor", IAction.AS_RADIO_BUTTON) {
8687
@Override
8788
public void run() {
8889
}
@@ -92,7 +93,7 @@ public void run() {
9293
haction.setImageDescriptor(ExamplesPlugin.getDefault()
9394
.getImageRegistry()
9495
.getDescriptor(ExamplesPlugin.IMG_HORIZONTAL));
95-
Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) {
96+
Action vaction = new Action("ver", IAction.AS_RADIO_BUTTON) {
9697
@Override
9798
public void run() {
9899
}

examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/internal/rcp/ThirdPage.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ private Composite createSection(IManagedForm mform, String title,
121121
String desc, int numColumns) {
122122
final ScrolledForm form = mform.getForm();
123123
FormToolkit toolkit = mform.getToolkit();
124-
Section section = toolkit.createSection(form.getBody(), Section.TWISTIE
125-
| Section.SHORT_TITLE_BAR | Section.DESCRIPTION | Section.EXPANDED);
124+
Section section = toolkit.createSection(form.getBody(), ExpandableComposite.TWISTIE
125+
| ExpandableComposite.SHORT_TITLE_BAR | Section.DESCRIPTION | ExpandableComposite.EXPANDED);
126126
section.setText(title);
127127
section.setDescription(desc);
128128
Composite client = toolkit.createComposite(section);

examples/org.eclipse.ui.forms.examples/src/org/eclipse/ui/forms/examples/views/FormView.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public void expansionStateChanged(ExpansionEvent e) {
155155
form.reflow(true);
156156
}
157157
});
158-
Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TWISTIE|Section.EXPANDED);
158+
Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED);
159159
td = new TableWrapData(TableWrapData.FILL);
160160
td.colspan = 2;
161161
section.setLayoutData(td);

tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/ValueTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ void testCommaSeparatedList() throws Exception {
130130
}
131131
assertEquals(CSSPrimitiveValue.CSS_NUMBER,
132132
((Measure) list.item(0)).getPrimitiveType());
133-
assertEquals(CSSPrimitiveValue.CSS_CUSTOM,
133+
assertEquals(CSSValue.CSS_CUSTOM,
134134
((Measure) list.item(1)).getPrimitiveType());
135135
assertEquals(CSSPrimitiveValue.CSS_NUMBER,
136136
((Measure) list.item(2)).getPrimitiveType());
137-
assertEquals(CSSPrimitiveValue.CSS_CUSTOM,
137+
assertEquals(CSSValue.CSS_CUSTOM,
138138
((Measure) list.item(3)).getPrimitiveType());
139139
assertEquals(CSSPrimitiveValue.CSS_NUMBER,
140140
((Measure) list.item(4)).getPrimitiveType());

tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/forms/SectionTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.eclipse.swt.layout.FillLayout;
2525
import org.eclipse.swt.widgets.Composite;
2626
import org.eclipse.swt.widgets.Shell;
27+
import org.eclipse.ui.forms.widgets.ExpandableComposite;
2728
import org.eclipse.ui.forms.widgets.Section;
2829
import org.eclipse.ui.forms.widgets.ToggleHyperlink;
2930
import org.junit.jupiter.api.Test;
@@ -45,7 +46,7 @@ protected Section createTestSection(String styleSheet) {
4546
Composite compositeToTest = new Composite(shell, SWT.NONE);
4647
compositeToTest.setLayout(new FillLayout());
4748

48-
Section test = new Section(shell, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
49+
Section test = new Section(shell, ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
4950

5051
// Apply styles
5152
engine.applyStyles(shell, true);

tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt/CTabFolderTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import static org.junit.jupiter.api.Assertions.assertEquals;
1919
import static org.junit.jupiter.api.Assertions.assertNotSame;
2020

21-
import org.eclipse.e4.ui.css.swt.dom.CTabFolderElement;
21+
import org.eclipse.e4.ui.css.swt.dom.WidgetElement;
2222
import org.eclipse.swt.SWT;
2323
import org.eclipse.swt.custom.CTabFolder;
2424
import org.eclipse.swt.custom.CTabItem;
@@ -304,14 +304,14 @@ void testTopRightAsDescendentChild() {
304304
ToolBar barB = toolBars[1];
305305
ToolBar barC = toolBars[2];
306306

307-
CTabFolderElement.setCSSClass(barA.getParent(), "special");
307+
WidgetElement.setCSSClass(barA.getParent(), "special");
308308
engine.applyStyles(barA.getShell(), true);
309309

310310
assertEquals(RED, barA.getBackground().getRGB());
311311
assertEquals(GREEN, barB.getBackground().getRGB());
312312
assertEquals(BLUE, barC.getBackground().getRGB());
313313

314-
CTabFolderElement.setCSSClass(barA.getParent(), "extraordinary");
314+
WidgetElement.setCSSClass(barA.getParent(), "extraordinary");
315315
engine.applyStyles(barA.getShell(), true);
316316

317317
assertEquals(WHITE, barA.getBackground().getRGB());

tests/org.eclipse.ui.tests.forms/forms/org/eclipse/ui/tests/forms/performance/FormsPerformanceTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public void expansionStateChanged(ExpansionEvent e) {
157157
//form.reflow(true);
158158
}
159159
});
160-
Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TWISTIE|Section.EXPANDED);
160+
Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED);
161161
td = new TableWrapData(TableWrapData.FILL);
162162
td.colspan = 2;
163163
section.setLayoutData(td);

tests/org.eclipse.ui.tests.forms/forms/org/eclipse/ui/tests/forms/widgets/SectionFactoryTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.eclipse.swt.widgets.Label;
2222
import org.eclipse.swt.widgets.Shell;
2323
import org.eclipse.ui.forms.events.ExpansionEvent;
24+
import org.eclipse.ui.forms.widgets.ExpandableComposite;
2425
import org.eclipse.ui.forms.widgets.Section;
2526
import org.eclipse.ui.forms.widgets.SectionFactory;
2627
import org.eclipse.ui.forms.widgets.Twistie;
@@ -69,7 +70,7 @@ public void createsSectionWithDescriptionControl() {
6970
@Test
7071
public void addsSectionExpandListeners() {
7172
final ExpansionEvent[] raisedEvents = new ExpansionEvent[1];
72-
Section section = SectionFactory.newSection(Section.TWISTIE).onExpanded(e -> raisedEvents[0] = e)
73+
Section section = SectionFactory.newSection(ExpandableComposite.TWISTIE).onExpanded(e -> raisedEvents[0] = e)
7374
.create(shell);
7475
Control twistie = section.getChildren()[0];
7576
assertTrue("Expected a twistie", twistie instanceof Twistie);
@@ -81,7 +82,7 @@ public void addsSectionExpandListeners() {
8182
@Test
8283
public void addsSectionExpandingListener() {
8384
final ExpansionEvent[] raisedEvents = new ExpansionEvent[1];
84-
Section section = SectionFactory.newSection(Section.TWISTIE).onExpanding(e -> raisedEvents[0] = e)
85+
Section section = SectionFactory.newSection(ExpandableComposite.TWISTIE).onExpanding(e -> raisedEvents[0] = e)
8586
.create(shell);
8687
Control twistie = section.getChildren()[0];
8788
assertTrue("Expected a twistie", twistie instanceof Twistie);

tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/resources/NestedResourcesTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.util.HashSet;
2020
import java.util.Set;
2121

22-
import org.eclipse.core.internal.resources.Marker;
2322
import org.eclipse.core.resources.IFolder;
2423
import org.eclipse.core.resources.IMarker;
2524
import org.eclipse.core.resources.IProject;
@@ -160,7 +159,7 @@ public void testProblemDecoration() throws Exception {
160159
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
161160
}, monitor);
162161
assertTrue(DisplayHelper.waitForCondition(Display.getDefault(), TIMEOUT,
163-
() -> Marker.SEVERITY_WARNING == labelProvider.getHighestProblemSeverity(parentProject)));
162+
() -> IMarker.SEVERITY_WARNING == labelProvider.getHighestProblemSeverity(parentProject)));
164163
//
165164
root.getWorkspace().run(aMonitor -> {
166165
IMarker marker = secondChildProject.createMarker(IMarker.PROBLEM);

0 commit comments

Comments
 (0)