Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui')
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CreateParserLogAction.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java8
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java4
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/ConsoleMessages.properties6
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHReferenceInfo.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPage.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPerFilePage.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBHistoryListAction.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeAssistAdvancedConfigurationBlock.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionMapEditDialog.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java55
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TabConfigurationBlock.java9
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java17
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactoringMatchStore.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistInvocationContext.java24
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistProcessor.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CSelectAnnotationRulerAction.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THHistoryListAction.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetConfigsContribution.java2
23 files changed, 82 insertions, 73 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CreateParserLogAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CreateParserLogAction.java
index 7f2cd706952..da57db0f6db 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CreateParserLogAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/CreateParserLogAction.java
@@ -131,7 +131,7 @@ public class CreateParserLogAction implements IObjectActionDelegate {
}
}
- private static final Comparator<String> COMP_INSENSITIVE = new Comparator<String>() {
+ private static final Comparator<String> COMP_INSENSITIVE = new Comparator<>() {
@Override
public int compare(String o1, String o2) {
return o1.toUpperCase().compareTo(o2.toUpperCase());
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java
index ce703f2d1f7..9e1dc20db17 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java
@@ -46,6 +46,7 @@ import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
@@ -409,7 +410,12 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
if (v == null)
return;
Display display = Display.getDefault();
- display.asyncExec(() -> v.getTextWidget().redraw());
+ display.asyncExec(() -> {
+ StyledText widget = v.getTextWidget();
+ if (widget != null && !widget.isDisposed()) {
+ widget.redraw();
+ }
+ });
}
public IBuildConsoleStreamDecorator getStreamDecorator(int type) throws CoreException {
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java
index 01d3561bee2..7294300c5c7 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java
@@ -259,7 +259,9 @@ public class BuildConsolePage extends Page
setTabs(CUIPlugin.getDefault().getPreferenceStore()
.getInt(BuildConsolePreferencePage.PREF_BUILDCONSOLE_TAB_WIDTH));
} else if (IConsoleConstants.P_BACKGROUND_COLOR.equals(property)) {
- fViewer.getTextWidget().setBackground(fConsole.getBackground());
+ if (fViewer != null && fViewer.getTextWidget() != null && fConsole != null) {
+ fViewer.getTextWidget().setBackground(fConsole.getBackground());
+ }
} else if (property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_WRAP_LINES)
|| property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_LINES)
|| property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_WRAP_LINES_MAX)) {
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/ConsoleMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/ConsoleMessages.properties
index d65a275b2df..2e848515039 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/ConsoleMessages.properties
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/ConsoleMessages.properties
@@ -26,11 +26,11 @@ BuildConsolePage_Select__All_Ctrl_A_12=Select &All@Ctrl+A
BuildConsolePage_Select_All=Select All
CBuildConsole_Console_Must_Be_Started_First=Build Console must be started with a specific project before being used.
-CopyLog_ActionTooltip=Copy Build Log
+CopyLog_ActionTooltip=Save build log to file
CopyLog_BuildNotLogged=No build was logged. Build the project or/and check the Logging page in project properties.
CopyLog_ChooseDestination=Choose Log File Destination
-CopyLog_ErrorCopyingFile=Error Copying a File
-CopyLog_ErrorWhileCopyingLog=Error while copying working log file:\u0020
+CopyLog_ErrorCopyingFile=Error Saving File
+CopyLog_ErrorWhileCopyingLog=Error while saving working log file:\u0020
CopyLog_InvalidDestination=Destination is not valid:\u0020
CopyLog_LogFileIsNotAvailable=Working log file is not available.
CopyLog_UnableToAccess=Unable to access build log at\u0020
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java
index 298d3af4b6b..b1542e510d9 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHHistoryListAction.java
@@ -51,7 +51,7 @@ public class CHHistoryListAction extends Action {
setTitle(CHMessages.CHHistoryListAction_HistoryDialog_title);
String[] buttonLabels = new String[] { CHMessages.CHHistoryListAction_Remove_label, };
- IListAdapter<ICElement> adapter = new IListAdapter<ICElement>() {
+ IListAdapter<ICElement> adapter = new IListAdapter<>() {
@Override
public void customButtonPressed(ListDialogField<ICElement> field, int index) {
doCustomButtonPressed();
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHReferenceInfo.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHReferenceInfo.java
index b1f22241918..84ae89a9b55 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHReferenceInfo.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHReferenceInfo.java
@@ -16,7 +16,7 @@ package org.eclipse.cdt.internal.ui.callhierarchy;
import java.util.Comparator;
public class CHReferenceInfo {
- public static final Comparator<CHReferenceInfo> COMPARE_OFFSET = new Comparator<CHReferenceInfo>() {
+ public static final Comparator<CHReferenceInfo> COMPARE_OFFSET = new Comparator<>() {
@Override
public int compare(CHReferenceInfo r1, CHReferenceInfo r2) {
return r1.fOffset - r2.fOffset;
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPage.java
index 5800b757a28..d74d0851717 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPage.java
@@ -171,7 +171,7 @@ public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage
super(CPathEntryMessages.IncludeSymbolEntryPage_title);
fContext = context;
IncludeSymbolAdapter adapter = new IncludeSymbolAdapter();
- fIncludeSymPathsList = new TreeListDialogField<CPElementGroup>(adapter, buttonLabel,
+ fIncludeSymPathsList = new TreeListDialogField<>(adapter, buttonLabel,
new CPElementLabelProvider(true, false)) {
@Override
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPerFilePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPerFilePage.java
index e7f851ce9fa..d8196638481 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPerFilePage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPerFilePage.java
@@ -218,7 +218,7 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
super(CPathEntryMessages.IncludeSymbolEntryPage_title);
fContext = context;
IncludeSymbolAdapter adapter = new IncludeSymbolAdapter();
- fIncludeSymPathsList = new TreeListDialogField<CPElementGroup>(adapter, buttonLabel,
+ fIncludeSymPathsList = new TreeListDialogField<>(adapter, buttonLabel,
new CPElementLabelProvider(true, false)) {
@Override
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBHistoryListAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBHistoryListAction.java
index fdb0fcc5b9e..8136b813cc6 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBHistoryListAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBHistoryListAction.java
@@ -52,7 +52,7 @@ public class IBHistoryListAction extends Action {
setTitle(IBMessages.IBHistoryListAction_HistoryDialog_title);
String[] buttonLabels = new String[] { IBMessages.IBHistoryListAction_Remove_label, };
- IListAdapter<ITranslationUnit> adapter = new IListAdapter<ITranslationUnit>() {
+ IListAdapter<ITranslationUnit> adapter = new IListAdapter<>() {
@Override
public void customButtonPressed(ListDialogField<ITranslationUnit> field, int index) {
doCustomButtonPressed();
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeAssistAdvancedConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeAssistAdvancedConfigurationBlock.java
index 23daffbe50f..5649396e724 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeAssistAdvancedConfigurationBlock.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeAssistAdvancedConfigurationBlock.java
@@ -158,7 +158,7 @@ final class CodeAssistAdvancedConfigurationBlock extends OptionsConfigurationBlo
}
}
- private final Comparator<ModelElement> fCategoryComparator = new Comparator<ModelElement>() {
+ private final Comparator<ModelElement> fCategoryComparator = new Comparator<>() {
@Override
public int compare(ModelElement o1, ModelElement o2) {
return o1.getRank() - o2.getRank();
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionMapEditDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionMapEditDialog.java
index ea7a495068b..385b8173bff 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionMapEditDialog.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/HeaderSubstitutionMapEditDialog.java
@@ -80,7 +80,7 @@ public class HeaderSubstitutionMapEditDialog extends ResizableStatusDialog {
private static final String UTF_8 = "UTF-8"; //$NON-NLS-1$
private static final String TAG_HEADER_SUBSTITUTION_MAP = "header_substitution_map"; //$NON-NLS-1$
private static final Collator COLLATOR = Collator.getInstance();
- private static final Comparator<HeaderSubstitutionRule> SOURCE_COMPARATOR = new Comparator<HeaderSubstitutionRule>() {
+ private static final Comparator<HeaderSubstitutionRule> SOURCE_COMPARATOR = new Comparator<>() {
@Override
public int compare(HeaderSubstitutionRule r1, HeaderSubstitutionRule r2) {
return COLLATOR.compare(r1.getSource(), r2.getSource());
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java
index 769d3b1030a..7f2d7e14be0 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java
@@ -160,53 +160,50 @@ public class NameStyleBlock extends OptionsConfigurationBlock {
Category codeCategory = new Category(PreferencesMessages.NameStyleBlock_code_node);
new Category(PreferencesMessages.NameStyleBlock_constant_node,
PreferencesMessages.NameStyleBlock_constant_node_description, EXAMPLE_CONSTANT_NAME, codeCategory)
- .setCapitalizationKey(KEY_CONSTANT_CAPITALIZATION)
- .setWordDelimiterKey(KEY_CONSTANT_WORD_DELIMITER).setPrefixKey(KEY_CONSTANT_PREFIX)
- .setSuffixKey(KEY_CONSTANT_SUFFIX).setNameValidator(IDENTIFIER_VALIDATOR);
+ .setCapitalizationKey(KEY_CONSTANT_CAPITALIZATION).setWordDelimiterKey(KEY_CONSTANT_WORD_DELIMITER)
+ .setPrefixKey(KEY_CONSTANT_PREFIX).setSuffixKey(KEY_CONSTANT_SUFFIX)
+ .setNameValidator(IDENTIFIER_VALIDATOR);
new Category(PreferencesMessages.NameStyleBlock_variable_node,
PreferencesMessages.NameStyleBlock_variable_node_description, EXAMPLE_VARIABLE_NAME, codeCategory)
- .setCapitalizationKey(KEY_VARIABLE_CAPITALIZATION)
- .setWordDelimiterKey(KEY_VARIABLE_WORD_DELIMITER).setPrefixKey(KEY_VARIABLE_PREFIX)
- .setSuffixKey(KEY_VARIABLE_SUFFIX).setNameValidator(IDENTIFIER_VALIDATOR);
+ .setCapitalizationKey(KEY_VARIABLE_CAPITALIZATION).setWordDelimiterKey(KEY_VARIABLE_WORD_DELIMITER)
+ .setPrefixKey(KEY_VARIABLE_PREFIX).setSuffixKey(KEY_VARIABLE_SUFFIX)
+ .setNameValidator(IDENTIFIER_VALIDATOR);
Category fieldCategory = new Category(PreferencesMessages.NameStyleBlock_field_node,
PreferencesMessages.NameStyleBlock_field_node_description, EXAMPLE_FIELD_NAME, codeCategory)
- .setCapitalizationKey(KEY_FIELD_CAPITALIZATION).setWordDelimiterKey(KEY_FIELD_WORD_DELIMITER)
- .setPrefixKey(KEY_FIELD_PREFIX).setSuffixKey(KEY_FIELD_SUFFIX)
- .setNameValidator(IDENTIFIER_VALIDATOR);
+ .setCapitalizationKey(KEY_FIELD_CAPITALIZATION).setWordDelimiterKey(KEY_FIELD_WORD_DELIMITER)
+ .setPrefixKey(KEY_FIELD_PREFIX).setSuffixKey(KEY_FIELD_SUFFIX).setNameValidator(IDENTIFIER_VALIDATOR);
new Category(PreferencesMessages.NameStyleBlock_method_node,
PreferencesMessages.NameStyleBlock_method_node_description, EXAMPLE_METHOD_NAME, codeCategory)
- .setCapitalizationKey(KEY_METHOD_CAPITALIZATION).setWordDelimiterKey(KEY_METHOD_WORD_DELIMITER)
- .setPrefixKey(KEY_METHOD_PREFIX).setSuffixKey(KEY_METHOD_SUFFIX)
- .setNameValidator(IDENTIFIER_VALIDATOR);
+ .setCapitalizationKey(KEY_METHOD_CAPITALIZATION).setWordDelimiterKey(KEY_METHOD_WORD_DELIMITER)
+ .setPrefixKey(KEY_METHOD_PREFIX).setSuffixKey(KEY_METHOD_SUFFIX).setNameValidator(IDENTIFIER_VALIDATOR);
new Category(PreferencesMessages.NameStyleBlock_getter_node,
PreferencesMessages.NameStyleBlock_getter_node_description, EXAMPLE_FIELD_NAME, codeCategory)
- .setCapitalizationKey(KEY_GETTER_CAPITALIZATION).setWordDelimiterKey(KEY_GETTER_WORD_DELIMITER)
- .setPrefixKey(KEY_GETTER_PREFIX).setAlternativePrefixKey(KEY_GETTER_PREFIX_FOR_BOOLEAN)
- .setSuffixKey(KEY_GETTER_SUFFIX).setSeedNameGenerator(fieldCategory)
- .setNameValidator(IDENTIFIER_VALIDATOR).setTrimFieldName(true);
+ .setCapitalizationKey(KEY_GETTER_CAPITALIZATION).setWordDelimiterKey(KEY_GETTER_WORD_DELIMITER)
+ .setPrefixKey(KEY_GETTER_PREFIX).setAlternativePrefixKey(KEY_GETTER_PREFIX_FOR_BOOLEAN)
+ .setSuffixKey(KEY_GETTER_SUFFIX).setSeedNameGenerator(fieldCategory)
+ .setNameValidator(IDENTIFIER_VALIDATOR).setTrimFieldName(true);
new Category(PreferencesMessages.NameStyleBlock_setter_node,
PreferencesMessages.NameStyleBlock_setter_node_description, EXAMPLE_FIELD_NAME, codeCategory)
- .setCapitalizationKey(KEY_SETTER_CAPITALIZATION).setWordDelimiterKey(KEY_SETTER_WORD_DELIMITER)
- .setPrefixKey(KEY_SETTER_PREFIX).setSuffixKey(KEY_SETTER_SUFFIX)
- .setSeedNameGenerator(fieldCategory).setNameValidator(IDENTIFIER_VALIDATOR)
- .setTrimFieldName(true);
+ .setCapitalizationKey(KEY_SETTER_CAPITALIZATION).setWordDelimiterKey(KEY_SETTER_WORD_DELIMITER)
+ .setPrefixKey(KEY_SETTER_PREFIX).setSuffixKey(KEY_SETTER_SUFFIX).setSeedNameGenerator(fieldCategory)
+ .setNameValidator(IDENTIFIER_VALIDATOR).setTrimFieldName(true);
new IncludeGuardCategory(codeCategory);
Category fileCategory = new Category(PreferencesMessages.NameStyleBlock_files_node);
new Category(PreferencesMessages.NameStyleBlock_cpp_header_node,
PreferencesMessages.NameStyleBlock_cpp_header_node_description, EXAMPLE_CLASS_NAME, fileCategory)
- .setCapitalizationKey(KEY_CPP_HEADER_CAPITALIZATION)
- .setWordDelimiterKey(KEY_CPP_HEADER_WORD_DELIMITER).setPrefixKey(KEY_CPP_HEADER_PREFIX)
- .setSuffixKey(KEY_CPP_HEADER_SUFFIX).setNameValidator(FILENAME_VALIDATOR);
+ .setCapitalizationKey(KEY_CPP_HEADER_CAPITALIZATION).setWordDelimiterKey(KEY_CPP_HEADER_WORD_DELIMITER)
+ .setPrefixKey(KEY_CPP_HEADER_PREFIX).setSuffixKey(KEY_CPP_HEADER_SUFFIX)
+ .setNameValidator(FILENAME_VALIDATOR);
new Category(PreferencesMessages.NameStyleBlock_cpp_source_node,
PreferencesMessages.NameStyleBlock_cpp_source_node_description, EXAMPLE_CLASS_NAME, fileCategory)
- .setCapitalizationKey(KEY_CPP_SOURCE_CAPITALIZATION)
- .setWordDelimiterKey(KEY_CPP_SOURCE_WORD_DELIMITER).setPrefixKey(KEY_CPP_SOURCE_PREFIX)
- .setSuffixKey(KEY_CPP_SOURCE_SUFFIX).setNameValidator(FILENAME_VALIDATOR);
+ .setCapitalizationKey(KEY_CPP_SOURCE_CAPITALIZATION).setWordDelimiterKey(KEY_CPP_SOURCE_WORD_DELIMITER)
+ .setPrefixKey(KEY_CPP_SOURCE_PREFIX).setSuffixKey(KEY_CPP_SOURCE_SUFFIX)
+ .setNameValidator(FILENAME_VALIDATOR);
new Category(PreferencesMessages.NameStyleBlock_cpp_test_node,
PreferencesMessages.NameStyleBlock_cpp_test_node_description, EXAMPLE_CLASS_NAME, fileCategory)
- .setCapitalizationKey(KEY_CPP_TEST_CAPITALIZATION)
- .setWordDelimiterKey(KEY_CPP_TEST_WORD_DELIMITER).setPrefixKey(KEY_CPP_TEST_PREFIX)
- .setSuffixKey(KEY_CPP_TEST_SUFFIX).setNameValidator(FILENAME_VALIDATOR);
+ .setCapitalizationKey(KEY_CPP_TEST_CAPITALIZATION).setWordDelimiterKey(KEY_CPP_TEST_WORD_DELIMITER)
+ .setPrefixKey(KEY_CPP_TEST_PREFIX).setSuffixKey(KEY_CPP_TEST_SUFFIX)
+ .setNameValidator(FILENAME_VALIDATOR);
return new Category[] { codeCategory, fileCategory };
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TabConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TabConfigurationBlock.java
index 2760aeba143..9336285ed56 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TabConfigurationBlock.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TabConfigurationBlock.java
@@ -24,14 +24,14 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.layout.PixelConverter;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
/**
@@ -75,12 +75,12 @@ public class TabConfigurationBlock extends OptionsConfigurationBlock {
@Override
protected Control createContents(Composite parent) {
PixelConverter pixelConverter = new PixelConverter(parent);
- final TabFolder folder = new TabFolder(parent, SWT.NONE);
+ final CTabFolder folder = new CTabFolder(parent, SWT.NONE);
folder.setLayout(new TabFolderLayout());
folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
for (int i = 0; i < fTabs.length; i++) {
- TabItem item = new TabItem(folder, SWT.NONE);
+ CTabItem item = new CTabItem(folder, SWT.NONE);
item.setText(fTabLabels[i]);
Composite composite = new Composite(folder, SWT.NONE);
FillLayout layout = new FillLayout();
@@ -91,6 +91,7 @@ public class TabConfigurationBlock extends OptionsConfigurationBlock {
item.setData(fTabs[i]);
fTabs[i].createContents(composite);
}
+ folder.setSelection(0);
Dialog.applyDialogFont(folder);
folder.addSelectionListener(new SelectionListener() {
@Override
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java
index 6b17b472355..cb4506e91da 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialog.java
@@ -42,6 +42,8 @@ import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.StatusDialog;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
@@ -54,8 +56,6 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
public abstract class ModifyDialog extends StatusDialog implements IModifyDialogTabPage.IModificationListener {
@@ -88,7 +88,7 @@ public abstract class ModifyDialog extends StatusDialog implements IModifyDialog
private final Map<String, String> fWorkingValues;
private final List<IModifyDialogTabPage> fTabPages;
private final IDialogSettings fDialogSettings;
- private TabFolder fTabFolder;
+ private CTabFolder fTabFolder;
private final ProfileManager fProfileManager;
private Button fApplyButton;
private Button fSaveButton;
@@ -137,7 +137,7 @@ public abstract class ModifyDialog extends StatusDialog implements IModifyDialog
if (!fNewProfile) {
fTabFolder.setSelection(lastFocusNr);
- ((IModifyDialogTabPage) fTabFolder.getSelection()[0].getData()).setInitialFocus();
+ ((IModifyDialogTabPage) fTabFolder.getSelection().getData()).setInitialFocus();
}
}
@@ -165,11 +165,14 @@ public abstract class ModifyDialog extends StatusDialog implements IModifyDialog
fSaveButton = createButton(nameComposite, SAVE_BUTTON_ID, FormatterMessages.ModifyDialog_Export_Button, false);
- fTabFolder = new TabFolder(composite, SWT.NONE);
+ fTabFolder = new CTabFolder(composite, SWT.NONE);
fTabFolder.setFont(composite.getFont());
fTabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
addPages(fWorkingValues);
+ if (fTabFolder.getSelection() == null) {
+ fTabFolder.setSelection(0);
+ }
applyDialogFont(composite);
@@ -180,7 +183,7 @@ public abstract class ModifyDialog extends StatusDialog implements IModifyDialog
@Override
public void widgetSelected(SelectionEvent e) {
- final TabItem tabItem = (TabItem) e.item;
+ final CTabItem tabItem = (CTabItem) e.item;
final IModifyDialogTabPage page = (IModifyDialogTabPage) tabItem.getData();
// page.fSashForm.setWeights();
fDialogSettings.put(fKeyLastFocus, fTabPages.indexOf(page));
@@ -330,7 +333,7 @@ public abstract class ModifyDialog extends StatusDialog implements IModifyDialog
}
protected final void addTabPage(String title, IModifyDialogTabPage tabPage) {
- final TabItem tabItem = new TabItem(fTabFolder, SWT.NONE);
+ final CTabItem tabItem = new CTabItem(fTabFolder, SWT.NONE);
applyDialogFont(tabItem.getControl());
tabItem.setText(title);
tabItem.setData(tabPage);
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactoringMatchStore.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactoringMatchStore.java
index 1354b6a8f6c..0078b977827 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactoringMatchStore.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactoringMatchStore.java
@@ -34,7 +34,7 @@ public class CRefactoringMatchStore {
private Comparator<CRefactoringMatch> fOffsetComparator;
public CRefactoringMatchStore() {
- fOffsetComparator = new Comparator<CRefactoringMatch>() {
+ fOffsetComparator = new Comparator<>() {
@Override
public int compare(CRefactoringMatch o1, CRefactoringMatch o2) {
return o1.getOffset() - o2.getOffset();
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper.java
index b490d065351..f6d90648a9b 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper.java
@@ -310,7 +310,7 @@ public class TextSearchWrapper {
}
}
- final static Comparator<int[]> COMPARE_FIRST_INTEGER = new Comparator<int[]>() {
+ final static Comparator<int[]> COMPARE_FIRST_INTEGER = new Comparator<>() {
@Override
public int compare(int[] o1, int[] o2) {
return (o1)[0] - (o2)[0];
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistInvocationContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistInvocationContext.java
index 50f0609adcc..2d6555195ef 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistInvocationContext.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistInvocationContext.java
@@ -74,7 +74,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
// may need a corresponding adjustment, and this stores the adjusted offset.
private int fAdjustedParseOffset = -1;
- private Lazy<Integer> fContextInfoPosition = new Lazy<Integer>() {
+ private Lazy<Integer> fContextInfoPosition = new Lazy<>() {
@Override
protected Integer calculateValue() {
return guessContextInformationPosition();
@@ -83,7 +83,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
private final Lazy<ITranslationUnit> fTU;
- private final Lazy<Integer> fParseOffset = new Lazy<Integer>() {
+ private final Lazy<Integer> fParseOffset = new Lazy<>() {
@Override
protected Integer calculateValue() {
int result = doCalculate();
@@ -196,7 +196,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
return null;
}
- private final Lazy<IASTCompletionNode> fCN = new Lazy<IASTCompletionNode>() {
+ private final Lazy<IASTCompletionNode> fCN = new Lazy<>() {
@Override
protected IASTCompletionNode calculateValue() {
int offset = getParseOffset();
@@ -253,7 +253,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
}
};
- private final Lazy<Boolean> afterOpeningAngleBracket = new Lazy<Boolean>() {
+ private final Lazy<Boolean> afterOpeningAngleBracket = new Lazy<>() {
@Override
protected Boolean calculateValue() {
final int parseOffset = getParseOffset();
@@ -264,7 +264,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
}
};
- private final Lazy<Boolean> afterOpeningParenthesisOrBrace = new Lazy<Boolean>() {
+ private final Lazy<Boolean> afterOpeningParenthesisOrBrace = new Lazy<>() {
@Override
protected Boolean calculateValue() {
final int invocationOffset = getInvocationOffset();
@@ -295,7 +295,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
}
};
- private final Lazy<Boolean> inUsingDeclaration = new Lazy<Boolean>() {
+ private final Lazy<Boolean> inUsingDeclaration = new Lazy<>() {
/**
* Checks whether the invocation offset is inside a using-declaration.
*
@@ -331,7 +331,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
}
};
- private final Lazy<Boolean> followedBySemicolon = new Lazy<Boolean>() {
+ private final Lazy<Boolean> followedBySemicolon = new Lazy<>() {
@Override
protected Boolean calculateValue() {
final IDocument doc = getDocument();
@@ -342,7 +342,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
}
};
- private final Lazy<Boolean> followedByOpeningParen = new Lazy<Boolean>() {
+ private final Lazy<Boolean> followedByOpeningParen = new Lazy<>() {
@Override
protected Boolean calculateValue() {
final IDocument doc = getDocument();
@@ -353,7 +353,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
}
};
- private final Lazy<String> functionParameterDelimiter = new Lazy<String>() {
+ private final Lazy<String> functionParameterDelimiter = new Lazy<>() {
@Override
protected String calculateValue() {
String propertyKey = DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS;
@@ -362,7 +362,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
}
};
- private final Lazy<String> templateParameterDelimiter = new Lazy<String>() {
+ private final Lazy<String> templateParameterDelimiter = new Lazy<>() {
@Override
protected String calculateValue() {
String propertyKey = DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMETERS;
@@ -387,7 +387,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
fIsCompletion = isCompletion;
fIsContextInformationStyle = !isCompletion;
fIsAutoActivated = isAutoActivated;
- fTU = new Lazy<ITranslationUnit>() {
+ fTU = new Lazy<>() {
@Override
protected ITranslationUnit calculateValue() {
return CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(fEditor.getEditorInput());
@@ -402,7 +402,7 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
*/
public CContentAssistInvocationContext(final ITranslationUnit unit, boolean isCompletion) {
super();
- fTU = new Lazy<ITranslationUnit>() {
+ fTU = new Lazy<>() {
@Override
protected ITranslationUnit calculateValue() {
return unit;
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistProcessor.java
index f21a081ec23..b3117214923 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistProcessor.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistProcessor.java
@@ -92,7 +92,7 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
*/
private static final String PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY = "EmptyDefaultAssistCategory"; //$NON-NLS-1$
- private static final Comparator<CompletionProposalCategory> ORDER_COMPARATOR = new Comparator<CompletionProposalCategory>() {
+ private static final Comparator<CompletionProposalCategory> ORDER_COMPARATOR = new Comparator<>() {
@Override
public int compare(CompletionProposalCategory d1, CompletionProposalCategory d2) {
return d1.getSortOrder() - d2.getSortOrder();
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CSelectAnnotationRulerAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CSelectAnnotationRulerAction.java
index 3ae0660a9f4..e1df83dc445 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CSelectAnnotationRulerAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/correction/CSelectAnnotationRulerAction.java
@@ -51,7 +51,7 @@ public class CSelectAnnotationRulerAction extends SelectMarkerRulerAction {
private ResourceBundle fBundle;
// Annotations at the ruler's current line of activity, keyed by their presentation layer,
// in decreasing order (i.e. top to bottom).
- private static Comparator<Integer> decreasingOrder = new Comparator<Integer>() {
+ private static Comparator<Integer> decreasingOrder = new Comparator<>() {
@Override
public int compare(Integer a, Integer b) {
return b - a;
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java
index 8e826eb549a..c1d416f8706 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java
@@ -1312,7 +1312,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
}
}
- Comparator<Tuple> comparator = new Comparator<Tuple>() {
+ Comparator<Tuple> comparator = new Comparator<>() {
@Override
public int compare(Tuple t1, Tuple t2) {
return t1.position.getOffset() - t2.position.getOffset();
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java
index bbf956e0aaf..ac21585835c 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java
@@ -30,7 +30,7 @@ import org.eclipse.jface.text.templates.TemplateVariableResolver;
public class TemplateVariableProcessor implements IContentAssistProcessor {
- private static Comparator<TemplateVariableProposal> fgTemplateVariableProposalComparator = new Comparator<TemplateVariableProposal>() {
+ private static Comparator<TemplateVariableProposal> fgTemplateVariableProposalComparator = new Comparator<>() {
@Override
public int compare(TemplateVariableProposal arg0, TemplateVariableProposal arg1) {
return arg0.getDisplayString().compareTo(arg1.getDisplayString());
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THHistoryListAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THHistoryListAction.java
index 4a45321a7a4..c519861c770 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THHistoryListAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THHistoryListAction.java
@@ -51,7 +51,7 @@ public class THHistoryListAction extends Action {
setTitle(Messages.THHistoryListAction_HistoryList_title);
String[] buttonLabels = new String[] { Messages.THHistoryListAction_Remove, };
- IListAdapter<ICElement> adapter = new IListAdapter<ICElement>() {
+ IListAdapter<ICElement> adapter = new IListAdapter<>() {
@Override
public void customButtonPressed(ListDialogField<ICElement> field, int index) {
doCustomButtonPressed();
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetConfigsContribution.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetConfigsContribution.java
index e8ddb79e824..27a8ba4b190 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetConfigsContribution.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/AbstractWorkingSetConfigsContribution.java
@@ -38,7 +38,7 @@ abstract class AbstractWorkingSetConfigsContribution extends CompoundContributio
private IWorkingSetProxy workingSet;
- private Comparator<IWorkingSetConfiguration> configOrdering = new Comparator<IWorkingSetConfiguration>() {
+ private Comparator<IWorkingSetConfiguration> configOrdering = new Comparator<>() {
private Collator collator = Collator.getInstance();
@Override

Back to the top