se.mylyn.monitor.ui;bundle-version="3.0.0",org.eclipse.jface.text,org\r
.eclipse.ui.editors;bundle-version="3.4.0"\r
Source-Control-Identifier: \r
-Bundle-Version: 3.7.0.v20120319-0200_patch\r
+Bundle-Version: 3.7.1.v20120425-0100_patch\r
Export-Package: org.eclipse.mylyn.internal.cdt.ui;x-internal:=true,org\r
.eclipse.mylyn.internal.cdt.ui.actions;x-internal:=true,org.eclipse.m\r
ylyn.internal.cdt.ui.contentassist;x-internal:=true,org.eclipse.mylyn\r
<feature
id="org.eclipse.cdt.mylyn"
label="%featureName"
- version="5.3.0.v20120319-0200_patch"
+ version="5.3.1.v20120425-0100_patch"
provider-name="%providerName"
plugin="org.eclipse.mylyn.context.core">
<plugin
id="org.eclipse.cdt.mylyn.ui"
- download-size="0"
- install-size="0"
- version="3.7.0.v20120319-0200_patch"
+ download-size="62"
+ install-size="132"
+ version="3.7.1.v20120425-0100_patch"
unpack="false"/>
</feature>
<feature
id="org.eclipse.cdt.platform"
label="%featureName"
- version="8.0.0.201109151620_patch"
+ version="8.0.2.201202111925_patch"
provider-name="%providerName">
<description>
id="org.eclipse.cdt"
download-size="71"
install-size="77"
- version="8.0.0.201109151620"
+ version="8.0.2.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.core"
- download-size="4281"
- install-size="9476"
- version="5.3.1.201109151620"
+ download-size="4290"
+ install-size="9500"
+ version="5.3.2.201202111925"
unpack="false"/>
<plugin
os="aix"
download-size="17"
install-size="45"
- version="5.1.0.201109151620"
+ version="5.1.1.201202111925"
fragment="true"
unpack="false"/>
os="linux"
download-size="6"
install-size="7"
- version="5.2.0.201109151620"
+ version="5.2.0.201202111925"
fragment="true"
unpack="false"/>
arch="ppc64"
download-size="15"
install-size="48"
- version="5.1.0.201109151620"
+ version="5.1.0.201202111925"
fragment="true"
unpack="false"/>
arch="x86"
download-size="12"
install-size="27"
- version="5.2.0.201109151620"
+ version="5.2.0.201202111925"
fragment="true"
unpack="false"/>
arch="x86_64"
download-size="13"
install-size="33"
- version="5.2.0.201109151620"
+ version="5.2.0.201202111925"
fragment="true"
unpack="false"/>
os="macosx"
download-size="28"
install-size="88"
- version="5.2.0.201109151620"
+ version="5.2.0.201202111925"
fragment="true"
unpack="false"/>
arch="sparc"
download-size="17"
install-size="37"
- version="5.2.0.201109151620"
+ version="5.2.0.201202111925"
fragment="true"
unpack="false"/>
os="win32"
download-size="6"
install-size="7"
- version="5.2.0.201109151620"
+ version="5.2.0.201202111925"
fragment="true"
unpack="false"/>
id="org.eclipse.cdt.codan.core"
download-size="117"
install-size="231"
- version="2.0.0.201109151620"
+ version="2.0.0.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.codan.ui"
- download-size="99"
- install-size="205"
- version="2.0.0.201109151620"
+ download-size="100"
+ install-size="206"
+ version="2.0.1.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.codan.core.cxx"
download-size="36"
install-size="73"
- version="1.0.0.201109151620"
+ version="1.0.0.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.codan.ui.cxx"
download-size="15"
install-size="28"
- version="2.0.0.201109151620"
+ version="2.0.0.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.codan.checkers"
download-size="68"
- install-size="161"
- version="1.0.0.201109151620"
+ install-size="162"
+ version="1.0.1.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.codan.checkers.ui"
download-size="23"
install-size="44"
- version="1.0.0.201109151620"
+ version="1.0.0.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.debug.core"
download-size="475"
install-size="955"
- version="7.1.0.201109151620"
+ version="7.1.0.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.debug.ui"
- download-size="988"
- install-size="2004"
- version="7.1.1.201109151620"
+ download-size="989"
+ install-size="2005"
+ version="7.1.2.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.make.core"
download-size="391"
install-size="831"
- version="7.1.1.201109151620"
+ version="7.1.2.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.make.ui"
- download-size="431"
- install-size="852"
- version="7.1.1.201109151620"
+ download-size="427"
+ install-size="846"
+ version="7.1.2.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.managedbuilder.core"
- download-size="1131"
- install-size="2692"
- version="8.0.1.201109151620"
+ download-size="1137"
+ install-size="2707"
+ version="8.0.2.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.managedbuilder.ui"
download-size="399"
install-size="827"
- version="8.0.0.201109151620"
+ version="8.0.2.201202111925"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.cdt.ui"
+ download-size="4982"
+ install-size="10914"
+ version="5.3.2.201202111925_patch"
unpack="false"/>
<plugin
id="org.eclipse.cdt.doc.user"
- download-size="13839"
- install-size="15280"
- version="5.1.0.201109151620"
+ download-size="14040"
+ install-size="15615"
+ version="5.1.1.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.dsf"
download-size="276"
install-size="548"
- version="2.2.0.201109151620"
+ version="2.2.0.201202111925"
unpack="false"/>
<plugin
id="org.eclipse.cdt.dsf.ui"
- download-size="1197"
- install-size="2649"
- version="2.2.0.201109151620"
+ download-size="1198"
+ install-size="2651"
+ version="2.2.1.201202111925"
unpack="false"/>
<plugin
arch="x86"
download-size="76"
install-size="193"
- version="5.2.0.201109151620"
+ version="5.2.0.201202111925"
fragment="true"/>
<plugin
arch="x86_64"
download-size="156"
install-size="329"
- version="5.2.0.201109151620"
+ version="5.2.0.201202111925"
fragment="true"/>
- <plugin
- id="org.eclipse.cdt.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
</feature>
-#Tue Oct 25 20:04:11 KST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
ng;bundle-version="3.4.0",org.eclipse.ltk.ui.refactoring;bundle-versi\r
on="3.4.0",org.eclipse.ui.navigator.resources;bundle-version="3.3.100\r
"\r
-Bundle-Version: 5.3.1.201109151620_patch\r
+Bundle-Version: 5.3.2.201202111925_patch\r
Export-Package: org.eclipse.cdt.internal.corext;x-internal:=true,org.e\r
clipse.cdt.internal.corext.codemanipulation;x-internal:=true,org.ecli\r
pse.cdt.internal.corext.fix;x-internal:=true,org.eclipse.cdt.internal\r
\r
Name: org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGene\r
rator$CodeGeneratorException.class\r
-SHA1-Digest: zBVnJmQOnyOcIV5WnhMXznv5XDs=\r
+SHA1-Digest: O7W38xUpyCzyzAZ0CeLvUL/JfAg=\r
\r
Name: org/eclipse/cdt/internal/ui/language/FileLanguageMappingProperty\r
Page$2.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractF\r
unctionRefactoringDescription.class\r
-SHA1-Digest: kjHhrORI6OtM3YGfXNqCewWjWwo=\r
+SHA1-Digest: 9M6NAjk966LxKQZAU61reJ31e4Y=\r
\r
Name: org/eclipse/cdt/ui/internal/templateengine/wizard/TemplateCNewWi\r
zard.class\r
\r
Name: org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage$SourceFold\r
erFieldAdapter.class\r
-SHA1-Digest: pzE8RJpV7+VwlFeDAIx+SP3VPM8=\r
+SHA1-Digest: 1moFIYaGulg7GUrPoF+gvrQSCvI=\r
\r
Name: org/eclipse/cdt/internal/corext/util/SimplePositionTracker.class\r
SHA1-Digest: Bn7bnIdFfT+JPvikeviqby/JGOg=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/SourceViewerInformation\r
Control$1.class\r
-SHA1-Digest: 432Adb5s7LTtcwXzjDwpQZtiYuc=\r
+SHA1-Digest: PNVB2i6aLSculwLjD2HbWPU6XGs=\r
\r
Name: org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSetti\r
ngsWizardPage$4.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Getter\r
SetterContext.class\r
-SHA1-Digest: D07W0UXSEtYwYxfUcIlxrvF/c8E=\r
+SHA1-Digest: Lpn4dTOO9p1TqielTz4w/M1SIl4=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper\r
.class\r
-SHA1-Digest: rKtaFJmiSJ1R464h0x4XWX/8/Yw=\r
+SHA1-Digest: P0QaH9jhmYXpOaV7rnfiEgJ79Ek=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/RefactoringStarter.class\r
SHA1-Digest: 0zw9w8QInuhjlnXUsc4tvpb+D8I=\r
\r
Name: org/eclipse/cdt/internal/ui/text/AbstractCompareViewerInformatio\r
nControl.class\r
-SHA1-Digest: S3IQim32Qdq0PUg+dncb0BXi8OQ=\r
+SHA1-Digest: U7dk9dqqSfbz/ouaq9Jg0kzTjmo=\r
\r
Name: org/eclipse/cdt/internal/ui/viewsupport/CElementLabelComposer.cl\r
ass\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/RefactoringExecutionHelp\r
er.class\r
-SHA1-Digest: 2cxIMjBmi89ErDrCBufhaQ3+M1E=\r
+SHA1-Digest: 5rejtWJ2m3E5YtGShKGd22zTA/8=\r
\r
Name: org/eclipse/cdt/ui/newui/NewConfigurationDialog$1.class\r
SHA1-Digest: MUAXExWfyA2VDAHNswhx6ty+U2U=\r
Name: icons/obj16/include_obj.gif\r
SHA1-Digest: torGTf0k3nn12ONa1poxzVWfTCg=\r
\r
-Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Getter\r
- SetterContext$FieldWrapper.class\r
-SHA1-Digest: JxEU0AfOTiSrU+hK8zytywlmWBs=\r
-\r
Name: org/eclipse/cdt/internal/ui/util/RemoteTreeViewer.class\r
SHA1-Digest: jS/9fyrFVaiggnXdWJRiLLjnSrk=\r
\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorat\r
ionControl.class\r
-SHA1-Digest: F1KOPsT2SN48iKc8R8zAFSy2fUQ=\r
+SHA1-Digest: WhUm2BSyqFoz7/SWus+UX+hBo34=\r
\r
Name: org/eclipse/cdt/internal/ui/language/LanguageMappingWidget$1.cla\r
ss\r
SHA1-Digest: u4Ugc19Y1+2+w73h7wVDRkm4Yko=\r
\r
Name: org/eclipse/cdt/ui/dialogs/IndexerBlock$1.class\r
-SHA1-Digest: jXkhBYWUKJ8D4EvfeCZhRF4KW90=\r
+SHA1-Digest: DhQJug2ybyl7oB3uxsDSuB9xpXI=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CEditorHoverConfiguratio\r
nBlock$HoverConfig.class\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBloc\r
k$1.class\r
-SHA1-Digest: UCJ+NqpoPrI5U19vedFVT5wwzls=\r
+SHA1-Digest: F+lFoKrj5q4Dz0CgkwK6R66mxJg=\r
\r
Name: org/eclipse/cdt/internal/ui/search/IPDOMSearchContentProvider.cl\r
ass\r
Name: org/eclipse/cdt/ui/newui/CLocationTab$_Filter.class\r
SHA1-Digest: bNeDxLMqHKJtaHwgkdZ++xm1S+w=\r
\r
+Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Access\r
+ orDescriptor$AccessorKind.class\r
+SHA1-Digest: 11RTd/3aeHW7/9wlWarxR25U4XI=\r
+\r
Name: org/eclipse/cdt/internal/ui/workingsets/WorkingSetConfigurationM\r
anager$2.class\r
SHA1-Digest: Pb4FwywXU0F4Ik0Kz4Rw8WNXGQo=\r
\r
Name: org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsJob$1\r
.class\r
-SHA1-Digest: vHG6LEG5drER22fWVKj37SFI0cE=\r
+SHA1-Digest: 6R1IBkLa7BIEygrYDyeOjw3XcK4=\r
\r
Name: org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathFilterPage.class\r
SHA1-Digest: QgnjqSGmq+1p0wGJ+43J8glucmY=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager$H\r
ighlightedPosition.class\r
-SHA1-Digest: KuTz8FXHNrpQNTbyzGcAHPHG7ig=\r
+SHA1-Digest: g+0ftrkp9pQpIbxYOpmBb6l+iEo=\r
\r
Name: org/eclipse/cdt/internal/ui/viewsupport/DecoratingCLabelProvider\r
.class\r
SHA1-Digest: vjxe5aPhp/nwQHYNks54CEhRcsI=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover$2.class\r
-SHA1-Digest: TSUKZSMw/tP3ljqnvvX3SWVgjrg=\r
+SHA1-Digest: DX0MJLJ5ApWcGtVNCPfbvbcxmiU=\r
\r
Name: org/eclipse/cdt/internal/ui/workingsets/WorkingSetMessages.prope\r
rties\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRefactoringArgum\r
ent.class\r
-SHA1-Digest: sdtv1e0KyDXhc/XgR6dVvx8Gw9E=\r
+SHA1-Digest: S3Sh3xRpsGvgjdwz2tSm+ndGWMA=\r
\r
Name: org/eclipse/cdt/internal/ui/viewsupport/ColoringLabelProvider.cl\r
ass\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Genera\r
teGettersAndSettersInputPage$3.class\r
-SHA1-Digest: /+21woPFdD7mITSbde9j3i7QAmo=\r
+SHA1-Digest: g6up/lmfKVVzIikCJKqK+XcD+lk=\r
\r
Name: icons/dtool16/build_configs.gif\r
SHA1-Digest: FgSfgP7vEGZZ/a2a6BN1roPzq1g=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Genera\r
teGettersAndSettersRefactoring$1.class\r
-SHA1-Digest: 9PV1C0bjvEHpT3sUvu8Nr1kAIDw=\r
+SHA1-Digest: /52Ppx6bC5PEkuYkPwzBt5OYsmE=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/MarkOccurrencesPreferenc\r
ePage.class\r
SHA1-Digest: Eino/qQ7tqM3UPawv1eqqQIRJDo=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$6.class\r
-SHA1-Digest: CAoKursEshvd/XIz3N4Wvwk49fc=\r
+SHA1-Digest: ZGew8ZhAld1ll9Km70P6Wd8m+10=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/ProjectSelectionDialog$3\r
.class\r
\r
Name: org/eclipse/cdt/internal/ui/editor/AbstractCModelOutlinePage.cla\r
ss\r
-SHA1-Digest: G/tT+0XXxhPJX9E5PQNKEwi8ix0=\r
+SHA1-Digest: NYfpVZN6w1dLFhvMshZQwuYJYvM=\r
\r
Name: org/eclipse/cdt/ui/dialogs/TabFolderOptionBlock.class\r
SHA1-Digest: q2x8SWrtpGIK4+IABznD0bZbxBE=\r
SHA1-Digest: ofSzMdrJmSP/ya/4NCPL7jXRgFg=\r
\r
Name: org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage$1.class\r
-SHA1-Digest: P2qn5jFprQpfu/j/6BdXpajlsIQ=\r
+SHA1-Digest: frAPXKP711olWX3nijFddJXkwyQ=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/AbstractAnnotationHover\r
$AnnotationInformationControl$3.class\r
\r
Name: org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI$2.clas\r
s\r
-SHA1-Digest: HlPrYYB712lL2/56uHD1ngeM6Fc=\r
+SHA1-Digest: gSU6qU7VR8wtcP630C2nlKOVJLw=\r
\r
Name: org/eclipse/cdt/ui/text/CSourceViewerConfiguration$5.class\r
SHA1-Digest: QkUpBN8tYMqCX7wdh7dQTjZQ+38=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage$2.\r
class\r
-SHA1-Digest: ozV1eO2lWpZSr8Y+Rglz1jCgVP0=\r
+SHA1-Digest: SWeULwQlxad1Fn9ezAJDDMd4bYw=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/implementmethod/Messages\r
.properties\r
-SHA1-Digest: yaCkORxEIXW2gNEsu03DvQawLwg=\r
+SHA1-Digest: dZS0iIlosY2Iyqiu+FoN67ida84=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/Visibility.class\r
SHA1-Digest: MzGXYujaylIsG4syNtcdFgiXpEU=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Messag\r
es.properties\r
-SHA1-Digest: aZ59/Z9nYitF9cfxjof0RfWiz84=\r
+SHA1-Digest: P7vAtQrOecrcRKQmUEZpew6gUMM=\r
\r
Name: org/eclipse/cdt/internal/corext/template/c/TemplateMessages.prop\r
erties\r
\r
Name: org/eclipse/cdt/internal/ui/editor/SemanticHighlightingPresenter\r
$1.class\r
-SHA1-Digest: ZRzDVMuSfNZCHoQ1fhtR06av1fk=\r
+SHA1-Digest: fbfcjdRzDAEE2d/LAgyC1NZG99w=\r
\r
Name: icons/elcl16/newmngcc_app.gif\r
SHA1-Digest: 9fMfZW/0oFAkEsLdLitr6hquteI=\r
SHA1-Digest: ab4JupqI3+MgQYNfh28KZccDcSs=\r
\r
Name: org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.class\r
-SHA1-Digest: ccKk2FkBmWamiKNlGo42f4bLdUM=\r
+SHA1-Digest: yaNaEFu/Rm6UNzUpsfIXXnrb3RQ=\r
\r
Name: org/eclipse/cdt/internal/ui/dnd/DelegatingDropAdapter$1.class\r
SHA1-Digest: 8Tjztvn3WUdIs2fr5YfTx4o3yvE=\r
ass\r
SHA1-Digest: oJAfnjOPpL6n93TOi8zIu6Cnh7M=\r
\r
+Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/FieldD\r
+ escriptor.class\r
+SHA1-Digest: +kutlyxdZUgOzbgZjuKrH6igxec=\r
+\r
Name: org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTa\r
bPage$1.class\r
SHA1-Digest: /ymcUH9cbq2euPQErphRJPq05mc=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameGlobalProc\r
essor.class\r
-SHA1-Digest: 6BLA9lFA4ZAE+q4f82tnWjsBoD4=\r
+SHA1-Digest: vsvt7662O5W6jfg2mnZx0euIvbc=\r
\r
Name: org/eclipse/cdt/internal/ui/dialogs/SelectionList$1.class\r
SHA1-Digest: FjeKJyVSNpsOCZUQGIfZ2wIdkCQ=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/ASTManager$2.clas\r
s\r
-SHA1-Digest: 6FYOFe36IVTspVV+SvK8AW/M+gg=\r
+SHA1-Digest: yEt6vdfwYWPWdtLZxceXpOLmA9Y=\r
\r
Name: org/eclipse/cdt/internal/ui/filters/CustomFiltersDialog.class\r
SHA1-Digest: exOS/u+K2v4aQZuB5BohIz9uQFg=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBloc\r
k$AssocContentProvider.class\r
-SHA1-Digest: NGD5UPaW6S9l2nPVNcZde/Q87ps=\r
+SHA1-Digest: ldeOB4RHzfDd+nmOihFPtOpenXE=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CSourcePreviewerUpdater$\r
1.class\r
SHA1-Digest: +HaebNqpWD4y5/Rl7ZG73LpN24A=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor.class\r
-SHA1-Digest: JG9u7P2p+6j8pGmOgfir+QTvkAE=\r
+SHA1-Digest: EYzL6xeHEbakv+a7+qwpMBmiO+A=\r
\r
Name: org/eclipse/cdt/ui/newui/ManageConfigDialog$5.class\r
SHA1-Digest: e/oE8FitiDvi5XnMaFBCq2+NC+s=\r
\r
Name: org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage$NamespaceF\r
ieldAdapter.class\r
-SHA1-Digest: Byau49jKJMzKtgp648+aXjIAz3I=\r
+SHA1-Digest: /H0mC0gH9m7CfkGInL0WfDhV/V8=\r
\r
Name: org/eclipse/cdt/internal/ui/cview/MainActionGroup.class\r
SHA1-Digest: BsHwSwb37q0IeL6EuHXizeTyTu8=\r
SHA1-Digest: o4+ksqJhg4X6BM5y5OcyrHrm3oo=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover$1.class\r
-SHA1-Digest: 8Ssi2VWF27jS7LoSyZxMatmoypg=\r
+SHA1-Digest: YRGg3h7C4SlKmUFCUKXHi5TK3jE=\r
\r
Name: org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSetti\r
ngsImportStrategy$ImporterSectionPair.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/RefactoringExecutionHelp\r
er$Operation$1.class\r
-SHA1-Digest: 8O9EeZZm47PSgmoVExUmrkfpb1Y=\r
+SHA1-Digest: eSd347J2tLS4BzvziYHshV/+AAM=\r
\r
Name: org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSetti\r
ngsWizard.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Genera\r
teGettersAndSettersInputPage$2.class\r
-SHA1-Digest: rhiwEWK/Wulp9/58QXcDCI7K+OE=\r
+SHA1-Digest: fRGtA4f3EId8XI9/tU/8VO/5CAE=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/formatter/CreateProfileD\r
ialog$1.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameMacroProce\r
ssor.class\r
-SHA1-Digest: QDKH8sW2RhMVy7iKe8g3ccRo/lc=\r
+SHA1-Digest: vUQ3DjGN2YSP/H6HtL4QUZWOQYg=\r
\r
Name: org/eclipse/cdt/internal/ui/language/ProjectLanguageMappingPrope\r
rtyPage.class\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/SourceViewerInformation\r
Control.class\r
-SHA1-Digest: Pm7M4q5J0ScYz1jeO9O8u2clrkA=\r
+SHA1-Digest: NbzXANAmC9RN/QRKnm/eGYK5zpM=\r
\r
Name: org/eclipse/cdt/ui/browser/typeinfo/TypeInfoLabelProvider.class\r
SHA1-Digest: GHheppiN8k2IMPnFuAVYbgTv2p0=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorat\r
ionControl$5.class\r
-SHA1-Digest: epu8SUgh/BWX6HiPvDctUfjqkdE=\r
+SHA1-Digest: EeGCgU+pVQbL26FaRLXbVHMWo00=\r
\r
Name: icons/wizban/fieldrefact_wiz.gif\r
SHA1-Digest: SuLUhIeqKr8fwti3WNh7rl2FhEs=\r
SHA1-Digest: kJKAh1VzdvABaa12sr9EM06Ch9o=\r
\r
Name: META-INF/maven/org.eclipse.cdt/org.eclipse.cdt.ui/pom.properties\r
-SHA1-Digest: RMNknza+A3xtxwOyALiUt7lWYIo=\r
+SHA1-Digest: 5fe6O15QbSDXwHnyFmLIllBFggI=\r
\r
Name: org/eclipse/cdt/internal/ui/callhierarchy/OpenCallHierarchyActio\r
n.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/implementmethod/Messages\r
.class\r
-SHA1-Digest: i1kCXsn7RO1Tn9JG8VHONj4xTj8=\r
+SHA1-Digest: 2WvPeUyweGCjVUXdN9DowldX67I=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/BestMatchHover.class\r
SHA1-Digest: 6DwPuHN976dughPX2dw+f36y264=\r
SHA1-Digest: owsuCu4HmhGzU6WZhBfBf1x1WPA=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$5.class\r
-SHA1-Digest: Mpf760cc0pzk0bvZA8oPJp1t8a0=\r
+SHA1-Digest: TeAJitPoAwcftA4zNdPLrZdS+vA=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/ProjectSelectionDialog$2\r
.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/RenameMessages.cl\r
ass\r
-SHA1-Digest: mN2PV0XuXQxAyFHSVhpsATdE6AA=\r
+SHA1-Digest: sN5ACiG9xZDO7xRVLvIfDLbCdLw=\r
\r
Name: org/eclipse/cdt/ui/newui/StructureTreeTab$4.class\r
SHA1-Digest: yTdwa2ab9QuXlY3oxGwLUMWRM+Q=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/RenameLinkedMode.\r
class\r
-SHA1-Digest: PKA8fW+9GVDlBre4FOyEGghDxcc=\r
+SHA1-Digest: xZpVfNJqfiqXRvYLOvdQj884EMw=\r
\r
Name: icons/dlcl16/hierarchy_co.gif\r
SHA1-Digest: IrCD/kydEUV1cUePbnXGPtN17Js=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferencePage\r
.class\r
-SHA1-Digest: OFIuw3Gqr5+DOI1XYcNF9Sla4H8=\r
+SHA1-Digest: FXiUelNBb8e1HGjQB/FWGb2Mw/c=\r
\r
Name: org/eclipse/cdt/internal/ui/wizards/dialogfields/TreeListDialogF\r
ield$1.class\r
\r
Name: org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI$1.clas\r
s\r
-SHA1-Digest: 0SLE1wwiJehTYXDSN4+vFCqk29s=\r
+SHA1-Digest: KTYJgTG3Xtt9kVZhvKCcYmxR5iE=\r
\r
Name: icons/ovr16/external_file.gif\r
SHA1-Digest: xjWtz/BjpfB8oT+2FZ+NZ5GuxvQ=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage$1.\r
class\r
-SHA1-Digest: p37iy8uNVPUHXhBRtKG8Wn3Ev6Y=\r
+SHA1-Digest: tS6/Kmzmjume58MRnJagdOkYuVs=\r
\r
Name: org/eclipse/cdt/internal/ui/util/RemoteTreeContentManager$2.clas\r
s\r
on$2.class\r
SHA1-Digest: rctGupErmLSGbUaLNePEiYjLNxc=\r
\r
-Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRefactory$1.clas\r
- s\r
-SHA1-Digest: X96STwNelTqLvXXk2tSZmRnYCWg=\r
-\r
Name: icons/obj16/method_private_obj.gif\r
SHA1-Digest: NSQB1QuQCOwYBOnFVuXgg9NuZ7c=\r
\r
\r
Name: org/eclipse/cdt/internal/ui/text/AbstractSourceViewerInformation\r
Control$1.class\r
-SHA1-Digest: mS75X1PrSpzQEmBFmEpclX6bZEU=\r
+SHA1-Digest: fkpScsQwRd8VwWkkO0p2OUg40bw=\r
\r
Name: org/eclipse/cdt/utils/ui/controls/ControlFactory.class\r
SHA1-Digest: APcyF8GVLxqkaBPZGzsb53R+d7I=\r
\r
Name: org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage$MethodStub\r
sFieldAdapter.class\r
-SHA1-Digest: +lxZitjti+S32vI7XNuk5vH0PN0=\r
+SHA1-Digest: gEnJ0Lff9TZB25vV3qwXlE9MV+U=\r
\r
Name: icons/wizban/prj_obj.gif\r
SHA1-Digest: wYKoCZPOld/s6u/All9KfNDD4PY=\r
Name: org/eclipse/cdt/utils/ui/controls/ControlFactory$1.class\r
SHA1-Digest: S5omdq7sw8mvSYVxtpLWB9FiG9Q=\r
\r
+Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Access\r
+ orDescriptor.class\r
+SHA1-Digest: 2gHhpkNY86nt1ETn/RuyuIDZBKs=\r
+\r
Name: org/eclipse/cdt/internal/ui/preferences/OverlayPreferenceStore$O\r
verlayKey.class\r
SHA1-Digest: h5vl8HRj06mTScJDLHpSNBFSBTU=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/ASTManager$1.clas\r
s\r
-SHA1-Digest: HJU4wbBqnNWI64KcVHikGZ+KD68=\r
+SHA1-Digest: YPfnKMDXFnNDZix9u9H/H1Nvrtk=\r
\r
Name: org/eclipse/cdt/internal/ui/actions/FoldingMessages.class\r
SHA1-Digest: or2Tj24FK8C+G7KpQVR0nNZjYqM=\r
\r
Name: org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage$BaseClasse\r
sFieldAdapter.class\r
-SHA1-Digest: 9GukINU3Dc3o7nLdvsVN4y9/JPE=\r
+SHA1-Digest: H1iqTyvCU/3OJQYNoRTmH0csAS4=\r
\r
Name: org/eclipse/cdt/internal/ui/dialogs/StatusDialog.class\r
SHA1-Digest: NEejHnGSa6EZW/+qv5VzvYyfjEg=\r
\r
Name: org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage$ClassNameF\r
ieldAdapter.class\r
-SHA1-Digest: hu6MsO19NdTeFMwMY9YoiOVm0YM=\r
+SHA1-Digest: 9HOLd+BKCi7GhXRlaCkc34ZypMA=\r
\r
Name: org/eclipse/cdt/ui/dialogs/IndexerBlock.class\r
-SHA1-Digest: 9ATOVUAvyOikyZ22anHXM1cxCdk=\r
+SHA1-Digest: uYT7x5H/Kofjk9DPK/QSZkglbag=\r
\r
Name: org/eclipse/cdt/internal/ui/text/folding/FoldingMessages.propert\r
ies\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/implementmethod/Implemen\r
tMethodRefactoring.class\r
-SHA1-Digest: yaHwN/nHxtEqMBveachDpd7pHOQ=\r
+SHA1-Digest: EGdvlXQuCppBGeiqigkyvKZ0nBk=\r
\r
Name: org/eclipse/cdt/utils/ui/controls/FileListControl$SelectPathInpu\r
tDialog$2.class\r
SHA1-Digest: X2SYkCGSP2jr+iOlYBLU19jEd4Y=\r
\r
Name: org/eclipse/cdt/internal/ui/text/CReconciler.class\r
-SHA1-Digest: DAA021MCs6jt62ZEScRzrfP33wg=\r
+SHA1-Digest: MlvVCpoA851ovku7VykfWlK6EJI=\r
\r
Name: org/eclipse/cdt/internal/ui/viewsupport/SelectionProviderMediato\r
r$2.class\r
SHA1-Digest: tgqyc/8IrFbwxkbm36oufkYoAVI=\r
\r
Name: org/eclipse/cdt/ui/dialogs/IndexerBlock$IndexerConfig.class\r
-SHA1-Digest: KoZMCddspVvbeUY3BLn0S83jmhI=\r
+SHA1-Digest: PutzL/UdW3dDvAKATmkQKwMd9m0=\r
\r
Name: org/eclipse/cdt/ui/templateengine/uitree/uiwidgets/UISelectWidge\r
t.class\r
Name: org/eclipse/cdt/ui/dialogs/IInputStatusValidator.class\r
SHA1-Digest: S3/FNWyUJ/jlYW/GuvlcncNqals=\r
\r
-Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Getter\r
- SetterInsertEditProvider.class\r
-SHA1-Digest: l46OBAbOpNG/hv4IzhGQU9so1XI=\r
+Name: org/eclipse/cdt/internal/ui/refactoring/rename/RenameSupport$1.c\r
+ lass\r
+SHA1-Digest: hvUajJz1pWdB8q8vi7hg7UR4+1Q=\r
\r
Name: org/eclipse/cdt/internal/ui/dialogs/cpaths/MultipleFolderSelecti\r
onDialog$4.class\r
text.class\r
SHA1-Digest: 2UBImTjxKTq0JNAVIDvEyXk9p14=\r
\r
-Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Functi\r
- onFactory.class\r
-SHA1-Digest: qJNxds9cSL5HuLfif0/jHfubx5w=\r
-\r
Name: org/eclipse/cdt/internal/ui/workingsets/WorkingSetMessages.class\r
SHA1-Digest: NhwtO+er9CP9FbKB6KFHGt8rcik=\r
\r
\r
Name: org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI$2$1.cl\r
ass\r
-SHA1-Digest: 3OmtwwyFjeQ/WzvChGa19zCtWVA=\r
+SHA1-Digest: ky5hY9tbmA6g/3Cun+Apb9f0FIM=\r
\r
Name: org/eclipse/cdt/internal/ui/cview/CView$2.class\r
SHA1-Digest: OoRPsH33+hciiZjyKZk0d/Oe9Pw=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/RefactoringExecutionHelp\r
er$Operation.class\r
-SHA1-Digest: YGvChnLsulpAWhOb0nzSdJxGBEE=\r
+SHA1-Digest: NHBouMd8DRnGMIXXZoeIm/HSjjs=\r
\r
Name: org/eclipse/cdt/internal/ui/viewsupport/CElementLabelComposer$Fl\r
exibleBuffer.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Genera\r
teGettersAndSettersInputPage$1.class\r
-SHA1-Digest: 5P3YSM1G5vCkieRAskCHJnc9NLM=\r
+SHA1-Digest: LlhPImC08MxWxlXW7PeAE5depJQ=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/formatter/AlreadyExistsD\r
ialog.class\r
\r
Name: org/eclipse/cdt/internal/ui/text/AbstractCompareViewerInformatio\r
nControl$CompareViewerControl.class\r
-SHA1-Digest: VnAB3ayTRWCOL31jZMKVo8m5wUA=\r
+SHA1-Digest: Wgo0VCtRtjTfZgFRRz8ShAlNxD0=\r
\r
Name: icons/obj16/toolbar_pinned.gif\r
SHA1-Digest: IycEvMkgySuB2wK17MCWcu6Vt88=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameRefactorin\r
gPreferences.class\r
-SHA1-Digest: pU26ln8xEMRW/cLJW7kT0pkPnlk=\r
+SHA1-Digest: fHu9Uc+FXyDtvZ/Pgtyq5+iFACE=\r
\r
Name: icons/etool16/newfile_wiz.gif\r
SHA1-Digest: QcxM0kkl1Mo/T76FdX6dg4s4tA0=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/RenameLinkedMode$\r
3.class\r
-SHA1-Digest: 6PB2iZk6+mf74Upsb/MTpwKhCVM=\r
+SHA1-Digest: 4pVYTuTywJkheJT0wQM2px/ImUM=\r
\r
Name: icons/dtool16/newc_app.gif\r
SHA1-Digest: Suig672IzG6jSNPFGBZmoGs4D4Q=\r
SHA1-Digest: IcLZGMKHVRNxEvGrR3aBzg9CI6g=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/ASTManager.class\r
-SHA1-Digest: tRi5a0KGUXfBwyLAdu9bvyNfCtI=\r
+SHA1-Digest: pK0pxkiSssRl6CEK3rZvY2qFNxc=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/IndexNameToAstNameMatche\r
r.class\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorat\r
ionControl$4.class\r
-SHA1-Digest: XNR29uQ1YBLxXJvvRal5z9yWEYk=\r
+SHA1-Digest: jTRJXLQCWj/8KNX2PyOO04OU/EQ=\r
\r
Name: icons/obj16/filesyst.gif\r
SHA1-Digest: Aauf0IWttKpubN35BhGFmXo2Ekk=\r
Name: org/eclipse/cdt/internal/ui/util/OpenExternalProblemAction.class\r
SHA1-Digest: H/35CLjwaFMpwIgmPArdDYcsFuQ=\r
\r
-Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Getter\r
- SetterContext$FunctionWrapper.class\r
-SHA1-Digest: mEjRBnIj68EleHCWuGFFjIVj86I=\r
-\r
Name: icons/dtool16/config-release.gif\r
SHA1-Digest: e58qnmFQHJpW1CpLMtMaqxVjBpg=\r
\r
SHA1-Digest: RM4icFOppCiAB32wrpq6z80mKsQ=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$4.class\r
-SHA1-Digest: 3wDPAn2mTJeRGgrkJUBHcbqxATs=\r
+SHA1-Digest: AH5umU0WpQZ9WhM+5FYh4r+XJ6U=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/ProjectSelectionDialog$1\r
.class\r
\r
Name: org/eclipse/cdt/internal/ui/text/AbstractSourceViewerInformation\r
Control.class\r
-SHA1-Digest: DcCunpc4UOBCE+Tqj8tv0OiNQrA=\r
+SHA1-Digest: JjZtFMeQraL10S3LcdZCm5PUAtI=\r
\r
Name: org/eclipse/cdt/internal/ui/language/ProjectContentTypeMappingDi\r
alog$2.class\r
\r
Name: org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconcile\r
r$PositionCollector.class\r
-SHA1-Digest: hzDhVDMxsnK9JLPyamBZMjWXCjo=\r
+SHA1-Digest: RgEksMnZ3ap3iRR8tFrYWWwONbk=\r
\r
Name: org/eclipse/cdt/internal/ui/dnd/CDTViewerDragAdapter.class\r
SHA1-Digest: LPSuCHO7eEiQAeuVeRyws31Cr0c=\r
\r
Name: org/eclipse/cdt/internal/ui/text/CReconciler$ElementChangedListe\r
ner.class\r
-SHA1-Digest: HKH4Dl/dwUNQVvAgqZfbJPS2T1o=\r
+SHA1-Digest: KXSibBigONAQtHRTno0GxrOk1S8=\r
\r
Name: icons/obj16/correction_add.gif\r
SHA1-Digest: 48lJqtGPTLceuO5hgsIb8/qafsw=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.c\r
lass\r
-SHA1-Digest: CQ6XiWFZCftBNA3ir/cEFVNxZaQ=\r
+SHA1-Digest: 7md1zfKYXzC9eDJs93+mPBLWugE=\r
\r
Name: org/eclipse/cdt/ui/wizards/CCProjectWizard.class\r
SHA1-Digest: qqeeoGiPX++PWW4cGqEkwW3OnMk=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameProcessor.\r
class\r
-SHA1-Digest: LIFe7bnTOoAS/AoItV8WCjRS7/Q=\r
+SHA1-Digest: saz783bk2X1nPeoBxmur6RlPzUk=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionHover$1.\r
class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/implementmethod/Implemen\r
tMethodRefactoring$1.class\r
-SHA1-Digest: T1OFI1goDawrsBzlbY7xBWQ57lQ=\r
+SHA1-Digest: CCYMWG/yk7+ezRRl8UKnVh3Jq7Y=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/BuildLogPreferencePage$3\r
.class\r
SHA1-Digest: p+mx6hOR7BabAq959Nkl7sJOZsE=\r
\r
Name: plugin.properties\r
-SHA1-Digest: Wc0VZnQAPZoLbGsN7E3f+bJQ8Yo=\r
+SHA1-Digest: W2/uhx1iWv5hFddIg/t3EVeX0II=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionInput$1.\r
class\r
\r
Name: org/eclipse/cdt/internal/ui/viewsupport/ExcludedFileDecorator.cl\r
ass\r
-SHA1-Digest: kt+GyTANAOjZADbkcQv82GbZgVs=\r
+SHA1-Digest: Iu50zT708IOGQVJ8R+ZijMhHwsw=\r
\r
Name: org/eclipse/cdt/internal/ui/text/CBreakIterator$LineDelimiter.cl\r
ass\r
\r
Name: org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposal\r
Computer$1.class\r
-SHA1-Digest: q8GP7p4c9EMHlIJbNOMK3X5t58c=\r
+SHA1-Digest: QItf1OheWn9V6MXLmuG7/4VlhlQ=\r
\r
Name: org/eclipse/cdt/internal/ui/language/WorkspaceContentTypeMapping\r
Dialog$1.class\r
SHA1-Digest: 4//Ovcp5kCp8hm/UDlRQzlvCSdw=\r
\r
Name: org/eclipse/cdt/ui/newui/AbstractLangsListTab$8.class\r
-SHA1-Digest: 2XQXAVP8oh8kmpzpTlhkevtt7RI=\r
+SHA1-Digest: kHIgv3xShGd4Hpv8cj4fIh756Cw=\r
\r
Name: org/eclipse/cdt/internal/ui/text/template/TemplateVariableProces\r
sor.class\r
rategy.class\r
SHA1-Digest: c+q2ZJB3300/rpiFPY58mk7geq4=\r
\r
+Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Access\r
+ orFactory$SetterFactory.class\r
+SHA1-Digest: k2V7/UtWAi6O/NNO2CSmHO/DDSo=\r
+\r
Name: org/eclipse/cdt/internal/ui/text/COutlineInformationControl.clas\r
s\r
SHA1-Digest: c+u+bw8YqwrB2GRcvvC8E0FZgw8=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Messag\r
es.class\r
-SHA1-Digest: 4zRijHO23gggy5xBOI5zyy4JmZs=\r
+SHA1-Digest: 71CP7dYlVSQSSuwg/uwlos6TsPc=\r
\r
Name: org/eclipse/cdt/internal/ui/text/correction/proposals/LinkedName\r
sAssistProposal$2.class\r
SHA1-Digest: dj8x7og9cm8TfYpIYdufsoOU1xU=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.class\r
-SHA1-Digest: dZE8zKA6wUEmqrwe4/2Gb8DaYN0=\r
+SHA1-Digest: +HXl24HT+N3ZGpfAeYiOhy4IcZM=\r
\r
Name: org/eclipse/cdt/internal/ui/language/FileLanguageMappingProperty\r
Page$LanguageTableData.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Genera\r
teGettersAndSettersInputPage$7.class\r
-SHA1-Digest: Zz9oE7zMSnRwk1jB7cFVTGXOgJM=\r
+SHA1-Digest: fL+xD4pkJj4HwzCIc5KgxRzISzU=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractF\r
unctionInformation.class\r
\r
Name: org/eclipse/cdt/internal/ui/editor/SemanticHighlightingPresenter\r
.class\r
-SHA1-Digest: abZc47NwBNkayqQmhoBsSwtT93Q=\r
+SHA1-Digest: L6IZnk181sTpBk56vJqWeLgmUk0=\r
\r
Name: icons/dtool16/action-editconfig.gif\r
SHA1-Digest: dj4LtYYqWOTaI+VQES8fHEI6cFI=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Getter\r
SetterLabelProvider.class\r
-SHA1-Digest: S2JelYex8+DFBcuIX8gjg00D3UA=\r
+SHA1-Digest: y4hly1O0U27r8wXOaTG9gpdvxQo=\r
\r
Name: org/eclipse/cdt/internal/ui/typehierarchy/THViewPart$22.class\r
SHA1-Digest: cIjCsMSyn2eTwRsKeNqrT+xlQZY=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Genera\r
teGettersAndSettersRefactoring.class\r
-SHA1-Digest: SFnZmuyWtueF5k5i+WgkPpn/v0Y=\r
+SHA1-Digest: ym1RGPdw0fPzsD3r15cz2o6WHCM=\r
\r
Name: org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerSelecti\r
onPage$CPathContainerLabelProvider.class\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.cl\r
ass\r
-SHA1-Digest: ydzqGQxx2mWx4V2j55KdAN7EXbc=\r
+SHA1-Digest: /UWDVLdJN4QPMUvAnNYIYVPc1w0=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/utils/IdentifierResult.c\r
lass\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameRefactorin\r
gInputPage$4.class\r
-SHA1-Digest: w8W7+hYX5fubX10ZM0TJnk16w6o=\r
+SHA1-Digest: khOwBZUlPu4B/W0w0SUuVzboohQ=\r
\r
Name: org/eclipse/cdt/internal/corext/template/c/FileTemplateContextTy\r
pe$CoreVariableResolver.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/implementmethod/Paramete\r
rNamesInputPage.class\r
-SHA1-Digest: z3SKu4LYKZw+AFApiCbDvQtpQhc=\r
+SHA1-Digest: iTx3GP8NgjpXATgDTtOhLSBnABc=\r
\r
Name: org/eclipse/cdt/internal/ui/text/util/CColorManager.class\r
SHA1-Digest: RxcXoN2wbH2Kqr1smg4xeG/O25Q=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$IndexerPreferenceList\r
ener.class\r
-SHA1-Digest: 2QWTNTUnLncgAFQn4siB37QYA24=\r
+SHA1-Digest: HGifOmMNi75Do4P8sOH3C0dzpb8=\r
\r
Name: org/eclipse/cdt/internal/ui/includebrowser/IBDragSourceListener.\r
class\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorat\r
ionControl$3.class\r
-SHA1-Digest: 9cdchrDcLAAveyySpGZdiz3nOpM=\r
+SHA1-Digest: XTQpAo4R49GQhUjfDaeWXScZ238=\r
\r
Name: org/eclipse/cdt/ui/actions/CustomFiltersActionGroup$ShowFilterDi\r
alogAction.class\r
\r
Name: org/eclipse/cdt/internal/ui/text/AbstractCompareViewerInformatio\r
nControl$1$1.class\r
-SHA1-Digest: zvyQAeg7t6RMlwEOeY+PAzap+6Q=\r
+SHA1-Digest: //PCLb6OFrQwDV1jOFI/qi/rETM=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CodeTemplateBlock.class\r
SHA1-Digest: cj+zjErYf1wId6ZC5JtXbCMiVmA=\r
Name: org/eclipse/cdt/internal/ui/editor/SemanticHighlighting.class\r
SHA1-Digest: AMiv1dJx29cFDhz4vplqais4jnU=\r
\r
+Name: META-INF/maven/org.eclipse.cdt/org.eclipse.cdt.ui/pom.xml\r
+SHA1-Digest: aezDI2Zfw73u7WriAbn/fCc3DSU=\r
+\r
Name: org/eclipse/cdt/internal/ui/refactoring/implementmethod/Paramete\r
rInfo.class\r
SHA1-Digest: +NCkDYLbXcwdn9sOBadqDimXfkk=\r
\r
-Name: META-INF/maven/org.eclipse.cdt/org.eclipse.cdt.ui/pom.xml\r
-SHA1-Digest: F7LDWGm9pzjwKVNuvkoWosgvXrM=\r
-\r
Name: org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBloc\r
k.class\r
-SHA1-Digest: wErbSJ5ThUuSPsbcAaoDoyNy0O8=\r
+SHA1-Digest: sHTfCTaudeKh6OFd1yi3dOguSx4=\r
\r
Name: org/eclipse/cdt/internal/ui/resources/ResourceExclusionContribut\r
or$2.class\r
SHA1-Digest: 9lW6O94X0+FVuXaig24Tj28MeFA=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$3.class\r
-SHA1-Digest: NnDaU5aVa6RWjkWFOMMc8D++0J8=\r
+SHA1-Digest: I5xaAzWCE9oC3rb6U5iqpEBtuus=\r
\r
Name: org/eclipse/cdt/internal/ui/dialogs/TypedViewerFilter.class\r
SHA1-Digest: uATu8VHyzlRA8RNBYbFVDZF/U/o=\r
Name: org/eclipse/cdt/ui/templateengine/uitree/UIElement.class\r
SHA1-Digest: /T48Gbna2aHFV96n+u2KV6wrmkU=\r
\r
+Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Access\r
+ orFactory.class\r
+SHA1-Digest: j42PY1JGtQYBf3bbBiZBchLBwNI=\r
+\r
Name: org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTa\r
bPage$ComboPreference.class\r
SHA1-Digest: uFX8n+j2joI0Ydd9J7JVafJ+W3A=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameLocalProce\r
ssor.class\r
-SHA1-Digest: /l4Z308Yqh41z8MuTOwYttZ2YFY=\r
+SHA1-Digest: NTgiwz0lGGajnK6xfkaTqjG3UnA=\r
\r
Name: org/eclipse/cdt/internal/ui/cview/CViewActionGroup.class\r
SHA1-Digest: Hx7Dbgrb3UAgMiswZdA27QRzfqM=\r
\r
Name: org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassWizardUt\r
il.class\r
-SHA1-Digest: 1EslSyzrDqmjk+cV9/g84ZpEdyI=\r
+SHA1-Digest: geoAp1Ll6U9Z4UVpUZSM4w4g490=\r
\r
Name: icons/dlcl16/configure_annotations.gif\r
SHA1-Digest: jB2b2qhh1meTSde1O/MFBzI3E9A=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/SemanticHighlightingPresenter\r
$HighlightingPositionUpdater.class\r
-SHA1-Digest: sv5Xh0DbiEiTu6kukeoBBTfNtvY=\r
+SHA1-Digest: Lr20Kw6ayNKlEf75p5LtW3o+aB0=\r
\r
Name: org/eclipse/cdt/ui/wizards/NewCProjectWizard$1.class\r
SHA1-Digest: 82f6Q3MlGYZfiIQPtxbY3togEJ0=\r
\r
Name: org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGene\r
rator.class\r
-SHA1-Digest: IjudmPKkqGj0DqX9hDGaqOsl/Jg=\r
+SHA1-Digest: p0nT6ikf0tViVk2DHRMOUucFJa4=\r
\r
Name: org/eclipse/cdt/internal/ui/wizards/classwizard/SourceFileSelect\r
ionDialog$FieldsAdapter.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameProcessorD\r
elegate$1.class\r
-SHA1-Digest: HbGatoHdBPk9O+JpQU8kQTiZ88s=\r
+SHA1-Digest: v9Fk9Kd2raHKZOdjDdJf2JKdi08=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/CInformationProvider$Co\r
ntrolCreator.class\r
Name: org/eclipse/cdt/internal/ui/editor/CAnnotationIterator.class\r
SHA1-Digest: XBzd6F9v+jKnKiBkjcQU+us0g5c=\r
\r
-Name: org/eclipse/cdt/internal/ui/refactoring/DocumentAdapter$1.class\r
-SHA1-Digest: AK5s9pXQXeEP95UpcwIQPFpNuEM=\r
-\r
Name: templates/default-filetemplates.xml\r
SHA1-Digest: vhoA8XmsuIbN1vr4NAgofNm24nc=\r
\r
+Name: org/eclipse/cdt/internal/ui/refactoring/DocumentAdapter$1.class\r
+SHA1-Digest: AK5s9pXQXeEP95UpcwIQPFpNuEM=\r
+\r
Name: org/eclipse/cdt/internal/ui/callhierarchy/CHViewPart$2.class\r
SHA1-Digest: Z0+Aox88zZvs4PNDlXk2nuRvazE=\r
\r
SHA1-Digest: +iJioFu9m8Pl8fUsDBhQT9fpqdk=\r
\r
Name: org/eclipse/cdt/ui/newui/AbstractLangsListTab$7.class\r
-SHA1-Digest: xRGZsM/RCuNJkNx6TEzgcyCAM1I=\r
+SHA1-Digest: akBbYaY2VxHa4RV65tRqltIPvio=\r
\r
Name: org/eclipse/cdt/internal/ui/text/correction/ContributedProcessor\r
Descriptor.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameMethodProc\r
essor.class\r
-SHA1-Digest: Y5Q8fN8p6pa3eZKj4wDNAftIs2o=\r
+SHA1-Digest: 6M+Pnoly9rtrUNP2kFMa6GOSasg=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/formatter/BracesTabPage$\r
1.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameRefactorin\r
gInputPage.class\r
-SHA1-Digest: q7wv0qc6+mfAC3JW7Iom/FLvKXM=\r
+SHA1-Digest: ugXmcjuppf18IYTbfSdCcj9ZW5M=\r
\r
Name: org/eclipse/cdt/ui/newui/SymbolDialog$2.class\r
SHA1-Digest: mr8GupmPKko2Dt4l+7K13Y0eZYo=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Genera\r
teGettersAndSettersInputPage$6.class\r
-SHA1-Digest: i8a0cIMsGbIneqMQnhmoxOfBOwE=\r
+SHA1-Digest: SYBtuVzl21PzTRNFEk2kjWVpWDw=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager$H\r
ighlightingStyle.class\r
-SHA1-Digest: R4U+uLWSlsqbg71QP3XaTpNuS/Q=\r
+SHA1-Digest: VUHOq1WDwIWVQP9/ElejgFkC0Kg=\r
\r
Name: org/eclipse/cdt/internal/ui/text/CWordIterator.class\r
SHA1-Digest: 0FHRqnrluALbpKoWgXrs+DX3y+0=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRefactoringMatch\r
.class\r
-SHA1-Digest: hGye3yDj3V1GH4sb50hQl7L2hFo=\r
+SHA1-Digest: 6x2DLXfsJgOSMH3+/BUvHnuEnGc=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameProcessorD\r
elegate.class\r
-SHA1-Digest: oSfwwqyF0vji1dLTDKJQ/VWJBAk=\r
+SHA1-Digest: 8BiwW8hjNJL7dUx1aSjnCuPoI1w=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTa\r
bPage$ButtonPreference.class\r
SHA1-Digest: qx89HZcOfCNP8URrsbXsnJSbNro=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$9.class\r
-SHA1-Digest: AG/2Oacaj8ToT/za7Guy749u5jo=\r
+SHA1-Digest: +nGQ77hAezpE3WpXyHGRL9oljk8=\r
\r
Name: org/eclipse/cdt/ui/CUIPreferenceInitializer.class\r
SHA1-Digest: HVSYXwBSDiEAH+BLEPS8u6fsHjM=\r
SHA1-Digest: ibsVZixQ8V6RMgl+CBf9dJ+H2Xw=\r
\r
Name: org/eclipse/cdt/internal/corext/util/Resources.class\r
-SHA1-Digest: e4zRzQQ3qCIhLliJ/sthQNG6qY0=\r
+SHA1-Digest: nabOeXY+pp0MiX/zNdfkFbmX6rg=\r
\r
Name: org/eclipse/cdt/ui/actions/ExcludeFromBuildAction$1.class\r
SHA1-Digest: v/rl0IWjQ84yby7/ZpPLNjaTc4I=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameRefactorin\r
gInputPage$3.class\r
-SHA1-Digest: vPUCYXyEXRyS3Ivv77PE5QdvTQI=\r
+SHA1-Digest: /IseFV9jRQsmcUbnPJzNCw31ENs=\r
\r
Name: org/eclipse/cdt/internal/ui/text/doctools/DocCommentOwnerManager\r
.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/RenameMessages.pr\r
operties\r
-SHA1-Digest: dSQW8jewSZTdCCIIclTEqysw4tI=\r
+SHA1-Digest: 7asg50A65jwMupASES7ZkCeHQPE=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/RefactoringSaveHelper.cl\r
ass\r
\r
Name: org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsJob.c\r
lass\r
-SHA1-Digest: IOYRDTM6RH1B7ZPahUB1tdpayZ8=\r
+SHA1-Digest: ZGElGKlZq2aHdq9UxUw1DrUjuKA=\r
\r
Name: org/eclipse/cdt/internal/ui/CWorkbenchAdapter.class\r
SHA1-Digest: 06sbG1T3HBhskG2h+EOwfMC1nqA=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage$5.\r
class\r
-SHA1-Digest: hTecxZnzVuvQXn3RjNeYmdRtNU8=\r
+SHA1-Digest: PmYQqE4+0Ze5J8yQv7hv8fEDQbA=\r
\r
Name: org/eclipse/cdt/ui/dialogs/RegularExpressionStatusDialog.class\r
SHA1-Digest: EnxA7nPkYiH6c28gihga7+lp9Wk=\r
SHA1-Digest: fbndLVf1HRy44M5ZPMeS84i/QZo=\r
\r
Name: org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage.class\r
-SHA1-Digest: Z2gO2cQHLY0i7UUQhGZxhwaLhyA=\r
+SHA1-Digest: Cu58R6Xd0a5907IbD7MNj3jOZl8=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/CRefactoring.class\r
SHA1-Digest: WKCov24VsusKGplHzlrreyHzzm0=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper\r
$2.class\r
-SHA1-Digest: gkR05unbPVF68ZUCRZ3Xlm/cK60=\r
+SHA1-Digest: vhiVnxSaROZ5R8IrVgyv7FYFnTE=\r
\r
Name: org/eclipse/cdt/ui/newui/RenameConfigurationDialog$1.class\r
SHA1-Digest: E2yKPWvj3t0vgg2gR6k88HfoMGA=\r
SHA1-Digest: chR4FkSU3aA3WegWuKBf1UG8xDw=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$2.class\r
-SHA1-Digest: tdRgqaKYtiyCv2HsipYkncqfnEg=\r
+SHA1-Digest: 4fiUVZ+X6zhdXzlI4Vaj7Q9nPDo=\r
\r
Name: org/eclipse/cdt/ui/newui/EnvironmentTab$4.class\r
SHA1-Digest: 3bopB4fgx7kbH3KRPjRrzuyCIjM=\r
SHA1-Digest: Y/VaW2R1ejozx+CoAf3okeOQ4DE=\r
\r
Name: plugin.xml\r
-SHA1-Digest: 4/e3oelx5uhtWOXFPYHBT/+qnkE=\r
+SHA1-Digest: FExzTWgmA0KCRaGlGFoy2NUSQIE=\r
\r
Name: org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePartition.c\r
lass\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/utils/EclipseObjects.cla\r
ss\r
-SHA1-Digest: T9xz76Kz9YDVNwQpPkseUBC49p0=\r
+SHA1-Digest: 3jYa7ZuY833Ps6D6bQ1DJY2b2VQ=\r
\r
Name: org/eclipse/cdt/internal/ui/text/spelling/SpellingPreferences.cl\r
ass\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper\r
$SearchScope.class\r
-SHA1-Digest: CJZL2e+czUJv2yRjTdHxO5dKvq8=\r
+SHA1-Digest: YwpeGNC8RR2r2HGGMyIAFL5UFic=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/dialogs/CTextEditChangeP\r
reviewViewer$CompareElement.class\r
\r
Name: org/eclipse/cdt/internal/ui/text/CReconciler$IndexerListener.cla\r
ss\r
-SHA1-Digest: NuxJ2nac6aOJWo46rny7VxNQ2uY=\r
+SHA1-Digest: 261iwdN0R1/HGBCNhT4D5cpMZBs=\r
\r
Name: org/eclipse/cdt/internal/ui/dnd/TransferDropTargetListener.class\r
SHA1-Digest: CJ1o+lVdU02NSwUoLgLE7Pu51CY=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconcile\r
r$2$1.class\r
-SHA1-Digest: o9iP1nfy2S4AoE+58eyHBiPH2yM=\r
+SHA1-Digest: rCKj07Gs8p9LPXistF3jqriHr+o=\r
\r
Name: org/eclipse/cdt/internal/ui/text/contentassist/HippieProposalCom\r
puter.class\r
SHA1-Digest: OrElRv8l9r8OaLN4Ar0GkXSV0BY=\r
\r
Name: org/eclipse/cdt/ui/dialogs/IndexerBlock$3.class\r
-SHA1-Digest: Fnx0PcQy7vKGjQzBi2JQUZFd9qQ=\r
+SHA1-Digest: a+K0lC4H7VsttKceM4m4V8lY1iA=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/ProblemHover$ProblemInf\r
o.class\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBloc\r
k$3.class\r
-SHA1-Digest: 5sJ9J7QWkRzY6sxuOazeOnXvd58=\r
+SHA1-Digest: 5U7AS/tqPBiA0wKRJ0/Udl+6XUY=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlo\r
ck$TodoTask.class\r
\r
Name: org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsJob$3\r
.class\r
-SHA1-Digest: p2tQEAbXih2lhExU4N7NnIPmLKg=\r
+SHA1-Digest: cUXBY1WREapmda9CdXAHGcSsEXs=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/RenameLinkedMode$\r
ExitPolicy.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/RefactoringExecutionHelp\r
er$1.class\r
-SHA1-Digest: XgqQaEvGK5/P4SNjrnVPK5HGRcI=\r
+SHA1-Digest: Pd0aEHCAE6fsLStbaabvK1jyLfc=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.class\r
SHA1-Digest: /ECLiHegSRnfeqRCCBhlJbOp8rk=\r
\r
Name: org/eclipse/cdt/internal/ui/text/AbstractCompareViewerInformatio\r
nControl$1.class\r
-SHA1-Digest: i4PY+vmBwgbww2090CVX2VZmvys=\r
+SHA1-Digest: +tU6FA163cL3gMC84Kc3IvWNF/M=\r
\r
Name: icons/obj16/structfo_obj.gif\r
SHA1-Digest: X6XOj58emtP95g2yUzaDw73OmBg=\r
Name: org/eclipse/cdt/ui/dialogs/ICOptionPage.class\r
SHA1-Digest: bqKElY0DlqArsqHIzvR/lxqFPMI=\r
\r
-Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Getter\r
- SetterInsertEditProvider$AccessorKind.class\r
-SHA1-Digest: F03DtbyuIN2c2F0bKdKCRT1Mx7E=\r
-\r
Name: icons/dlcl16/search_prev.gif\r
SHA1-Digest: T3L8e1sNqbDjz7KGvcvnzBCTKaQ=\r
\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/implementmethod/MethodDe\r
finitionInsertLocationFinder.class\r
-SHA1-Digest: dueqQ7P7W5EertZFlcvcVWIL1dM=\r
+SHA1-Digest: uH6vK0AC+S+vGoWBVLPoYc6XSRM=\r
\r
Name: org/eclipse/cdt/internal/ui/cview/CView$6.class\r
SHA1-Digest: vgtOYUnhlx6LhZx6zMf6SMVK3As=\r
SHA1-Digest: yO3DL7gZmzMzN1lzBmUsP6rR2to=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRefactory.class\r
-SHA1-Digest: SLeLZ9c3pocR/QKjWvMXSB3k/eY=\r
+SHA1-Digest: M9hNgWnKG4WTEjbaDvs21FfXG0Y=\r
\r
Name: org/eclipse/cdt/ui/newui/AbstractLangsListTab$RichLabelProvider.\r
class\r
-SHA1-Digest: Kl0mUBLJZmpJ+M78KMz+N5FBr8k=\r
+SHA1-Digest: 5wfl6tYfUOlW02bm6gBjz9SoS0c=\r
\r
Name: org/eclipse/cdt/internal/corext/template/c/FileTemplateContextTy\r
pe.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Genera\r
teGettersAndSettersInputPage$5.class\r
-SHA1-Digest: xRP93ZWWrMg2ISKduwTZt3lvmq0=\r
+SHA1-Digest: UJaAcU/YQHDi6JAx1+Hy7+LwYGg=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Getter\r
SetterNameGenerator.class\r
-SHA1-Digest: BuvJ9e2UfLJR4wpvNY7VeVVbyoE=\r
+SHA1-Digest: PzHcW7MaAKNaiL0T5Z1lYKvre5Q=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTa\r
bPage.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameIncludePro\r
cessor.class\r
-SHA1-Digest: YZsA6WDVB3pE22LFp5PwE8UTmhY=\r
+SHA1-Digest: x8klJ3iq1Zgx+5YegRQnA9YJamY=\r
\r
Name: icons/obj16/keyword_obj.gif\r
SHA1-Digest: svouEFPEv9Y/0QOdjpR4qAleV80=\r
SHA1-Digest: 25QSJgCcZSG2fCreSToFGxhr0U4=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$8.class\r
-SHA1-Digest: 6otc0Vi55tpuP5hd6OqjsgCP1Bk=\r
+SHA1-Digest: 4qYWkItTJui/b57KmoIHdN2e6jM=\r
\r
Name: icons/elcl16/wordassist_co.gif\r
SHA1-Digest: WpYGr6/zGF8jxD/vmC2nbZjWA6Y=\r
\r
Name: org/eclipse/cdt/ui/refactoring/CTextFileChange.class\r
-SHA1-Digest: WVH8RmOZos9ff60ntLqIKaZdZ+Q=\r
+SHA1-Digest: ohMcxSfc5zMrS4t4Zxt6piI9EKw=\r
\r
Name: org/eclipse/cdt/internal/ui/util/PendingUpdateAdapter.class\r
SHA1-Digest: Dz6bTB6xdDF1nzjyuGtlkLMpY50=\r
e$2.class\r
SHA1-Digest: cU9KmwGR9L+6+TsTrJpZO9KQHjo=\r
\r
+Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Access\r
+ orFactory$GetterFactory.class\r
+SHA1-Digest: xnpDkN5omkQ3IVuFopywJ8806Dc=\r
+\r
Name: org/eclipse/cdt/ui/refactoring/actions/GettersAndSettersAction.c\r
lass\r
SHA1-Digest: isyQ+4mA3XgibzBfmFP56eLfn4I=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameRefactorin\r
gInputPage$2.class\r
-SHA1-Digest: 9wxoM2eDOBYpmO4aY69h1Cy/CjA=\r
+SHA1-Digest: z99XqCrRab2M8KNqu5K05TK1H+0=\r
\r
Name: org/eclipse/cdt/ui/CElementLabelProvider.class\r
SHA1-Digest: 6KcQiQt9EwnTtHjbpYBEZwY6Ba0=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage$4.\r
class\r
-SHA1-Digest: d8Zx6Hc8DLiJE+vZgyGCVmbZiq4=\r
+SHA1-Digest: 6aNzD5SGP6+udKJbdBN8eFEDsO8=\r
\r
Name: icons/obj16/never_translate.gif\r
SHA1-Digest: JM7bCdPDq2mNvyXguU9KlfcuMLs=\r
Name: org/eclipse/cdt/internal/ui/ICHelpContextIds.class\r
SHA1-Digest: qPOMWxJghymA6hSi+PaKHmUwqVA=\r
\r
+Name: org/eclipse/cdt/internal/ui/refactoring/rename/RenameSupport$Dia\r
+ logResult.class\r
+SHA1-Digest: iY2MrdF3yjZX8xVjn9yVzen0eHg=\r
+\r
Name: org/eclipse/cdt/internal/ui/refactoring/extractlocalvariable/Ext\r
ractLocalVariableRefactoring$1.class\r
SHA1-Digest: KewnF58+F1eixblnGwyDd0XtN98=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/TextSearchWrapper\r
$1.class\r
-SHA1-Digest: TbN1OMNj6EOUY7RSfp8RTP5YKrI=\r
+SHA1-Digest: AcnTjXEzVDsXpW8ot+jp6Mfm44s=\r
\r
Name: org/eclipse/cdt/ui/newui/ProjectContentsArea$2.class\r
SHA1-Digest: u4LCAGPEAnJNopx4HE5gxO4Kg7E=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/RenameSupport.cla\r
ss\r
-SHA1-Digest: IHPWHlgFSGpegmCE9ObkSj4ihxY=\r
+SHA1-Digest: jdJtbzXVA3brroRT4U5zuhOc/b8=\r
\r
Name: org/eclipse/cdt/internal/ui/navigator/CNavigatorRefactorActionPr\r
ovider.class\r
SHA1-Digest: AXohyxK4/tg+0/+Ha0PRn7bUMoE=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$1.class\r
-SHA1-Digest: QmcS8V+CNys9lZqX0gf+1acLBo4=\r
+SHA1-Digest: rs+AoUCUDxwllTjNKbVrv48HFfw=\r
\r
Name: org/eclipse/cdt/internal/ui/text/CHeuristicScanner$NonJavaIdenti\r
fierPart.class\r
SHA1-Digest: mDLJwfJWZgtwjGXsD9KEiwqfD6g=\r
\r
Name: org/eclipse/cdt/internal/ui/BaseCElementContentProvider.class\r
-SHA1-Digest: VB2Ig+AjjwwHus7Ypnbok50NNnI=\r
+SHA1-Digest: EhMJrVc/T9a1BS1SiWpAg9lc4fA=\r
\r
Name: org/eclipse/cdt/internal/ui/text/spelling/engine/ISpellCheckEngi\r
ne.class\r
\r
Name: org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconcile\r
r.class\r
-SHA1-Digest: 00AehEhAC4p3IaUyDEQwhcYrzII=\r
+SHA1-Digest: 09M8UE6GPyRCXaeDcmONCwwci7E=\r
\r
Name: icons/elcl16/open_include.gif\r
SHA1-Digest: 5uorTPM3yjxrRe97ZyoIACFwGG4=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/SourceViewerInformation\r
Control$2.class\r
-SHA1-Digest: e0Nrv61nlHlju/QjGhR0hIek7R4=\r
+SHA1-Digest: 6a0cbw1rZOPt7sDzzfqCe3i0isE=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/NodeContainer$NameInform\r
ation.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Genera\r
teGettersAndSettersInputPage.class\r
-SHA1-Digest: gtB/ACmdykRxVvtGOLXBJGh5wJI=\r
+SHA1-Digest: 65/tF3sCSgLmMjrsPCv4FxC5THQ=\r
\r
Name: org/eclipse/cdt/ui/newui/AbstractLangsListTab.class\r
-SHA1-Digest: EiR4qYX6g7wiLYjLvXtm2/jPRLs=\r
+SHA1-Digest: 7PQPMoitHQBWAhpUCEVjNQXRY7U=\r
\r
Name: org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSetti\r
ngsWizardPage$5.class\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$OccurrencesFinderJobC\r
anceler.class\r
-SHA1-Digest: Cgc9NB+pcStVfN0pwNNTF+Bjndc=\r
+SHA1-Digest: 65fjJkLX2LgYiTYdEgqAAVUrMvg=\r
\r
Name: org/eclipse/cdt/internal/ui/text/contentassist/KeywordCompletion\r
ProposalComputer.class\r
\r
Name: org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsJob$N\r
ameKind.class\r
-SHA1-Digest: Am3iu4QjEuyxgVy44zMFj6+vdOk=\r
+SHA1-Digest: SF6hIT5Cok54q+IHAgKI2ifoYJ4=\r
\r
Name: org/eclipse/cdt/internal/ui/viewsupport/ProjectTemplateStore.cla\r
ss\r
\r
Name: org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposal\r
Computer.class\r
-SHA1-Digest: wj1EcOi5fWtFTQq/KrBXgsX6P9o=\r
+SHA1-Digest: kCVib/LzOSCrK3FGEA+BtYDEEJk=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/formatter/WhiteSpaceTabP\r
age.class\r
SHA1-Digest: qLUwV7/Y7RNXqwkyuRXZcGInHzI=\r
\r
Name: org/eclipse/cdt/internal/ui/text/template/TemplateEngine.class\r
-SHA1-Digest: LkuWiYk4dgrkQvc5zl3VbVV9C90=\r
+SHA1-Digest: RUVlTShZ2zX04t4ZiDnkAYs6W4s=\r
\r
Name: org/eclipse/cdt/internal/ui/actions/SurroundWithActionGroup$2.cl\r
ass\r
\r
Name: org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage$FileGroupF\r
ieldAdapter.class\r
-SHA1-Digest: n7bNUfLxij+ulu0+WXlf4AUeufE=\r
+SHA1-Digest: f7tOXKF+liEexdREuRbOF24RKKE=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/AbstractPreferencePage.c\r
lass\r
Name: org/eclipse/cdt/ui/newui/CLocationOutputTab.class\r
SHA1-Digest: 6MpJHhucz+3vnmSMVpBsVBgWK/s=\r
\r
+Name: org/eclipse/cdt/internal/ui/refactoring/rename/RenameSupport$Dia\r
+ logMode.class\r
+SHA1-Digest: 9IrdcL1Al6ipFR5dV9L5z8hlEPM=\r
+\r
Name: icons/wizban/addpath_wiz.gif\r
SHA1-Digest: BsklqQ9glR15oukDdaxP+na9hfo=\r
\r
\r
Name: org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI$1$1.cl\r
ass\r
-SHA1-Digest: b9ufw6Tqp3HePkUE4HB2yvfLoGo=\r
+SHA1-Digest: 71LkcOTcJj7s06/dAAfKyIr8DDg=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/AbstractConfigurationBlo\r
ck$3.class\r
SHA1-Digest: 4cWTORy7dqMiB9noqyDujzmR7io=\r
\r
Name: org/eclipse/cdt/ui/dialogs/IndexerBlock$2.class\r
-SHA1-Digest: vTLpaQmUM7ffWUwCn+N7tlwO5Q8=\r
+SHA1-Digest: 5g0v/9E+cIw35gj628/LxqEVX38=\r
\r
Name: icons/wizban/newhfile_wiz.gif\r
SHA1-Digest: 52klvVDKkjyjurGrF6KTec7lzJk=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBloc\r
k$2.class\r
-SHA1-Digest: hinkWnhpCfC5uRx30xyYgKaRsII=\r
+SHA1-Digest: LueeESU/Lpzw5d4QpLiGKmtGEO0=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/ChangeExceptionHandler$N\r
otCancelableProgressMonitor.class\r
\r
Name: org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsJob$2\r
.class\r
-SHA1-Digest: +LirMevImfn+HV6fqyvHb3oB7OE=\r
+SHA1-Digest: B1LSev66mYN0GB8j2E6iqeVyUIs=\r
\r
Name: icons/dtool16/newclass_wiz.gif\r
SHA1-Digest: mRtiYYMZuTDIAREl3QE2jSc8GNo=\r
SHA1-Digest: WtRCkxJjruoZdS8/xinBX9h8LF4=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover$3.class\r
-SHA1-Digest: JCJdZzbznbxwCuvHRyv+nVA5nts=\r
+SHA1-Digest: 87n3dDStYXER93RD0NcAfOkWjSo=\r
\r
Name: org/eclipse/cdt/internal/ui/cview/CViewContentProvider.class\r
SHA1-Digest: VnG59Pb/SfHVoPkRXUFhcPi32e0=\r
SHA1-Digest: OGo0ZwabFxrnuJOV2mP/6RtQ/84=\r
\r
Name: org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover.class\r
-SHA1-Digest: Jteh43nMDcKa6fXi3wD9/khFcW4=\r
+SHA1-Digest: XMQDelNzw5eCwXSblci2rGoW+ss=\r
\r
Name: org/eclipse/cdt/internal/corext/template/c/FileTemplateContext.c\r
lass\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/Genera\r
teGettersAndSettersInputPage$4.class\r
-SHA1-Digest: vZhRUNKyUe7mKI1V07mTtj4iD68=\r
+SHA1-Digest: 1jkD/nPf5A0Tx6j/32j22D/iqww=\r
\r
Name: org/eclipse/cdt/internal/ui/wizards/folderwizard/NewSourceFolder\r
WizardPage.class\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBloc\r
k$AssocLabelProvider.class\r
-SHA1-Digest: qhDakzWigKIPbGZcFhHUtY8Y+Ps=\r
+SHA1-Digest: 0t0PRoxF8eHWbcMof8883RDiO4M=\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractF\r
unctionInputPage$2.class\r
SHA1-Digest: ucFPt5uVGsijMIIgOEtXBLgDw+Q=\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$7.class\r
-SHA1-Digest: tDVC7OyiRiycH29lwAyS47/9g0s=\r
+SHA1-Digest: 2x9cCBj/I0wOLqLjwWUNMjhmg5M=\r
\r
Name: org/eclipse/cdt/internal/ui/text/contentassist/CCompletionPropos\r
al$ExitPolicy.class\r
SHA1-Digest: K/17j8GctDFXb5WXkMSabRQVVTQ=\r
\r
Name: org/eclipse/cdt/internal/ui/text/CReconciler$1.class\r
-SHA1-Digest: ll94wXfgfPSqWDFmwtpn6o7EHQw=\r
+SHA1-Digest: qBO3Z9+RCoZ8R+jzHZ0UPYqisiQ=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/formatter/ModifyDialogTa\r
bPage$ButtonPreference$1.class\r
\r
Name: org/eclipse/cdt/internal/ui/refactoring/rename/CRenameRefactorin\r
gInputPage$1.class\r
-SHA1-Digest: lQSZdVZfWUxSR1rZU8BFc1WjkL0=\r
+SHA1-Digest: JYiwVnEqJsZq7ubMjrCbREYqhS0=\r
\r
Name: org/eclipse/cdt/internal/ui/wizards/AbstractWizardDropDownAction\r
$1.class\r
\r
Name: org/eclipse/cdt/internal/ui/editor/CEditor$OccurrencesAnnotation\r
UpdaterJob.class\r
-SHA1-Digest: wNI1o/KfAYNzA4Y4Vaxabz1OBfw=\r
+SHA1-Digest: vnd4FqD8UTSO8V1eTjCV/uIeoN4=\r
\r
Name: org/eclipse/cdt/ui/text/CSourceViewerConfiguration$6.class\r
SHA1-Digest: Fz8NoaBBBucAzJtKeHTmA+EnBm4=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage$3.\r
class\r
-SHA1-Digest: rZtqhNMEc+GC3Of4DEIpXC8oPFE=\r
+SHA1-Digest: 0+iOH4lOOLGMuEBe9EFN9qZ9su8=\r
\r
Name: org/eclipse/cdt/internal/ui/filters/FilterDescriptor$2.class\r
SHA1-Digest: Ftl8CFAoNuvlmjpWEFJ5Dr0rNRE=\r
\r
Name: org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBloc\r
k$AssocSorter.class\r
-SHA1-Digest: kbYNZ85CDBMdgN2Ae6mfBzf4/0o=\r
+SHA1-Digest: S/HWzLSN1TpTwXh5AfMig8DULRw=\r
\r
Name: org/eclipse/cdt/internal/ui/indexview/CountNodeAction$2.class\r
SHA1-Digest: WbNZTW51DzOK3J2GRxKFxXIl6mI=\r
#Generated by Maven
-#Thu Sep 15 12:22:05 EDT 2011
-version=5.3.1-SNAPSHOT
+#Sat Feb 11 14:26:39 EST 2012
+version=5.3.2-SNAPSHOT
groupId=org.eclipse.cdt
artifactId=org.eclipse.cdt.ui
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
- <version>8.0.0-SNAPSHOT</version>
+ <version>8.0.2-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
- <version>5.3.1-SNAPSHOT</version>
+ <version>5.3.2-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.ui</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
DocCommentOwner.name = DocCommentOwner
Doxygen.name = Doxygen
-indexedFilesDecorator.label = C/C++ Indexed Files
-
# Hyperlinking
cEditorHyperlinkTarget= C/C++ Editor
cElementHyperlinkDetector= C/C++ Elements
ShiftLeftAction.label= S&hift Left
# Decorators
-excluded-file.name = C/C++ Files Excluded from Build
+indexedFilesDecorator.label = C/C++ Indexed Files
+indexedFilesDecorator.description = Decorates files indexed by C/C++ Indexer.
+excludedFile.name = C/C++ Files and Folders Excluded from Build
+excludedFile.description = Decorates source files and folders excluded from C/C++ build.
templatesViewName= Templates
class="org.eclipse.cdt.ui.wizards.CProjectWizard"
finalPerspective="org.eclipse.cdt.ui.CPerspective"
hasPages="true"
- icon="icons/elcl16/newmngcc_app.gif"
+ icon="icons/elcl16/newmngc_app.gif"
id="org.eclipse.cdt.ui.wizards.NewCWizard2"
name="%Cproject"
project="true">
label="%indexedFilesDecorator.label"
lightweight="true"
state="false">
+ <description>%indexedFilesDecorator.description</description>
<enablement>
<or>
<objectClass name="org.eclipse.cdt.core.model.ITranslationUnit"/>
</or>
</enablement>
</decorator>
+ <decorator
+ adaptable="true"
+ class="org.eclipse.cdt.internal.ui.viewsupport.ExcludedFileDecorator"
+ id="org.eclipse.cdt.managedbuilder.ui.excludedFile"
+ label="%excludedFile.name"
+ lightweight="true"
+ state="true">
+ <description>%excludedFile.description</description>
+ <enablement>
+ <or>
+ <objectClass name="org.eclipse.core.resources.IFile" />
+ <objectClass name="org.eclipse.core.resources.IFolder" />
+ </or>
+ </enablement>
+ </decorator>
</extension>
<!-- Hyperlinking support -->
</complexArray>
</processType>
</extension>
- <extension point="org.eclipse.ui.decorators">
- <decorator adaptable="true"
- class="org.eclipse.cdt.internal.ui.viewsupport.ExcludedFileDecorator"
- id="org.eclipse.cdt.managedbuilder.ui.excludedFile" label="%excluded-file.name"
- lightweight="true" state="true">
- <enablement>
- <objectClass name="org.eclipse.core.resources.IFile" />
- </enablement>
- </decorator>
- </extension>
<extension
point="org.eclipse.ui.commands">
<command
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
}
Object parent = null;
if (element instanceof ICElement) {
- if (element instanceof ICContainer && !CCorePlugin.showSourceRootsAtTopOfProject()) {
- parent = ((ICContainer) element).getResource().getParent();
+ if (element instanceof ISourceRoot && !CCorePlugin.showSourceRootsAtTopOfProject()) {
+ parent = ((ICElement) element).getResource().getParent();
+ if (parent instanceof IProject) {
+ return ((ICElement) element).getCProject();
+ }
}
else
- parent = ((ICElement)element).getParent();
+ parent = ((ICElement)element).getParent();
// translate working copy parent to original TU,
// because working copies are never returned by getChildren
// this is necessary for proper show-in-target support
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.dom.ast.DOMException;
+import org.eclipse.cdt.core.dom.ast.EScopeKind;
+import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
+import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
import org.eclipse.cdt.core.dom.ast.IASTName;
+import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IEnumerator;
import org.eclipse.cdt.core.dom.ast.IFunction;
+import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IVariable;
import org.eclipse.cdt.core.dom.ast.c.ICExternalBinding;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionCallExpression;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.index.IIndexManager;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.ITranslationUnit;
-import org.eclipse.cdt.internal.ui.viewsupport.CElementLabels;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.internal.core.model.ext.ICElementHandle;
import org.eclipse.cdt.internal.ui.actions.OpenActionUtil;
import org.eclipse.cdt.internal.ui.util.ExceptionHandler;
import org.eclipse.cdt.internal.ui.util.StatusLineHandler;
+import org.eclipse.cdt.internal.ui.viewsupport.CElementLabels;
import org.eclipse.cdt.internal.ui.viewsupport.IndexUI;
public class CallHierarchyUI {
IASTName name= IndexUI.getSelectedName(editorInput, sel);
if (name != null) {
IBinding binding= name.resolveBinding();
+ if (!CallHierarchyUI.isRelevantForCallHierarchy(binding)) {
+ for (IASTNode parent= name; parent != null; parent= parent.getParent()) {
+ if (parent.getPropertyInParent() == IASTFunctionCallExpression.FUNCTION_NAME) {
+ ICPPASTFunctionCallExpression fcall= (ICPPASTFunctionCallExpression) parent.getParent();
+ if (fcall != null) {
+ IASTImplicitName[] implicit = fcall.getImplicitNames();
+ if (implicit.length > 0)
+ binding= implicit[0].resolveBinding();
+ }
+ break;
+ }
+ }
+ }
if (CallHierarchyUI.isRelevantForCallHierarchy(binding)) {
if (name.isDefinition()) {
ICElement elem= IndexUI.getCElementForName(project, index, name);
public static boolean isRelevantForCallHierarchy(IBinding binding) {
if (binding instanceof ICExternalBinding ||
binding instanceof IEnumerator ||
- binding instanceof IFunction ||
- binding instanceof IVariable) {
+ binding instanceof IFunction)
+ return true;
+
+ if (binding instanceof IVariable) {
+ try {
+ final IScope scope = binding.getScope();
+ if (scope != null && scope.getKind() == EScopeKind.eLocal)
+ return false;
+ } catch (DOMException e) {
+ }
return true;
}
return false;
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
}
protected ProblemTreeViewer createTreeViewer(Composite parent) {
- fTreeViewer = new OutlineTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- fTreeViewer.setContentProvider(createContentProvider(fTreeViewer));
- fTreeViewer.setLabelProvider(new DecoratingCLabelProvider(createLabelProvider(), true));
- fTreeViewer.setAutoExpandLevel(3);
- fTreeViewer.setUseHashlookup(true);
- fTreeViewer.addSelectionChangedListener(this);
- return fTreeViewer;
+ ProblemTreeViewer treeViewer = new OutlineTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ treeViewer.setContentProvider(createContentProvider(treeViewer));
+ treeViewer.setLabelProvider(new DecoratingCLabelProvider(createLabelProvider(), true));
+ treeViewer.setAutoExpandLevel(3);
+ treeViewer.setUseHashlookup(true);
+ treeViewer.addSelectionChangedListener(this);
+ return treeViewer;
}
private CUILabelProvider createLabelProvider() {
if (IndexerPreferences.KEY_INDEX_ON_OPEN.equals(event.getKey())) {
ICElement element= getInputCElement();
ITranslationUnit tu = element != null ? (ITranslationUnit) element : null;
- updateIndexInclusion(tu, false);
+ updateIndexInclusion(tu);
}
}
/** The translation unit that was added by the editor to index, or <code>null</code>. */
private ITranslationUnit fTuAddedToIndex;
- private IndexerPreferenceListener fIndexerPreferenceListener;
+ private final IndexerPreferenceListener fIndexerPreferenceListener;
private static final Set<String> angularIntroducers = new HashSet<String>();
static {
if (element instanceof ITranslationUnit) {
ITranslationUnit tu = (ITranslationUnit) element;
- updateIndexInclusion(tu, false);
+ updateIndexInclusion(tu);
fBracketMatcher.configure(tu.getLanguage());
} else {
- updateIndexInclusion(null, false);
+ updateIndexInclusion(null);
fBracketMatcher.configure(null);
}
}
- private void updateIndexInclusion(ITranslationUnit tu, boolean synchronous) {
- if (tu!= null) {
+ private void updateIndexInclusion(ITranslationUnit tu) {
+ if (tu != null) {
IProject project = tu.getCProject().getProject();
if (!String.valueOf(true).equals(IndexerPreferences.get(project, IndexerPreferences.KEY_INDEX_ON_OPEN, null))) {
tu = null;
}
}
- if (tu != null || fTuAddedToIndex != null) {
+ if ((tu != null || fTuAddedToIndex != null) && tu != fTuAddedToIndex) {
IndexUpdateRequestorJob job = new IndexUpdateRequestorJob(tu, fTuAddedToIndex);
fTuAddedToIndex = tu;
job.schedule();
- if (synchronous) {
- try {
- job.join();
- } catch (InterruptedException e) {
- // Ignore.
- }
- }
}
}
*/
@Override
public void dispose() {
- updateIndexInclusion(null, true);
+ fIndexerPreferenceListener.unregister();
+ updateIndexInclusion(null);
ISourceViewer sourceViewer = getSourceViewer();
if (sourceViewer instanceof ITextViewerExtension)
/**
* Highlighting style.
*/
- static class HighlightingStyle {
+ public static class HighlightingStyle {
/** Text attribute */
private TextAttribute fTextAttribute;
/**
* Highlighted Positions.
*/
- static class HighlightedPosition extends Position {
+ public static class HighlightedPosition extends Position {
/** Highlighting of the position */
private HighlightingStyle fStyle;
}
/** Semantic highlighting presenter */
- private SemanticHighlightingPresenter fPresenter;
+ protected SemanticHighlightingPresenter fPresenter;
/** Semantic highlighting reconciler */
private SemanticHighlightingReconciler fReconciler;
/** Semantic highlightings */
- private SemanticHighlighting[] fSemanticHighlightings;
+ protected SemanticHighlighting[] fSemanticHighlightings;
/** Highlightings */
- private HighlightingStyle[] fHighlightings;
+ protected HighlightingStyle[] fHighlightings;
/** The editor */
private CEditor fEditor;
/** The source viewer */
- private CSourceViewer fSourceViewer;
+ protected CSourceViewer fSourceViewer;
/** The color manager */
- private IColorManager fColorManager;
+ protected IColorManager fColorManager;
/** The preference store */
- private IPreferenceStore fPreferenceStore;
+ protected IPreferenceStore fPreferenceStore;
/** The source viewer configuration */
- private CSourceViewerConfiguration fConfiguration;
+ protected CSourceViewerConfiguration fConfiguration;
/** The presentation reconciler */
- private CPresentationReconciler fPresentationReconciler;
+ protected CPresentationReconciler fPresentationReconciler;
/** The hard-coded ranges */
- private HighlightedRange[][] fHardcodedRanges;
+ protected HighlightedRange[][] fHardcodedRanges;
/**
* Install the semantic highlighting on the given editor infrastructure
*
* @return the hard-coded positions
*/
- private HighlightedPosition[] createHardcodedPositions() {
+ protected HighlightedPosition[] createHardcodedPositions() {
List<HighlightedPosition> positions= new ArrayList<HighlightedPosition>();
for (int i= 0; i < fHardcodedRanges.length; i++) {
HighlightedRange range= null;
/**
* @return <code>true</code> iff semantic highlighting is enabled in the preferences
*/
- private boolean isEnabled() {
+ protected boolean isEnabled() {
return SemanticHighlightings.isEnabled(fPreferenceStore);
}
/**
* Initialize semantic highlightings.
*/
- private void initializeHighlightings() {
+ protected void initializeHighlightings() {
fSemanticHighlightings= SemanticHighlightings.getSemanticHighlightings();
fHighlightings= new HighlightingStyle[fSemanticHighlightings.length];
/**
* Dispose the semantic highlightings.
*/
- private void disposeHighlightings() {
+ protected void disposeHighlightings() {
for (int i= 0, n= fSemanticHighlightings.length; i < n; i++)
removeColor(SemanticHighlightings.getColorPreferenceKey(fSemanticHighlightings[i]));
* Handle the given property change event
*
* @param event The event
+ * @return
*/
- private void handlePropertyChangeEvent(PropertyChangeEvent event) {
+ protected boolean handlePropertyChangeEvent(PropertyChangeEvent event) {
if (fPreferenceStore == null)
- return; // Uninstalled during event notification
+ return false; // Uninstalled during event notification
if (fConfiguration != null)
fConfiguration.handlePropertyChangeEvent(event);
}
if (!isEnabled())
- return;
+ return false;
boolean refreshNeeded= false;
if (refreshNeeded && fReconciler != null)
fReconciler.refresh();
+
+ return refreshNeeded;
}
private void adaptToEnablementChange(HighlightingStyle highlighting, PropertyChangeEvent event) {
/** The C editor this semantic highlighting reconciler is installed on */
private CEditor fEditor;
/** The semantic highlighting presenter */
- private SemanticHighlightingPresenter fPresenter;
+ protected SemanticHighlightingPresenter fPresenter;
/** Semantic highlightings */
- private SemanticHighlighting[] fSemanticHighlightings;
+ protected SemanticHighlighting[] fSemanticHighlightings;
/** Highlightings */
private HighlightingStyle[] fHighlightings;
/** Background job's added highlighted positions */
- private List<HighlightedPosition> fAddedPositions= new ArrayList<HighlightedPosition>();
+ protected List<HighlightedPosition> fAddedPositions= new ArrayList<HighlightedPosition>();
/** Background job's removed highlighted positions */
- private List<HighlightedPosition> fRemovedPositions= new ArrayList<HighlightedPosition>();
+ protected List<HighlightedPosition> fRemovedPositions= new ArrayList<HighlightedPosition>();
/** Number of removed positions */
- private int fNOfRemovedPositions;
+ protected int fNOfRemovedPositions;
/** Background job */
private Job fJob;
private boolean fIsReconciling= false;
/** The semantic highlighting presenter - cache for background thread, only valid during {@link #reconciled(IASTTranslationUnit, boolean, IProgressMonitor)} */
- private SemanticHighlightingPresenter fJobPresenter;
+ protected SemanticHighlightingPresenter fJobPresenter;
/** Semantic highlightings - cache for background thread, only valid during {@link #reconciled(IASTTranslationUnit, boolean, IProgressMonitor)} */
- private SemanticHighlighting[] fJobSemanticHighlightings;
+ protected SemanticHighlighting[] fJobSemanticHighlightings;
/** Highlightings - cache for background thread, only valid during {@link #reconciled(IASTTranslationUnit, boolean, IProgressMonitor)} */
private HighlightingStyle[] fJobHighlightings;
/**
* Start reconciling positions.
*/
- private void startReconcilingPositions() {
+ protected void startReconcilingPositions() {
fJobPresenter.addAllPositions(fRemovedPositions);
fNOfRemovedPositions= fRemovedPositions.size();
}
/**
* Stop reconciling positions.
*/
- private void stopReconcilingPositions() {
+ protected void stopReconcilingPositions() {
fRemovedPositions.clear();
fNOfRemovedPositions= 0;
fAddedPositions.clear();
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
import org.eclipse.cdt.internal.ui.editor.CEditor;
import org.eclipse.cdt.internal.ui.preferences.OverlayPreferenceStore.OverlayKey;
+import org.eclipse.cdt.internal.ui.text.c.hover.SourceViewerInformationControl;
import org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistPreference;
import org.eclipse.cdt.internal.ui.text.doctools.DocCommentOwnerManager;
*/
private void initializeDefaultColors() {
if (getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)) {
- RGB rgb= fAppearanceColorList.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
+ Display display= fAppearanceColorList.getDisplay();
+ RGB rgb= SourceViewerInformationControl.getVisibleBackgroundColor(display);
+ if (rgb == null)
+ rgb= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
PreferenceConverter.setValue(getPreferenceStore(), PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR, rgb);
}
}
* for displaying/editing CDT file type associations
*/
public class CFileTypesPreferenceBlock {
-
private static final int COL_PATTERN = 0;
private static final int COL_DESCRIPTION = 1;
private static final int COL_STATUS = 2;
public String getText(Object element) {
return getColumnText(element, 0);
}
-
}
public CFileTypesPreferenceBlock() {
public IContentType[] getRegistedContentTypes() {
if (fContentTypes == null) {
- String [] ids = CoreModel.getRegistedContentTypeIds();
+ String[] ids = CoreModel.getRegistedContentTypeIds();
IContentTypeManager manager = Platform.getContentTypeManager();
- IContentType [] ctypes = new IContentType[ids.length];
+ IContentType[] ctypes = new IContentType[ids.length];
for (int i = 0; i < ids.length; i++) {
ctypes[i] = manager.getContentType(ids[i]);
}
IContentTypeSettings settings;
if (fInput == null) {
settings= assoc.getContentType();
- }
- else {
+ } else {
try {
settings= assoc.getContentType().getSettings(new ProjectScope(fInput));
} catch (CoreException e) {
*******************************************************************************/
package org.eclipse.cdt.internal.ui.preferences;
-
-
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
* type associations for the workspace
*/
public class CFileTypesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
private CFileTypesPreferenceBlock fPrefsBlock;
public CFileTypesPreferencePage() {
*/
@Override
public boolean performOk() {
-
if (fPrefsBlock.performOk()) {
}
return super.performOk();
}
-
}
@Override
protected void validateSettings(Key changedKey, String oldValue, String newValue) {
StatusInfo status = new StatusInfo();
- if (selectedCategory != null) {
+ if (selectedCategory != null && changedKey != null) {
NameValidator validator = selectedCategory.getNameValidator();
if (changedKey.equals(selectedCategory.getPrefixKey()) ||
changedKey.equals(selectedCategory.getAlternativePrefixKey())) {
private final int fSaveMode;
private class Operation implements IWorkspaceRunnable {
- public Change fChange;
- public PerformChangeOperation fPerformChangeOperation;
- private final boolean fForked;
- private final boolean fForkChangeExecution;
+ Change fChange;
+ PerformChangeOperation fPerformChangeOperation;
+ final boolean fForked;
+ final boolean fForkChangeExecution;
+ final boolean fCancelable;
- public Operation(boolean forked, boolean forkChangeExecution) {
+ public Operation(boolean forked, boolean forkChangeExecution, boolean cancelable) {
fForked= forked;
fForkChangeExecution= forkChangeExecution;
+ this.fCancelable = cancelable;
}
public void run(IProgressMonitor pm) throws CoreException {
pm.beginTask("", fForked && !fForkChangeExecution ? 7 : 11); //$NON-NLS-1$
pm.subTask(""); //$NON-NLS-1$
- final RefactoringStatus status= fRefactoring.checkAllConditions(new SubProgressMonitor(pm, 4, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
+ final RefactoringStatus status= fRefactoring.checkAllConditions(
+ new SubProgressMonitor(pm, 4, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
if (status.getSeverity() >= fStopSeverity) {
final boolean[] canceled= { false };
if (fForked) {
fChange= fRefactoring.createChange(new SubProgressMonitor(pm, 2, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
fChange.initializeValidationData(new SubProgressMonitor(pm, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
- fPerformChangeOperation= new PerformChangeOperation(fChange);//RefactoringUI.createUIAwareChangeOperation(fChange);
- fPerformChangeOperation.setUndoManager(RefactoringCore.getUndoManager(), fRefactoring.getName());
- if (fRefactoring instanceof IScheduledRefactoring)
- fPerformChangeOperation.setSchedulingRule(((IScheduledRefactoring) fRefactoring).getSchedulingRule());
+ fPerformChangeOperation = createPerformChangeOperation(fChange);
if (!fForked || fForkChangeExecution)
fPerformChangeOperation.run(new SubProgressMonitor(pm, 4, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
* @throws InterruptedException thrown when the operation is canceled
* @throws InvocationTargetException thrown when the operation failed to execute
*/
- public void perform(boolean fork, boolean forkChangeExecution, boolean cancelable) throws InterruptedException, InvocationTargetException {
+ public void perform(boolean fork, boolean forkChangeExecution, boolean cancelable)
+ throws InterruptedException, InvocationTargetException {
+ Operation operation = new Operation(fork, forkChangeExecution, cancelable);
+ performOperation(operation, null, fork);
+ }
+
+ public void performChange(Change change, boolean fork)
+ throws InterruptedException, InvocationTargetException {
+ PerformChangeOperation operation = createPerformChangeOperation(change);
+ performOperation(null, operation, fork);
+ }
+
+ /**
+ * Executes either a complete refactoring operation or a change operation.
+ * @param operation The refactoring operation. Can be <code>null</code>.
+ * @param changeOperation The change operation. Has to be <code>null</code> if {@code operation}
+ * is not <code>null</code> and not <code>null</code> otherwise.
+ * @param fork If set, the execution will be forked.
+ */
+ private void performOperation(Operation operation, PerformChangeOperation changeOperation, boolean fork)
+ throws InterruptedException, InvocationTargetException {
+ Assert.isTrue((operation == null) != (changeOperation == null));
Assert.isTrue(Display.getCurrent() != null);
final IJobManager manager= Job.getJobManager();
- final ISchedulingRule rule;
- if (fRefactoring instanceof IScheduledRefactoring) {
- rule= ((IScheduledRefactoring) fRefactoring).getSchedulingRule();
- } else {
- rule= ResourcesPlugin.getWorkspace().getRoot();
- }
+ final ISchedulingRule rule = getSchedulingRule();
try {
try {
Runnable r= new Runnable() {
}
RefactoringSaveHelper saveHelper= new RefactoringSaveHelper(fSaveMode);
- if (!saveHelper.saveEditors(fParent))
- throw new InterruptedException();
- final Operation op= new Operation(fork, forkChangeExecution);
+ if (operation != null) {
+ if (!saveHelper.saveEditors(fParent))
+ throw new InterruptedException();
+ }
fRefactoring.setValidationContext(fParent);
try {
- fExecContext.run(fork, cancelable, new WorkbenchRunnableAdapter(op, rule, true));
- if (fork && !forkChangeExecution && op.fPerformChangeOperation != null)
- fExecContext.run(false, false, new WorkbenchRunnableAdapter(op.fPerformChangeOperation, rule, true));
-
- if (op.fPerformChangeOperation != null) {
- RefactoringStatus validationStatus= op.fPerformChangeOperation.getValidationStatus();
+ if (operation != null) {
+ fExecContext.run(fork, operation.fCancelable, new WorkbenchRunnableAdapter(operation, rule, true));
+ changeOperation = operation.fPerformChangeOperation;
+ fork = fork && !operation.fForkChangeExecution;
+ }
+
+ if (changeOperation != null) {
+ if (fork)
+ fExecContext.run(false, false, new WorkbenchRunnableAdapter(changeOperation, rule, true));
+ RefactoringStatus validationStatus= changeOperation.getValidationStatus();
if (validationStatus != null && validationStatus.hasFatalError()) {
MessageDialog.openError(fParent, fRefactoring.getName(),
NLS.bind(Messages.RefactoringExecutionHelper_cannot_execute,
}
}
} catch (InvocationTargetException e) {
- PerformChangeOperation pco= op.fPerformChangeOperation;
- if (pco != null && pco.changeExecutionFailed()) {
+ if (changeOperation != null && changeOperation.changeExecutionFailed()) {
ChangeExceptionHandler handler= new ChangeExceptionHandler(fParent, fRefactoring);
Throwable inner= e.getTargetException();
if (inner instanceof RuntimeException) {
- handler.handle(pco.getChange(), (RuntimeException)inner);
+ handler.handle(changeOperation.getChange(), (RuntimeException)inner);
} else if (inner instanceof CoreException) {
- handler.handle(pco.getChange(), (CoreException)inner);
+ handler.handle(changeOperation.getChange(), (CoreException)inner);
} else {
throw e;
}
fRefactoring.setValidationContext(null);
}
}
+
+ private ISchedulingRule getSchedulingRule() {
+ if (fRefactoring instanceof IScheduledRefactoring) {
+ return ((IScheduledRefactoring) fRefactoring).getSchedulingRule();
+ } else {
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+ }
+
+ private PerformChangeOperation createPerformChangeOperation(Change change) {
+ PerformChangeOperation operation = new PerformChangeOperation(change);
+ operation.setUndoManager(RefactoringCore.getUndoManager(), fRefactoring.getName());
+ if (fRefactoring instanceof IScheduledRefactoring)
+ operation.setSchedulingRule(((IScheduledRefactoring) fRefactoring).getSchedulingRule());
+ return operation;
+ }
}
arguments.put(CRefactoringDescription.SELECTION, region.getOffset() + "," + region.getLength()); //$NON-NLS-1$
arguments.put(ExtractFunctionRefactoringDescription.NAME, info.getMethodName());
arguments.put(ExtractFunctionRefactoringDescription.VISIBILITY, info.getVisibility().toString());
- arguments.put(ExtractFunctionRefactoringDescription.REPLACE_DUBLICATES, Boolean.toString(info.isReplaceDuplicates()));
+ arguments.put(ExtractFunctionRefactoringDescription.REPLACE_DUPLICATES, Boolean.toString(info.isReplaceDuplicates()));
return arguments;
}
}
public class ExtractFunctionRefactoringDescription extends CRefactoringDescription {
protected static final String NAME = "name"; //$NON-NLS-1$
protected static final String VISIBILITY = "visibility"; //$NON-NLS-1$
- protected static final String REPLACE_DUBLICATES = "replaceDuplicates"; //$NON-NLS-1$
+ protected static final String REPLACE_DUPLICATES = "replaceDuplicates"; //$NON-NLS-1$
public ExtractFunctionRefactoringDescription(String project, String description,
String comment, Map<String, String> arguments) {
info.setMethodName(arguments.get(NAME));
info.setVisibility(VisibilityEnum.getEnumForStringRepresentation(arguments.get(VISIBILITY)));
- info.setReplaceDuplicates(Boolean.parseBoolean(arguments.get(REPLACE_DUBLICATES)));
+ info.setReplaceDuplicates(Boolean.parseBoolean(arguments.get(REPLACE_DUPLICATES)));
proj = getCProject();
file = getFile();
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2011 Google, Inc and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sergey Prigogin (Google) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.refactoring.gettersandsetters;
+
+import com.ibm.icu.text.Collator;
+
+import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
+import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
+import org.eclipse.cdt.core.dom.ast.IASTName;
+import org.eclipse.cdt.core.dom.ast.IASTNode;
+import org.eclipse.cdt.core.dom.ast.IASTNode.CopyStyle;
+import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
+
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTQualifiedName;
+
+public class AccessorDescriptor implements Comparable<AccessorDescriptor> {
+ public enum AccessorKind {
+ GETTER,
+ SETTER;
+ }
+
+ private static final Collator collator = Collator.getInstance();
+
+ private final AccessorKind kind;
+ private final String accessorName;
+ private final IASTName fieldName;
+ private AccessorFactory accessorFactory;
+ private IASTSimpleDeclaration accessorDeclaration;
+ private IASTSimpleDeclaration existingAccessorDeclaration;
+ private IASTFunctionDefinition existingAccessorDefinition;
+
+ public AccessorDescriptor(AccessorKind kind, String accessorName, FieldDescriptor fieldDescriptor) {
+ GetterSetterContext context = fieldDescriptor.getContext();
+ this.kind = kind;
+ this.accessorName = accessorName;
+ this.fieldName = fieldDescriptor.getFieldName();
+ if (accessorName != null) {
+ this.accessorFactory = AccessorFactory.createFactory(kind, fieldName,
+ fieldDescriptor.getFieldDeclaration(), accessorName);
+ this.accessorDeclaration = accessorFactory.createDeclaration();
+
+ for (IASTFunctionDefinition currentDefinition : context.existingFunctionDefinitions) {
+ if (currentDefinition.getDeclarator().getName().toString().equals(accessorName)) {
+ existingAccessorDefinition = currentDefinition;
+ }
+ }
+ for (IASTSimpleDeclaration currentDeclaration : context.existingFunctionDeclarations) {
+ if (GetterSetterContext.getDeclarationName(currentDeclaration).toString().equals(accessorName)) {
+ existingAccessorDeclaration = currentDeclaration;
+ }
+ }
+ }
+ }
+
+ boolean canBeGenerated() {
+ return accessorName != null && existingAccessorDeclaration == null && existingAccessorDefinition == null;
+ }
+
+ public AccessorKind getKind() {
+ return kind;
+ }
+
+ public IASTName getFieldName() {
+ return fieldName;
+ }
+
+ public int compareTo(AccessorDescriptor other) {
+ int c = collator.compare(fieldName.toString(), other.fieldName.toString());
+ if (c != 0)
+ return c;
+ return kind.ordinal() - other.kind.ordinal();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof AccessorDescriptor))
+ return false;
+ AccessorDescriptor other = (AccessorDescriptor) obj;
+ return fieldName == other.fieldName && kind == other.kind;
+ }
+
+ @Override
+ public String toString() {
+ return accessorName;
+ }
+
+ public IASTSimpleDeclaration getAccessorDeclaration() {
+ return accessorDeclaration;
+ }
+
+ public IASTFunctionDefinition getAccessorDefinition(boolean qualifedName) {
+ ICPPASTQualifiedName qname;
+ if (qualifedName) {
+ qname = getClassName();
+ } else {
+ qname = null;
+ }
+
+ return accessorFactory.createDefinition(qname);
+ }
+
+ private ICPPASTQualifiedName getClassName() {
+ IASTNode node = fieldName.getParent();
+ while (!(node instanceof IASTCompositeTypeSpecifier)) {
+ node = node.getParent();
+ }
+ IASTCompositeTypeSpecifier comp = (IASTCompositeTypeSpecifier) node;
+
+ CPPASTQualifiedName qname = new CPPASTQualifiedName();
+ qname.addName(comp.getName().copy(CopyStyle.withLocations));
+ return qname;
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2008, 2011 Institute for Software, HSR Hochschule fuer Technik
+ * Rapperswil, University of applied sciences and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Institute for Software - initial API and implementation
+ * Sergey Prigogin (Google)
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.refactoring.gettersandsetters;
+
+import java.util.Arrays;
+
+import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
+import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
+import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
+import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
+import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
+import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
+import org.eclipse.cdt.core.dom.ast.IASTName;
+import org.eclipse.cdt.core.dom.ast.IASTNode.CopyStyle;
+import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
+import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
+import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTArrayDeclarator;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
+import org.eclipse.cdt.core.parser.Keywords;
+
+import org.eclipse.cdt.internal.core.dom.parser.c.CASTDeclarator;
+import org.eclipse.cdt.internal.core.dom.parser.c.CASTPointer;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFieldReference;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTLiteralExpression;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTParameterDeclaration;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTPointer;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTReferenceOperator;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTReturnStatement;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
+import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration;
+
+import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.AccessorDescriptor.AccessorKind;
+
+public abstract class AccessorFactory {
+ protected final IASTName fieldName;
+ protected final IASTSimpleDeclaration fieldDeclaration;
+ protected final String accessorName;
+ protected boolean passByReference;
+
+ public static AccessorFactory createFactory(AccessorKind kind, IASTName fieldName,
+ IASTSimpleDeclaration fieldDeclaration, String accessorName) {
+ if (kind == AccessorKind.GETTER) {
+ return new GetterFactory(fieldName, fieldDeclaration, accessorName);
+ } else {
+ return new SetterFactory(fieldName, fieldDeclaration, accessorName);
+ }
+ }
+
+ protected AccessorFactory(IASTName fieldName, IASTSimpleDeclaration fieldDeclaration,
+ String accessorName) {
+ this.fieldName = fieldName;
+ this.fieldDeclaration = fieldDeclaration;
+ this.accessorName = accessorName;
+// IType type = CPPVisitor.createType(fieldDeclaration.getDeclSpecifier());
+// passByReference = TypeHelper.shouldBePassedByReference(type, fieldDeclaration.getTranslationUnit());
+ }
+
+ /**
+ * Creates an accessor declaration.
+ */
+ public abstract IASTSimpleDeclaration createDeclaration();
+
+ /**
+ * Creates an accessor definition.
+ *
+ * @param className qualified name of the class containing the accessor
+ */
+ public abstract IASTFunctionDefinition createDefinition(ICPPASTQualifiedName className);
+
+ protected IASTDeclSpecifier getParamOrReturnDeclSpecifier() {
+ IASTDeclSpecifier declSpec = fieldDeclaration.getDeclSpecifier().copy(CopyStyle.withLocations);
+ if (passByReference || fieldDeclaration.getDeclarators()[0] instanceof IASTArrayDeclarator) {
+ declSpec.setConst(true);
+ }
+ return declSpec;
+ }
+
+ private static class GetterFactory extends AccessorFactory {
+ GetterFactory(IASTName fieldName, IASTSimpleDeclaration fieldDeclaration, String getterName) {
+ super(fieldName, fieldDeclaration, getterName);
+ }
+
+ @Override
+ public IASTSimpleDeclaration createDeclaration() {
+ IASTSimpleDeclaration getter = new CPPASTSimpleDeclaration();
+ getter.setDeclSpecifier(getParamOrReturnDeclSpecifier());
+ getter.addDeclarator(getGetterDeclarator(null));
+ return getter;
+ }
+
+ @Override
+ public IASTFunctionDefinition createDefinition(ICPPASTQualifiedName className) {
+ IASTFunctionDefinition getter = new CPPASTFunctionDefinition();
+
+ getter.setDeclSpecifier(getParamOrReturnDeclSpecifier());
+ IASTDeclarator getterDeclarator = getGetterDeclarator(className);
+ // IASTFunctionDefinition expects the outermost IASTFunctionDeclarator in declarator hierarchy
+ while (!(getterDeclarator instanceof IASTFunctionDeclarator)) {
+ getterDeclarator = getterDeclarator.getNestedDeclarator();
+ }
+ getter.setDeclarator((IASTFunctionDeclarator) getterDeclarator);
+ getter.setBody(getGetterBody());
+ return getter;
+ }
+
+ private CPPASTCompoundStatement getGetterBody() {
+ CPPASTCompoundStatement compound = new CPPASTCompoundStatement();
+ CPPASTReturnStatement returnStatement = new CPPASTReturnStatement();
+ CPPASTIdExpression idExpr = new CPPASTIdExpression();
+ CPPASTName returnVal = new CPPASTName();
+ returnVal.setName(fieldName.toCharArray());
+ idExpr.setName(returnVal);
+ returnStatement.setReturnValue(idExpr);
+ compound.addStatement(returnStatement);
+ return compound;
+ }
+
+ private IASTDeclarator getGetterDeclarator(ICPPASTQualifiedName qualifiedName) {
+ CPPASTName getterName = new CPPASTName();
+ getterName.setName(accessorName.toCharArray());
+
+ // Copy declarator hierarchy
+ IASTDeclarator topDeclarator = fieldDeclaration.getDeclarators()[0].copy(CopyStyle.withLocations);
+
+ if (topDeclarator instanceof IASTArrayDeclarator) {
+ boolean isCpp = topDeclarator instanceof ICPPASTArrayDeclarator;
+ IASTDeclarator decl = isCpp ? new CPPASTDeclarator() : new CASTDeclarator();
+ decl.setName(topDeclarator.getName());
+ decl.setNestedDeclarator(topDeclarator.getNestedDeclarator());
+ decl.addPointerOperator(isCpp ? new CPPASTPointer() : new CASTPointer());
+ for (IASTPointerOperator pointer : topDeclarator.getPointerOperators()) {
+ decl.addPointerOperator(pointer);
+ }
+ topDeclarator = decl;
+ }
+ // Find the innermost declarator in hierarchy
+ IASTDeclarator innermost = topDeclarator;
+ while (innermost.getNestedDeclarator() != null) {
+ innermost = innermost.getNestedDeclarator();
+ }
+
+ // Create a new innermost function declarator based on the field declarator
+ CPPASTFunctionDeclarator functionDeclarator = new CPPASTFunctionDeclarator();
+ functionDeclarator.setConst(true);
+ if (qualifiedName != null) {
+ qualifiedName.addName(getterName);
+ functionDeclarator.setName(qualifiedName);
+ } else {
+ functionDeclarator.setName(getterName);
+ }
+ for (IASTPointerOperator pointer : innermost.getPointerOperators()){
+ functionDeclarator.addPointerOperator(pointer.copy(CopyStyle.withLocations));
+ }
+ if (passByReference) {
+ functionDeclarator.addPointerOperator(new CPPASTReferenceOperator(false));
+ }
+
+ // Replace the innermost with functionDeclarator and return the whole declarator tree
+ if (innermost == topDeclarator) {
+ // No tree
+ return functionDeclarator;
+ } else {
+ IASTDeclarator parent = (IASTDeclarator) innermost.getParent();
+ parent.setNestedDeclarator(functionDeclarator);
+ return topDeclarator;
+ }
+ }
+ }
+
+ private static class SetterFactory extends AccessorFactory {
+ SetterFactory(IASTName fieldName, IASTSimpleDeclaration fieldDeclaration, String setterName) {
+ super(fieldName, fieldDeclaration, setterName);
+ }
+
+ @Override
+ public IASTSimpleDeclaration createDeclaration() {
+ IASTSimpleDeclaration setter = new CPPASTSimpleDeclaration();
+ setter.setDeclSpecifier(getVoidDeclSpec());
+ setter.addDeclarator(getSetterDeclarator(null));
+ return setter;
+ }
+
+ @Override
+ public IASTFunctionDefinition createDefinition(ICPPASTQualifiedName className) {
+ IASTFunctionDefinition setter = new CPPASTFunctionDefinition();
+ setter.setDeclSpecifier(getVoidDeclSpec());
+ setter.setDeclarator(getSetterDeclarator(className));
+ setter.setBody(getSetterBody());
+ return setter;
+ }
+
+ private CPPASTCompoundStatement getSetterBody() {
+ CPPASTCompoundStatement compound = new CPPASTCompoundStatement();
+ CPPASTExpressionStatement exprStmt = new CPPASTExpressionStatement();
+ CPPASTBinaryExpression binExpr = new CPPASTBinaryExpression();
+ IASTDeclarator innerDeclarator = fieldDeclaration.getDeclarators()[0];
+ while (innerDeclarator.getNestedDeclarator() != null) {
+ innerDeclarator = innerDeclarator.getNestedDeclarator();
+ }
+ IASTName fieldName = innerDeclarator.getName();
+ CPPASTName parameterName = getSetterParameterName();
+ if (Arrays.equals(fieldName.getSimpleID(), parameterName.getSimpleID())) {
+ CPPASTFieldReference fieldRef = new CPPASTFieldReference();
+ CPPASTLiteralExpression litExpr = new CPPASTLiteralExpression();
+ litExpr.setValue(Keywords.cTHIS);
+ fieldRef.setFieldOwner(litExpr);
+ fieldRef.setIsPointerDereference(true);
+ fieldRef.setFieldName(fieldName.copy(CopyStyle.withLocations));
+ binExpr.setOperand1(fieldRef);
+ } else {
+ CPPASTIdExpression idExpr = new CPPASTIdExpression(fieldName.copy(CopyStyle.withLocations));
+ binExpr.setOperand1(idExpr);
+ }
+ binExpr.setOperator(IASTBinaryExpression.op_assign);
+ CPPASTIdExpression idExpr = new CPPASTIdExpression(parameterName);
+ binExpr.setOperand2(idExpr);
+ exprStmt.setExpression(binExpr);
+ compound.addStatement(exprStmt);
+ return compound;
+ }
+
+ private CPPASTFunctionDeclarator getSetterDeclarator(ICPPASTQualifiedName qualifiedName) {
+ CPPASTName setterName = new CPPASTName();
+ setterName.setName(accessorName.toCharArray());
+ CPPASTFunctionDeclarator declarator = new CPPASTFunctionDeclarator();
+ if (qualifiedName != null) {
+ qualifiedName.addName(setterName);
+ declarator.setName(qualifiedName);
+ } else {
+ declarator.setName(setterName);
+ }
+ CPPASTParameterDeclaration parameterDeclaration = new CPPASTParameterDeclaration();
+ IASTDeclarator parameterDeclarator = fieldDeclaration.getDeclarators()[0].copy(CopyStyle.withLocations);
+ parameterDeclarator.setName(getSetterParameterName());
+ if (passByReference) {
+ parameterDeclarator.addPointerOperator(new CPPASTReferenceOperator(false));
+ }
+ parameterDeclaration.setDeclarator(parameterDeclarator);
+ parameterDeclaration.setDeclSpecifier(getParamOrReturnDeclSpecifier());
+ declarator.addParameterDeclaration(parameterDeclaration.copy(CopyStyle.withLocations));
+ return declarator;
+ }
+
+ private CPPASTName getSetterParameterName() {
+ String parameterName = GetterSetterNameGenerator.generateSetterParameterName(fieldName);
+ return new CPPASTName(parameterName.toCharArray());
+ }
+
+ private static CPPASTSimpleDeclSpecifier getVoidDeclSpec() {
+ CPPASTSimpleDeclSpecifier declSpecifier = new CPPASTSimpleDeclSpecifier();
+ declSpecifier.setType(IASTSimpleDeclSpecifier.t_void);
+ return declSpecifier;
+ }
+ }
+}
--- /dev/null
+package org.eclipse.cdt.internal.ui.refactoring.gettersandsetters;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
+import org.eclipse.cdt.core.dom.ast.IASTName;
+import org.eclipse.cdt.core.dom.ast.IASTNode;
+import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
+import org.eclipse.cdt.core.dom.ast.IArrayType;
+import org.eclipse.cdt.core.dom.ast.IBinding;
+import org.eclipse.cdt.core.dom.ast.IPointerType;
+import org.eclipse.cdt.core.dom.ast.IQualifierType;
+import org.eclipse.cdt.core.dom.ast.IType;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType;
+
+import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
+
+import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.AccessorDescriptor.AccessorKind;
+
+class FieldDescriptor {
+ private final IASTName fieldName;
+ private final IASTSimpleDeclaration fieldDeclaration;
+ private final AccessorDescriptor getter;
+ private final AccessorDescriptor setter;
+ private final AccessorDescriptor[] childNodes;
+ private final GetterSetterContext context;
+
+ FieldDescriptor(IASTSimpleDeclaration fieldDeclaration, GetterSetterContext context) {
+ this.fieldName = GetterSetterContext.getDeclarationName(fieldDeclaration);
+ this.fieldDeclaration = fieldDeclaration;
+ this.context = context;
+ Set<String> namesToAvoid = getNamesToAvoid();
+ String name = GetterSetterNameGenerator.generateGetterName(fieldName, namesToAvoid);
+ this.getter = new AccessorDescriptor(AccessorKind.GETTER, name, this);
+ name = GetterSetterNameGenerator.generateSetterName(fieldName, namesToAvoid);
+ if (!isAssignable(fieldDeclaration))
+ name = null;
+ this.setter = new AccessorDescriptor(AccessorKind.SETTER, name, this);
+
+ List<AccessorDescriptor> children = new ArrayList<AccessorDescriptor>(2);
+ if (getter.canBeGenerated()) {
+ children.add(getter);
+ }
+ if (setter.canBeGenerated()) {
+ children.add(setter);
+ }
+ childNodes = children.toArray(new AccessorDescriptor[children.size()]);
+ }
+
+ private Set<String> getNamesToAvoid() {
+ Set<String> namesToAvoid = new HashSet<String>();
+ // Add field names.
+ for (IASTSimpleDeclaration fieldDeclaration : context.existingFields) {
+ namesToAvoid.add(String.valueOf(GetterSetterContext.getDeclarationName(fieldDeclaration).getSimpleID()));
+ }
+ // Add constructor name.
+ if (!context.existingFields.isEmpty()) {
+ IASTNode node = context.existingFields.get(0).getParent();
+ while (!(node instanceof IASTCompositeTypeSpecifier)) {
+ node = node.getParent();
+ }
+ IASTCompositeTypeSpecifier comp = (IASTCompositeTypeSpecifier) node;
+ namesToAvoid.add(String.valueOf(comp.getName().getLastName().getSimpleID()));
+ }
+ return namesToAvoid;
+ }
+
+ private static boolean isAssignable(IASTSimpleDeclaration declaration) {
+ IASTName name = GetterSetterContext.getDeclarationName(declaration);
+ IBinding binding = name.resolveBinding();
+ if (!(binding instanceof ICPPField))
+ return false;
+ ICPPField field = (ICPPField) binding;
+ IType type = field.getType();
+ type = SemanticUtil.getNestedType(type, SemanticUtil.TDEF);
+ if (type instanceof IArrayType || type instanceof ICPPReferenceType)
+ return false;
+ if (type instanceof IPointerType && ((IPointerType) type).isConst())
+ return false;
+ if (type instanceof IQualifierType && ((IQualifierType) type).isConst())
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return fieldName.toString();
+ }
+
+ AccessorDescriptor[] getChildNodes() {
+ return childNodes;
+ }
+
+ boolean missingGetterOrSetter() {
+ return getter.canBeGenerated() || setter.canBeGenerated();
+ }
+
+ public GetterSetterContext getContext() {
+ return context;
+ }
+
+ public IASTName getFieldName() {
+ return fieldName;
+ }
+
+ public IASTSimpleDeclaration getFieldDeclaration() {
+ return fieldDeclaration;
+ }
+
+ public AccessorDescriptor getGetter() {
+ return getter;
+ }
+
+ public AccessorDescriptor getSetter() {
+ return setter;
+ }
+}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Institute for Software, HSR Hochschule fuer Technik
- * Rapperswil, University of applied sciences and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Institute for Software - initial API and implementation
- * Sergey Prigogin (Google)
- *******************************************************************************/
-package org.eclipse.cdt.internal.ui.refactoring.gettersandsetters;
-
-import java.util.Arrays;
-
-import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
-import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
-import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
-import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
-import org.eclipse.cdt.core.dom.ast.IASTName;
-import org.eclipse.cdt.core.dom.ast.IASTNode.CopyStyle;
-import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
-import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
-import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
-import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
-import org.eclipse.cdt.core.parser.Keywords;
-
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFieldReference;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTLiteralExpression;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTParameterDeclaration;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTReturnStatement;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration;
-
-public class FunctionFactory {
-
- public static IASTFunctionDefinition createGetterDefinition(IASTName fieldName,
- IASTSimpleDeclaration fieldDeclaration, ICPPASTQualifiedName name) {
- IASTFunctionDefinition getter = new CPPASTFunctionDefinition();
-
- getter.setDeclSpecifier(fieldDeclaration.getDeclSpecifier().copy(CopyStyle.withLocations));
- IASTDeclarator getterDeclarator = getGetterDeclarator(fieldName, fieldDeclaration, name);
- // IASTFunctionDefinition. expects the outermost IASTFunctionDeclarator in declarator hierarchy
- while (!(getterDeclarator instanceof IASTFunctionDeclarator)) {
- getterDeclarator = getterDeclarator.getNestedDeclarator();
- }
- getter.setDeclarator((IASTFunctionDeclarator) getterDeclarator);
- getter.setBody(getGetterBody(fieldName));
- return getter;
- }
-
- private static CPPASTCompoundStatement getGetterBody(IASTName fieldName) {
- CPPASTCompoundStatement compound = new CPPASTCompoundStatement();
- CPPASTReturnStatement returnStatement = new CPPASTReturnStatement();
- CPPASTIdExpression idExpr = new CPPASTIdExpression();
- CPPASTName returnVal = new CPPASTName();
- returnVal.setName(fieldName.toCharArray());
- idExpr.setName(returnVal);
- returnStatement.setReturnValue(idExpr);
- compound.addStatement(returnStatement);
- return compound;
- }
-
- private static IASTDeclarator getGetterDeclarator(IASTName fieldName,
- IASTSimpleDeclaration fieldDeclaration, ICPPASTQualifiedName name) {
- CPPASTName getterName = new CPPASTName();
- getterName.setName(GetterSetterNameGenerator.generateGetterName(fieldName).toCharArray());
-
- // copy declarator hierarchy
- IASTDeclarator topDeclarator = fieldDeclaration.getDeclarators()[0].copy(CopyStyle.withLocations);
-
- // find the innermost declarator in hierarchy
- IASTDeclarator innermost = topDeclarator;
- while (innermost.getNestedDeclarator() != null) {
- innermost = innermost.getNestedDeclarator();
- }
-
- // create a new innermost function declarator basing on the field declarator
- CPPASTFunctionDeclarator functionDeclarator = new CPPASTFunctionDeclarator();
- functionDeclarator.setConst(true);
- if (name != null) {
- name.addName(getterName);
- functionDeclarator.setName(name);
- } else {
- functionDeclarator.setName(getterName);
- }
- for (IASTPointerOperator pointer : innermost.getPointerOperators()){
- functionDeclarator.addPointerOperator(pointer.copy(CopyStyle.withLocations));
- }
-
- // replace innermost with functionDeclarator and return the whole declarator tree
- if (innermost == topDeclarator) {
- // no tree
- return functionDeclarator;
- } else {
- IASTDeclarator parent = (IASTDeclarator) innermost.getParent();
- parent.setNestedDeclarator(functionDeclarator);
- return topDeclarator;
- }
- }
-
- public static IASTFunctionDefinition createSetterDefinition(IASTName fieldName,
- IASTSimpleDeclaration fieldDeclaration, ICPPASTQualifiedName name) {
- IASTFunctionDefinition setter = new CPPASTFunctionDefinition();
- setter.setDeclSpecifier(getVoidDeclSpec());
- setter.setDeclarator(getSetterDeclarator(fieldName, fieldDeclaration, name));
- setter.setBody(getSetterBody(fieldDeclaration));
- return setter;
- }
-
- private static CPPASTCompoundStatement getSetterBody(IASTSimpleDeclaration fieldDeclaration) {
- CPPASTCompoundStatement compound = new CPPASTCompoundStatement();
- CPPASTExpressionStatement exprStmt = new CPPASTExpressionStatement();
- CPPASTBinaryExpression binExpr = new CPPASTBinaryExpression();
- IASTDeclarator innerDeclarator = fieldDeclaration.getDeclarators()[0];
- while (innerDeclarator.getNestedDeclarator() != null) {
- innerDeclarator = innerDeclarator.getNestedDeclarator();
- }
- IASTName fieldName = innerDeclarator.getName();
- CPPASTName parameterName = getSetterParameterName(fieldName);
- if (Arrays.equals(fieldName.getSimpleID(), parameterName.getSimpleID())) {
- CPPASTFieldReference fieldRef = new CPPASTFieldReference();
- CPPASTLiteralExpression litExpr = new CPPASTLiteralExpression();
- litExpr.setValue(Keywords.cTHIS);
- fieldRef.setFieldOwner(litExpr);
- fieldRef.setIsPointerDereference(true);
- fieldRef.setFieldName(fieldName.copy(CopyStyle.withLocations));
- binExpr.setOperand1(fieldRef);
- } else {
- CPPASTIdExpression idExpr = new CPPASTIdExpression(fieldName.copy(CopyStyle.withLocations));
- binExpr.setOperand1(idExpr);
- }
- binExpr.setOperator(IASTBinaryExpression.op_assign);
- CPPASTIdExpression idExpr = new CPPASTIdExpression(parameterName);
- binExpr.setOperand2(idExpr);
- exprStmt.setExpression(binExpr);
- compound.addStatement(exprStmt);
- return compound;
- }
-
- private static CPPASTFunctionDeclarator getSetterDeclarator(IASTName fieldName,
- IASTSimpleDeclaration fieldDeclaration, ICPPASTQualifiedName name) {
- CPPASTName setterName = new CPPASTName();
- setterName.setName(GetterSetterNameGenerator.generateSetterName(fieldName).toCharArray());
- CPPASTFunctionDeclarator declarator = new CPPASTFunctionDeclarator();
- if (name != null) {
- name.addName(setterName);
- declarator.setName(name);
- } else {
- declarator.setName(setterName);
- }
- CPPASTParameterDeclaration parameterDeclaration = new CPPASTParameterDeclaration();
- IASTDeclarator parameterDeclarator = fieldDeclaration.getDeclarators()[0].copy(CopyStyle.withLocations);
- parameterDeclarator.setName(getSetterParameterName(fieldName));
- parameterDeclaration.setDeclarator(parameterDeclarator);
- parameterDeclaration.setDeclSpecifier(fieldDeclaration.getDeclSpecifier().copy(
- CopyStyle.withLocations));
- declarator.addParameterDeclaration(parameterDeclaration.copy(CopyStyle.withLocations));
- return declarator;
- }
-
- private static CPPASTName getSetterParameterName(IASTName fieldName) {
- String parameterName = GetterSetterNameGenerator.generateSetterParameterName(fieldName);
- return new CPPASTName(parameterName.toCharArray());
- }
-
- private static CPPASTSimpleDeclSpecifier getVoidDeclSpec() {
- CPPASTSimpleDeclSpecifier declSpecifier = new CPPASTSimpleDeclSpecifier();
- declSpecifier.setType(IASTSimpleDeclSpecifier.t_void);
- return declSpecifier;
- }
-
- public static IASTSimpleDeclaration createGetterDeclaration(IASTName fieldName,
- IASTSimpleDeclaration fieldDeclaration) {
- IASTSimpleDeclaration getter = new CPPASTSimpleDeclaration();
- getter.setDeclSpecifier(fieldDeclaration.getDeclSpecifier().copy(CopyStyle.withLocations));
- getter.addDeclarator(getGetterDeclarator(fieldName, fieldDeclaration, null));
- return getter;
- }
-
- public static IASTSimpleDeclaration createSetterDeclaration(IASTName fieldName,
- IASTSimpleDeclaration fieldDeclaration) {
- IASTSimpleDeclaration setter = new CPPASTSimpleDeclaration();
- setter.setDeclSpecifier(getVoidDeclSpec());
- setter.addDeclarator(getSetterDeclarator(fieldName, fieldDeclaration, null));
- return setter;
- }
-}
*******************************************************************************/
package org.eclipse.cdt.internal.ui.refactoring.gettersandsetters;
-import java.util.Set;
-import java.util.SortedSet;
-
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.internal.ui.preferences.NameStylePreferencePage;
-import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterSetterContext.FieldWrapper;
-import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterSetterInsertEditProvider.AccessorKind;
+import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.AccessorDescriptor.AccessorKind;
public class GenerateGettersAndSettersInputPage extends UserInputWizardPage implements IPreferenceChangeListener {
private GetterSetterContext context;
private GetterSetterLabelProvider labelProvider;
public GenerateGettersAndSettersInputPage(GetterSetterContext context) {
- super(Messages.GettersAndSetters_Name);
+ super(Messages.GenerateGettersAndSettersInputPage_Name);
this.context = context;
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(CUIPlugin.PLUGIN_ID);
// We are listening for changes in the Name Style preferences
}
public void createControl(Composite parent) {
- Composite comp = new Composite(parent, SWT.NONE);
-
- setTitle(Messages.GettersAndSetters_Name);
- setMessage(Messages.GenerateGettersAndSettersInputPage_header);
+ setTitle(Messages.GenerateGettersAndSettersInputPage_Name);
+ setMessage(Messages.GenerateGettersAndSettersInputPage_Header);
+ Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout(2, false));
createTree(comp);
GridData gd = new GridData(GridData.FILL_BOTH);
variableSelectionView.getTree().setLayoutData(gd);
- Composite btComp = createButtonComposite(comp);
+ Composite buttonContainer = createButtonComposite(comp);
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
- btComp.setLayoutData(gd);
-
- final Button placeImplemetation = new Button(comp, SWT.CHECK);
- placeImplemetation.setText(Messages.GenerateGettersAndSettersInputPage_PlaceImplHeader);
+ buttonContainer.setLayoutData(gd);
+
+ final Button definitionSeparate = new Button(comp, SWT.CHECK);
+ definitionSeparate.setText(Messages.GenerateGettersAndSettersInputPage_SeparateDefinition);
gd = new GridData();
gd.horizontalSpan = 2;
gd.heightHint = 40;
- placeImplemetation.setLayoutData(gd);
- placeImplemetation.setSelection(context.isImplementationInHeader());
- placeImplemetation.addSelectionListener(new SelectionAdapter() {
+ definitionSeparate.setLayoutData(gd);
+ definitionSeparate.setSelection(context.isDefinitionSeparate());
+ definitionSeparate.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- context.setImplementationInHeader(placeImplemetation.getSelection());
+ context.setDefinitionSeparate(definitionSeparate.getSelection());
}
});
@Override
public void widgetSelected(SelectionEvent e) {
String id = NameStylePreferencePage.PREF_ID;
- PreferencesUtil.createPreferenceDialogOn(getShell(), id, new String [] { id }, null).open();
+ PreferencesUtil.createPreferenceDialogOn(getShell(), id, new String[] { id }, null).open();
}
});
link.setToolTipText(Messages.GenerateGettersAndSettersInputPage_LinkTooltip);
Button selectAll = new Button(btComp, SWT.PUSH);
selectAll.setText(Messages.GenerateGettersAndSettersInputPage_SelectAll);
- selectAll.addSelectionListener(new SelectionAdapter(){
+ selectAll.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Object[] items = context.getElements(null);
- SortedSet<GetterSetterInsertEditProvider> checkedFunctions = context.selectedFunctions;
for (Object treeItem : items) {
variableSelectionView.setChecked(treeItem, true);
- Object[] childs = context.getChildren(treeItem);
- for(Object currentElement : childs){
- if (currentElement instanceof GetterSetterInsertEditProvider) {
- GetterSetterInsertEditProvider editProvider = (GetterSetterInsertEditProvider) currentElement;
- checkedFunctions.add(editProvider);
- }
- }
}
+ updateSelectedFunctions();
}
});
deselectAll.addSelectionListener(new SelectionAdapter(){
@Override
public void widgetSelected(SelectionEvent e) {
- Object[] items = context.getElements(null);
- for (Object treeItem : items) {
+ for (Object treeItem : context.getElements(null)) {
variableSelectionView.setChecked(treeItem, false);
}
- context.selectedFunctions.clear();
+ updateSelectedFunctions();
}
});
selectGetter.addSelectionListener(new SelectionAdapter(){
@Override
public void widgetSelected(SelectionEvent e) {
- selectMethods(AccessorKind.GETTER);
+ selectAccessors(AccessorKind.GETTER);
}
});
selectSetter.addSelectionListener(new SelectionAdapter(){
@Override
public void widgetSelected(SelectionEvent e) {
- selectMethods(AccessorKind.SETTER);
+ selectAccessors(AccessorKind.SETTER);
}
});
return btComp;
}
- private void selectMethods(AccessorKind type) {
- Object[] items = context.getElements(null);
- Set<GetterSetterInsertEditProvider> checked = context.selectedFunctions;
- for (Object treeItem : items) {
- if (treeItem instanceof FieldWrapper) {
- FieldWrapper field = (FieldWrapper) treeItem;
- Object[] funtions = context.getChildren(field);
- for (Object funct : funtions) {
- if (funct instanceof GetterSetterInsertEditProvider) {
- GetterSetterInsertEditProvider getSet = (GetterSetterInsertEditProvider) funct;
- if(getSet.getType() == type) {
- checked.add(getSet);
- variableSelectionView.setChecked(getSet, true);
+ private void selectAccessors(AccessorKind kind) {
+ for (Object treeItem : context.getElements(null)) {
+ if (treeItem instanceof FieldDescriptor) {
+ FieldDescriptor field = (FieldDescriptor) treeItem;
+ Object[] children = context.getChildren(field);
+ for (Object child : children) {
+ if (child instanceof AccessorDescriptor) {
+ AccessorDescriptor accessor = (AccessorDescriptor) child;
+ if (accessor.getKind() == kind) {
+ variableSelectionView.setChecked(accessor, true);
}
}
}
}
}
+ updateSelectedFunctions();
}
private void createTree(Composite comp) {
variableSelectionView.setLabelProvider(labelProvider);
variableSelectionView.setAutoExpandLevel(3);
- variableSelectionView.setInput(""); //$NON-NLS-1$
+ variableSelectionView.setInput(context);
if (context.selectedName != null) {
String rawSignature = context.selectedName.getRawSignature();
for (Object obj : variableSelectionView.getVisibleExpandedElements()) {
- if (obj instanceof FieldWrapper) {
+ if (obj instanceof FieldDescriptor) {
if (obj.toString().contains(rawSignature)) {
variableSelectionView.setSubtreeChecked(obj, true);
}
}
}
}
- Set<GetterSetterInsertEditProvider> checkedFunctions = context.selectedFunctions;
- for (Object currentElement : variableSelectionView.getCheckedElements()) {
- if (currentElement instanceof GetterSetterInsertEditProvider) {
- GetterSetterInsertEditProvider editProvider = (GetterSetterInsertEditProvider) currentElement;
- checkedFunctions.add(editProvider);
- }
- }
- variableSelectionView.addCheckStateListener(new ICheckStateListener() {
+ updateSelectedFunctions();
+
+ variableSelectionView.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
- Set<GetterSetterInsertEditProvider> checkedFunctions = context.selectedFunctions;
- for (Object currentElement : variableSelectionView.getCheckedElements()) {
- if (currentElement instanceof GetterSetterInsertEditProvider) {
- GetterSetterInsertEditProvider editProvider = (GetterSetterInsertEditProvider) currentElement;
- checkedFunctions.add(editProvider);
- }
- }
+ updateSelectedFunctions();
}
});
}
+ private void updateSelectedFunctions() {
+ context.selectedAccessors.clear();
+ for (Object element : variableSelectionView.getCheckedElements()) {
+ if (element instanceof AccessorDescriptor) {
+ context.selectedAccessors.add((AccessorDescriptor) element);
+ }
+ }
+ setPageComplete(!context.selectedAccessors.isEmpty());
+ }
+
public void preferenceChange(PreferenceChangeEvent event) {
if (variableSelectionView.getTree().isDisposed()) {
return;
}
if (GetterSetterNameGenerator.getGenerateGetterSettersPreferenceKeys().contains(event.getKey())) {
- context.refresh();
+ context.recreateFieldDescriptors();
variableSelectionView.refresh();
+ variableSelectionView.setInput(context); // Set input to trigger node expansion.
+ for (Object element : context.selectedAccessors) {
+ variableSelectionView.setChecked(element, true);
+ }
}
}
+
+ @Override
+ public void dispose() {
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(CUIPlugin.PLUGIN_ID);
+ node.removePreferenceChangeListener(this);
+ super.dispose();
+ }
}
public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
CheckConditionsContext checkContext) throws CoreException, OperationCanceledException {
RefactoringStatus result = new RefactoringStatus();
- if (!context.isImplementationInHeader()) {
+ if (context.isDefinitionSeparate()) {
findDefinitionInsertLocation(pm);
- if (definitionInsertLocation == null || tu.equals(definitionInsertLocation.getTranslationUnit())) {
+ if (definitionInsertLocation == null ||
+ definitionInsertLocation.getTranslationUnit() == null) {
result.addInfo(Messages.GenerateGettersAndSettersRefactoring_NoImplFile);
}
}
if (compositeTypeSpecifier != null) {
findDeclarations(compositeTypeSpecifier);
} else {
- initStatus.addFatalError(Messages.GenerateGettersAndSettersRefactoring_NoCassDefFound);
+ initStatus.addFatalError(Messages.GenerateGettersAndSettersRefactoring_NoClassDefFound);
}
}
throws CoreException, OperationCanceledException {
List<IASTNode> getterAndSetters = new ArrayList<IASTNode>();
List<IASTFunctionDefinition> definitions = new ArrayList<IASTFunctionDefinition>();
- for (GetterSetterInsertEditProvider currentProvider : context.selectedFunctions) {
- if (context.isImplementationInHeader()) {
- getterAndSetters.add(currentProvider.getFunctionDefinition(false));
+ for (AccessorDescriptor accessor : context.selectedAccessors) {
+ if (context.isDefinitionSeparate()) {
+ getterAndSetters.add(accessor.getAccessorDeclaration());
+ IASTFunctionDefinition functionDefinition = accessor.getAccessorDefinition(true);
+ // Standalone definitions in a header file have to be declared inline.
+ if (definitionInsertLocation.getTranslationUnit().isHeaderUnit()) {
+ functionDefinition.getDeclSpecifier().setInline(true);
+ }
+ definitions.add(functionDefinition);
} else {
- getterAndSetters.add(currentProvider.getFunctionDeclaration());
- definitions.add(currentProvider.getFunctionDefinition(true));
+ getterAndSetters.add(accessor.getAccessorDefinition(false));
}
}
- if (!context.isImplementationInHeader()) {
+ if (context.isDefinitionSeparate()) {
addDefinition(collector, definitions, pm);
}
ICPPASTCompositeTypeSpecifier classDefinition =
}
IASTSimpleDeclaration decl = context.existingFields.get(0);
- MethodDefinitionInsertLocationFinder methodDefinitionInsertLocationFinder = new MethodDefinitionInsertLocationFinder();
- InsertLocation location = methodDefinitionInsertLocationFinder.find(
- tu, decl.getFileLocation(), decl.getParent(), astCache, pm);
+ MethodDefinitionInsertLocationFinder locationFinder = new MethodDefinitionInsertLocationFinder();
+ InsertLocation location = locationFinder.find(tu, decl.getFileLocation(), decl.getParent(),
+ astCache, pm);
if (location.getFile() == null || NodeHelper.isContainedInTemplateDeclaration(decl)) {
location.setNodeToInsertAfter(NodeHelper.findTopLevelParent(decl), tu);
package org.eclipse.cdt.internal.ui.refactoring.gettersandsetters;
import java.util.ArrayList;
+import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
-import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterSetterInsertEditProvider.AccessorKind;
+import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.AccessorDescriptor.AccessorKind;
public class GetterSetterContext implements ITreeContentProvider {
- public ArrayList<IASTSimpleDeclaration> existingFields = new ArrayList<IASTSimpleDeclaration>();
- public ArrayList<IASTFunctionDefinition> existingFunctionDefinitions = new ArrayList<IASTFunctionDefinition>();
- public ArrayList<IASTSimpleDeclaration> existingFunctionDeclarations = new ArrayList<IASTSimpleDeclaration>();
- public SortedSet<GetterSetterInsertEditProvider> selectedFunctions = new TreeSet<GetterSetterInsertEditProvider>();
- public IASTName selectedName;
- private ArrayList<FieldWrapper> wrappedFields;
- private boolean implementationInHeader = false;
+ final List<IASTSimpleDeclaration> existingFields = new ArrayList<IASTSimpleDeclaration>();
+ final List<IASTFunctionDefinition> existingFunctionDefinitions = new ArrayList<IASTFunctionDefinition>();
+ final List<IASTSimpleDeclaration> existingFunctionDeclarations = new ArrayList<IASTSimpleDeclaration>();
+ final SortedSet<AccessorDescriptor> selectedAccessors = new TreeSet<AccessorDescriptor>();
+ IASTName selectedName;
+ private List<FieldDescriptor> fieldDescriptors;
+ private boolean definitionSeparate;
+ private static final Object[] NO_CHILDREN = {};
public Object[] getChildren(Object parentElement) {
- ArrayList<GetterSetterInsertEditProvider> children = new ArrayList<GetterSetterInsertEditProvider>();
- if (parentElement instanceof FieldWrapper) {
- FieldWrapper wrapper = (FieldWrapper) parentElement;
-
- if (wrapper.getChildNodes().isEmpty()) {
- if (!wrapper.getter.exists()) {
- wrapper.childNodes.add(createGetterInserter(wrapper.field));
- }
- if (!wrapper.setter.exists() && !wrapper.field.getDeclSpecifier().isConst()) {
- wrapper.childNodes.add(createSetterInserter(wrapper.field));
- }
- }
- children = wrapper.getChildNodes();
- }
- return children.toArray();
- }
-
- public GetterSetterInsertEditProvider createGetterInserter(IASTSimpleDeclaration simpleDeclaration) {
- IASTName fieldName = getFieldDeclarationName(simpleDeclaration);
- return new GetterSetterInsertEditProvider(fieldName, simpleDeclaration, AccessorKind.GETTER);
- }
-
- public GetterSetterInsertEditProvider createSetterInserter(IASTSimpleDeclaration simpleDeclaration) {
- IASTName fieldName = getFieldDeclarationName(simpleDeclaration);
- return new GetterSetterInsertEditProvider(fieldName, simpleDeclaration, AccessorKind.SETTER);
+ if (!(parentElement instanceof FieldDescriptor))
+ return NO_CHILDREN;
+ return ((FieldDescriptor) parentElement).getChildNodes();
}
public Object getParent(Object element) {
}
public boolean hasChildren(Object element) {
- if (element instanceof FieldWrapper) {
- FieldWrapper wrapper = (FieldWrapper) element;
- return wrapper.missingGetterOrSetter();
+ if (element instanceof FieldDescriptor) {
+ FieldDescriptor descriptor = (FieldDescriptor) element;
+ return descriptor.missingGetterOrSetter();
}
return false;
}
public Object[] getElements(Object inputElement) {
- return getWrappedFields().toArray();
+ return getFieldDescriptors().toArray();
}
- public void refresh() {
- // We only recreate the function declarations instead of recreating GetterSetterInsertEditProviders.
- // That way, selectedFunctions is still valid. Also, the objects inside the TreeViewer are still the same
- // which is convenient because that way we don't need to save then restore the collapsed/expanded+checked/unchecked state of the TreeViewer.
- for (FieldWrapper wrapper : wrappedFields) {
- for (GetterSetterInsertEditProvider provider : wrapper.childNodes) {
- provider.createFunctionDeclaration();
- }
- }
- }
-
public void dispose() {
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
-
- public boolean isImplementationInHeader() {
- return implementationInHeader;
- }
- public void setImplementationInHeader(boolean implementationInHeader) {
- this.implementationInHeader = implementationInHeader;
+ public void recreateFieldDescriptors() {
+ // Delete field descriptors so that they are recreated by the next getFieldDescriptors call.
+ fieldDescriptors = null;
+ SortedSet<AccessorDescriptor> oldSelected = new TreeSet<AccessorDescriptor>(selectedAccessors);
+ selectedAccessors.clear();
+ for (FieldDescriptor descriptor : getFieldDescriptors()) {
+ for (AccessorDescriptor accessor : descriptor.getChildNodes()) {
+ if (oldSelected.contains(accessor)) {
+ selectedAccessors.add(accessor);
+ }
+ }
+ }
}
- private ArrayList<FieldWrapper> getWrappedFields() {
- if (wrappedFields == null) {
- wrappedFields = new ArrayList<FieldWrapper>();
- for (IASTSimpleDeclaration currentField : existingFields) {
- FieldWrapper wrapper = new FieldWrapper();
- wrapper.field = currentField;
- wrapper.getter = getGetterForField(currentField);
- wrapper.setter = getSetterForField(currentField);
- if (wrapper.missingGetterOrSetter()) {
- wrappedFields.add(wrapper);
+ public void selectAccessorForField(String name, AccessorKind kind) {
+ for (FieldDescriptor descriptor : getFieldDescriptors()) {
+ if (name.equals(String.valueOf(descriptor.getFieldName().getSimpleID()))) {
+ for (Object child : descriptor.getChildNodes()) {
+ AccessorDescriptor accessor = (AccessorDescriptor) child;
+ if (accessor.getKind() == kind) {
+ selectedAccessors.add(accessor);
+ break;
+ }
}
}
}
- return wrappedFields;
}
- private FunctionWrapper getGetterForField(IASTSimpleDeclaration currentField) {
- FunctionWrapper wrapper = new FunctionWrapper();
- String name = GetterSetterNameGenerator.generateGetterName(getFieldDeclarationName(currentField));
- setFunctionToWrapper(wrapper, name);
- return wrapper;
+ public boolean isDefinitionSeparate() {
+ return definitionSeparate;
}
- private IASTName getFieldDeclarationName(IASTSimpleDeclaration fieldDeclaration) {
- IASTDeclarator declarator = fieldDeclaration.getDeclarators()[0];
- while (declarator.getNestedDeclarator() != null) {
- declarator = declarator.getNestedDeclarator();
- }
- return declarator.getName();
- }
-
- private FunctionWrapper getSetterForField(IASTSimpleDeclaration currentField) {
- FunctionWrapper wrapper = new FunctionWrapper();
- String name = GetterSetterNameGenerator.generateSetterName(getFieldDeclarationName(currentField));
- setFunctionToWrapper(wrapper, name);
- return wrapper;
+ public void setDefinitionSeparate(boolean definitionSeparate) {
+ this.definitionSeparate = definitionSeparate;
}
- private void setFunctionToWrapper(FunctionWrapper wrapper, String getterName) {
- for (IASTFunctionDefinition currentDefinition : existingFunctionDefinitions) {
- if (currentDefinition.getDeclarator().getName().toString().endsWith(getterName)) {
- wrapper.functionDefinition = currentDefinition;
- }
- }
-
- for (IASTSimpleDeclaration currentDeclaration : existingFunctionDeclarations) {
- if (getFieldDeclarationName(currentDeclaration).toString().endsWith(getterName)) {
- wrapper.functionDeclaration = currentDeclaration;
+ private List<FieldDescriptor> getFieldDescriptors() {
+ if (fieldDescriptors == null) {
+ fieldDescriptors = new ArrayList<FieldDescriptor>();
+ for (IASTSimpleDeclaration field : existingFields) {
+ FieldDescriptor descriptor = new FieldDescriptor(field, this);
+ if (descriptor.missingGetterOrSetter()) {
+ fieldDescriptors.add(descriptor);
+ }
}
}
+ return fieldDescriptors;
}
- protected class FieldWrapper {
- protected IASTSimpleDeclaration field;
- protected FunctionWrapper getter;
- protected FunctionWrapper setter;
- protected ArrayList<GetterSetterInsertEditProvider> childNodes = new ArrayList<GetterSetterInsertEditProvider>(2);
-
- @Override
- public String toString() {
- IASTDeclarator declarator = field.getDeclarators()[0];
- while (declarator.getNestedDeclarator() != null) {
- declarator = declarator.getNestedDeclarator();
- }
- return declarator.getName().toString();
- }
-
- public ArrayList<GetterSetterInsertEditProvider> getChildNodes() {
- return childNodes;
- }
-
- public boolean missingGetterOrSetter() {
- return !getter.exists() || !setter.exists();
- }
- }
-
- protected class FunctionWrapper {
- protected IASTSimpleDeclaration functionDeclaration;
- protected IASTFunctionDefinition functionDefinition;
-
- public boolean exists() {
- return functionDeclaration != null || functionDefinition != null;
+ static IASTName getDeclarationName(IASTSimpleDeclaration declaration) {
+ IASTDeclarator declarator = declaration.getDeclarators()[0];
+ while (declarator.getNestedDeclarator() != null) {
+ declarator = declarator.getNestedDeclarator();
}
+ return declarator.getName();
}
}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Institute for Software, HSR Hochschule fuer Technik
- * Rapperswil, University of applied sciences and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Institute for Software - initial API and implementation
- * Sergey Prigogin (Google)
- *******************************************************************************/
-package org.eclipse.cdt.internal.ui.refactoring.gettersandsetters;
-
-import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
-import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
-import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
-import org.eclipse.cdt.core.dom.ast.IASTName;
-import org.eclipse.cdt.core.dom.ast.IASTNode;
-import org.eclipse.cdt.core.dom.ast.IASTNode.CopyStyle;
-import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
-import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
-
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTQualifiedName;
-
-public class GetterSetterInsertEditProvider implements Comparable<GetterSetterInsertEditProvider> {
- public enum AccessorKind {
- GETTER,
- SETTER;
- }
-
- private IASTSimpleDeclaration functionDeclaration;
- private AccessorKind kind;
- private IASTName fieldName;
- private IASTSimpleDeclaration fieldDeclaration;
-
- public GetterSetterInsertEditProvider(IASTName fieldName, IASTSimpleDeclaration fieldDeclaration,
- AccessorKind kind) {
- this.kind = kind;
- this.fieldName = fieldName;
- this.fieldDeclaration = fieldDeclaration;
-
- createFunctionDeclaration();
- }
-
- public void createFunctionDeclaration() {
- switch (this.kind) {
- case GETTER:
- this.functionDeclaration = FunctionFactory.createGetterDeclaration(fieldName, fieldDeclaration);
- break;
- case SETTER:
- this.functionDeclaration = FunctionFactory.createSetterDeclaration(fieldName, fieldDeclaration);
- break;
- }
- }
-
- @Override
- public String toString() {
- IASTDeclarator declarator = functionDeclaration.getDeclarators()[0];
- while (declarator.getNestedDeclarator() != null) {
- declarator = declarator.getNestedDeclarator();
- }
- return declarator.getName().toString();
- }
-
- public IASTFunctionDefinition getFunctionDefinition(boolean qualifedName) {
- IASTFunctionDefinition definition = null;
- ICPPASTQualifiedName qname;
- if (qualifedName) {
- qname = getClassname();
- } else {
- qname = null;
- }
-
- switch (kind) {
- case GETTER:
- definition = FunctionFactory.createGetterDefinition(fieldName, fieldDeclaration, qname);
- break;
- case SETTER:
- definition = FunctionFactory.createSetterDefinition(fieldName, fieldDeclaration, qname);
- break;
- }
- return definition;
- }
-
- private ICPPASTQualifiedName getClassname() {
- IASTNode n = fieldDeclaration.getParent();
- while (!(n instanceof IASTCompositeTypeSpecifier)) {
- n = n.getParent();
- }
- IASTCompositeTypeSpecifier comp = (IASTCompositeTypeSpecifier) n;
-
- CPPASTQualifiedName qname = new CPPASTQualifiedName();
- qname.addName(comp.getName().copy(CopyStyle.withLocations));
- return qname;
- }
-
- public IASTSimpleDeclaration getFunctionDeclaration() {
- return functionDeclaration;
- }
-
- public AccessorKind getType() {
- return kind;
- }
-
- public int compareTo(GetterSetterInsertEditProvider o) {
- return toString().compareTo(o.toString());
- }
-}
* @author Emanuel Graf IFS
*/
public class GetterSetterLabelProvider extends LabelProvider {
-
@Override
public Image getImage(Object element) {
- if (element instanceof GetterSetterInsertEditProvider) {
+ if (element instanceof AccessorDescriptor) {
return CElementImageProvider.getMethodImageDescriptor(ASTAccessVisibility.PUBLIC).createImage();
}
return null;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IPreferencesService;
-
+import org.eclipse.cdt.core.CConventions;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBasicType;
import org.eclipse.cdt.core.dom.ast.IType;
+import org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.PreferenceConstants;
import org.eclipse.cdt.internal.ui.util.NameComposer;
public class GetterSetterNameGenerator {
-
- // Do not instantiate.
- private GetterSetterNameGenerator() {
- }
-
private static Set<String> generateGetterSettersPreferenceKeys = new HashSet<String>();
static {
generateGetterSettersPreferenceKeys.add(PreferenceConstants.NAME_STYLE_GETTER_CAPITALIZATION);
generateGetterSettersPreferenceKeys.add(PreferenceConstants.NAME_STYLE_VARIABLE_SUFFIX);
}
+ // Do not instantiate.
+ private GetterSetterNameGenerator() {
+ }
+
public static Set<String> getGenerateGetterSettersPreferenceKeys() {
return generateGetterSettersPreferenceKeys;
}
-
- public static String generateGetterName(IASTName fieldName) {
+
+ /**
+ * Generates getter name for a given field name.
+ *
+ * @param fieldName the name of the field
+ * @param namesToAvoid the set of names to avoid
+ * @return the generated getter name, or <code>null</code> if a valid name could not be
+ * generated.
+ */
+ public static String generateGetterName(IASTName fieldName, Set<String> namesToAvoid) {
IPreferencesService preferences = Platform.getPreferencesService();
int capitalization = preferences.getInt(CUIPlugin.PLUGIN_ID,
PreferenceConstants.NAME_STYLE_GETTER_CAPITALIZATION,
PreferenceConstants.NAME_STYLE_CAPITALIZATION_CAMEL_CASE, null);
String wordDelimiter = preferences.getString(CUIPlugin.PLUGIN_ID,
PreferenceConstants.NAME_STYLE_GETTER_WORD_DELIMITER, "", null); //$NON-NLS-1$
- String prefix = isBooleanDecaratorName(fieldName) ?
+ String prefix = isBooleanDeclaratorName(fieldName) ?
preferences.getString(CUIPlugin.PLUGIN_ID,
PreferenceConstants.NAME_STYLE_GETTER_PREFIX_FOR_BOOLEAN, "is", null) : //$NON-NLS-1$
preferences.getString(CUIPlugin.PLUGIN_ID,
PreferenceConstants.NAME_STYLE_GETTER_SUFFIX, "", null); //$NON-NLS-1$
NameComposer composer = new NameComposer(capitalization, wordDelimiter, prefix, suffix);
String name = NameComposer.trimFieldName(fieldName.toString());
- return composer.compose(name);
+ name = composer.compose(name);
+ return adjustName(name, namesToAvoid);
}
- private static boolean isBooleanDecaratorName(IASTName name) {
+ private static boolean isBooleanDeclaratorName(IASTName name) {
if (IASTDeclarator.DECLARATOR_NAME.equals(name.getPropertyInParent())) {
IASTDeclarator declarator = (IASTDeclarator) name.getParent();
IType type = CPPVisitor.createType(declarator);
return false;
}
- public static String generateSetterName(IASTName fieldName) {
+ /**
+ * Generates setter name for a given field name.
+ *
+ * @param fieldName the name of the field
+ * @param namesToAvoid the set of names to avoid
+ * @return the generated setter name, or <code>null</code> if a valid name could not be
+ * generated.
+ */
+ public static String generateSetterName(IASTName fieldName, Set<String> namesToAvoid) {
IPreferencesService preferences = Platform.getPreferencesService();
int capitalization = preferences.getInt(CUIPlugin.PLUGIN_ID,
PreferenceConstants.NAME_STYLE_SETTER_CAPITALIZATION,
PreferenceConstants.NAME_STYLE_SETTER_SUFFIX, "", null); //$NON-NLS-1$
NameComposer composer = new NameComposer(capitalization, wordDelimiter, prefix, suffix);
String name = NameComposer.trimFieldName(fieldName.toString());
- return composer.compose(name);
+ name = composer.compose(name);
+ return adjustName(name, namesToAvoid);
}
- public static String generateSetterParameterName(IASTName fieldName) {
+ public static String generateSetterParameterName(IASTName fieldName){
IPreferencesService preferences = Platform.getPreferencesService();
int capitalization = preferences.getInt(CUIPlugin.PLUGIN_ID,
PreferenceConstants.NAME_STYLE_VARIABLE_CAPITALIZATION,
PreferenceConstants.NAME_STYLE_VARIABLE_SUFFIX, "", null); //$NON-NLS-1$
NameComposer composer = new NameComposer(capitalization, wordDelimiter, prefix, suffix);
String name = NameComposer.trimFieldName(fieldName.toString());
- return composer.compose(name);
+ name = composer.compose(name);
+ if (!CConventions.validateIdentifier(name, GPPLanguage.getDefault()).isOK())
+ name = '_' + name;
+ return name;
+ }
+
+ /**
+ * Checks is the given name is valid and, if not, tries to adjust it by adding a numeric suffix
+ * to it.
+ *
+ * @param name the name to check and, possibly, adjust
+ * @param namesToAvoid the set of names to avoid
+ * @return the adjusted name, or <code>null</code> if a valid name could not be generated.
+ */
+ private static String adjustName(String name, Set<String> namesToAvoid) {
+ String originalName = name;
+ for (int i = 1; i < 100; i++) {
+ if (!namesToAvoid.contains(name) && CConventions.validateIdentifier(name, GPPLanguage.getDefault()).isOK()) {
+ return name;
+ }
+ name = originalName + i;
+ }
+ return null;
}
}
public final class Messages extends NLS {
public static String GenerateGettersAndSettersInputPage_DeselectAll;
- public static String GenerateGettersAndSettersInputPage_header;
- public static String GenerateGettersAndSettersInputPage_PlaceImplHeader;
+ public static String GenerateGettersAndSettersInputPage_Header;
+ public static String GenerateGettersAndSettersInputPage_LinkDescription;
+ public static String GenerateGettersAndSettersInputPage_LinkTooltip;
+ public static String GenerateGettersAndSettersInputPage_Name;
+ public static String GenerateGettersAndSettersInputPage_SeparateDefinition;
public static String GenerateGettersAndSettersInputPage_SelectAll;
public static String GenerateGettersAndSettersInputPage_SelectGetters;
public static String GenerateGettersAndSettersInputPage_SelectSetters;
- public static String GenerateGettersAndSettersInputPage_LinkDescription;
- public static String GenerateGettersAndSettersInputPage_LinkTooltip;
- public static String GenerateGettersAndSettersRefactoring_NoCassDefFound;
+ public static String GenerateGettersAndSettersRefactoring_NoClassDefFound;
public static String GenerateGettersAndSettersRefactoring_NoFields;
public static String GenerateGettersAndSettersRefactoring_NoImplFile;
- public static String GettersAndSetters_Name;
static {
NLS.initializeMessages(Messages.class.getName(), Messages.class);
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
-# Institute for Software - initial API and implementation
+# Institute for Software - initial API and implementation
###############################################################################
-GettersAndSetters_Name=Generate getters and setters
GenerateGettersAndSettersInputPage_DeselectAll=Deselect All
-GenerateGettersAndSettersInputPage_header=Select getters and setters to create:
-GenerateGettersAndSettersInputPage_PlaceImplHeader=Place implementation in header file
+GenerateGettersAndSettersInputPage_Header=Select getters and setters to create:
+GenerateGettersAndSettersInputPage_LinkDescription=The names of getters and setters may be configured on the <a>Name Style</a> preference page.
+GenerateGettersAndSettersInputPage_LinkTooltip=Show the name style preferences.
+GenerateGettersAndSettersInputPage_Name=Generate getters and setters
+GenerateGettersAndSettersInputPage_SeparateDefinition=Definition separate from declaration
GenerateGettersAndSettersInputPage_SelectAll=Select All
GenerateGettersAndSettersInputPage_SelectGetters=Select Getters
GenerateGettersAndSettersInputPage_SelectSetters=Select Setters
-GenerateGettersAndSettersInputPage_LinkDescription=The names of getters and setters may be configured on the <a>Name Style</a> preference page.
-GenerateGettersAndSettersInputPage_LinkTooltip=Show the name style preferences.
-GenerateGettersAndSettersRefactoring_NoCassDefFound=No class definition found
+GenerateGettersAndSettersRefactoring_NoClassDefFound=No class definition found
GenerateGettersAndSettersRefactoring_NoFields=The class does not contain any fields.
GenerateGettersAndSettersRefactoring_NoImplFile=No implementation file found. Inserting definition into the header file.
/*******************************************************************************
- * Copyright (c) 2008, 2011 Institute for Software, HSR Hochschule fuer Technik
+ * Copyright (c) 2008, 2012 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Institute for Software - initial API and implementation
- * Marc-Andre Laperle
+ * Institute for Software - initial API and implementation
+ * Marc-Andre Laperle
*******************************************************************************/
package org.eclipse.cdt.internal.ui.refactoring.implementmethod;
super.checkInitialConditions(sm.newChild(6));
if (!initStatus.hasFatalError()) {
- data.setMethodDeclarations(findUnimplementedMethodDeclarations(pm));
+ List<IASTSimpleDeclaration> unimplementedMethodDeclarations = findUnimplementedMethodDeclarations(pm);
+ if (unimplementedMethodDeclarations.isEmpty()) {
+ initStatus.addFatalError(Messages.ImplementMethodRefactoring_NoMethodToImplement);
+ }
+ else {
+ data.setMethodDeclarations(unimplementedMethodDeclarations);
- if (selectedRegion.getLength() > 0) {
- IASTSimpleDeclaration methodDeclaration = SelectionHelper.findFirstSelectedDeclaration(selectedRegion, astCache.getAST(tu, pm));
- if (NodeHelper.isMethodDeclaration(methodDeclaration)) {
- for (MethodToImplementConfig config : data.getMethodDeclarations()) {
- if (config.getDeclaration() == methodDeclaration) {
- config.setChecked(true);
+ if (selectedRegion.getLength() > 0) {
+ IASTSimpleDeclaration methodDeclaration = SelectionHelper.findFirstSelectedDeclaration(selectedRegion, astCache.getAST(tu, pm));
+ if (NodeHelper.isMethodDeclaration(methodDeclaration)) {
+ for (MethodToImplementConfig config : data.getMethodDeclarations()) {
+ if (config.getDeclaration() == methodDeclaration) {
+ config.setChecked(true);
+ }
}
}
}
IASTNode declarationParent = methodDeclaration.getParent();
if (declSpecifier instanceof ICPPASTDeclSpecifier) {
- ((ICPPASTDeclSpecifier) declSpecifier).setVirtual(false);
+ ((ICPPASTDeclSpecifier) declSpecifier).setVirtual(false);
+ ((ICPPASTDeclSpecifier) declSpecifier).setExplicit(false);
}
String currentFileName = declarationParent.getNodeLocations()[0].asFileLocation().getFileName();
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
public static String ImplementMethodRefactoringPage_GeneratingPreview;
public static String ImplementMethodRefactoringPage_PreviewCanceled;
public static String ImplementMethodRefactoringPage_PreviewGenerationNotPossible;
- public static String ImplementMethodRefactoring_NoMethodSelected;
+ public static String ImplementMethodRefactoring_NoMethodToImplement;
public static String ImplementMethodRefactoring_MethodHasImpl;
public static String ImplementMethodRefactoring_NoImplFile;
public static String ImplementMethodRefactoringWizard_CancelingPreviewGeneration;
###############################################################################
-# Copyright (c) 2008, 2011 Institute for Software, HSR Hochschule fuer Technik
+# Copyright (c) 2008, 2012 Institute for Software, HSR Hochschule fuer Technik
# Rapperswil, University of applied sciences and others
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
ImplementMethodRefactoringPage_PreviewGenerationNotPossible=Preview generation not possible
ImplementMethodRefactoringPage_GeneratingPreview=Generating preview...
ImplementMethodRefactoringPage_PreviewCanceled=Preview canceled
-ImplementMethodRefactoring_NoMethodSelected=No method declaration selected
+ImplementMethodRefactoring_NoMethodToImplement=No methods to implement found.
ImplementMethodRefactoring_MethodHasImpl=This method already has an implementation.
ImplementMethodRefactoring_NoImplFile=No implementation file found for one or more method. Inserting definition(s) into the header file.
ImplementMethodRefactoringWizard_CancelingPreviewGeneration=Canceling preview generation
\ No newline at end of file
}
if (insertLocation.getTranslationUnit() == null) {
- ITranslationUnit partner = SourceHeaderPartnerFinder.getPartnerTranslationUnit(
- declarationTu, astCache);
- if (partner != null) {
- insertLocation.setParentNode(astCache.getAST(partner, null), partner);
- }
+ if (declarationTu.isHeaderUnit()) {
+ ITranslationUnit partner = SourceHeaderPartnerFinder.getPartnerTranslationUnit(
+ declarationTu, astCache);
+ if (partner != null) {
+ insertLocation.setParentNode(astCache.getAST(partner, null), partner);
+ }
+ } else {
+ insertLocation.setParentNode(parent.getTranslationUnit(), declarationTu);
+ }
}
return insertLocation;
}
delayedPreviewUpdater.schedule(PREVIEW_UPDATE_DELAY);
}
+
+ @Override
+ public boolean isPageComplete() {
+ if (!config.isChecked()) {
+ return true;
+ }
+ return super.isPageComplete();
+ }
}
import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTypeParameter;
import org.eclipse.cdt.core.index.IIndex;
+import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.index.IIndexName;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICElement;
* Returns TRUE, FALSE or UNKNOWN.
* @throws DOMException
*/
- public static int isSameBinding(IBinding b1, IBinding b2) throws DOMException {
+ public static int isSameBinding(IIndex index, IBinding b1, IBinding b2) throws DOMException {
if (b1 == null || b2 == null) {
return UNKNOWN;
}
if (b1.equals(b2)) {
return TRUE;
}
+ if (b1 instanceof IIndexBinding || b2 instanceof IIndexBinding) {
+ if (index != null) {
+ IIndexBinding b11 = index.adaptBinding(b1);
+ if (b11 != null)
+ b1= b11;
+ IIndexBinding b21 = index.adaptBinding(b2);
+ if (b21 != null)
+ b2= b21;
+ if (b1.equals(b2))
+ return TRUE;
+ }
+ }
+
String n1= b1.getName();
String n2= b2.getName();
if (n1 == null || n2 == null) {
if (problemInQualifier) {
cmp= UNKNOWN;
} else {
+ final IASTTranslationUnit tu = name.getTranslationUnit();
+ final IIndex index= tu != null ? tu.getIndex() : null;
for (IBinding renameBinding : fValidBindings) {
try {
- int cmp0= isSameBinding(binding, renameBinding);
+ int cmp0= isSameBinding(index, binding, renameBinding);
if (cmp0 != FALSE) {
cmp= cmp0;
}
for (int i = 0; !isAboveOrEqual && i<newBindingsAboverOrEqual.length; i++) {
IBinding aboveBinding = newBindingsAboverOrEqual[i];
try {
- if (isSameBinding(aboveBinding, conflictingBinding) == TRUE) {
+ if (isSameBinding(tu.getIndex(), aboveBinding, conflictingBinding) == TRUE) {
isAboveOrEqual= true;
}
} catch (DOMException e) {
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
+ * Markus Schorn - initial API and implementation
******************************************************************************/
package org.eclipse.cdt.internal.ui.refactoring.rename;
* can be calculated from the AST.
*/
public class CRefactoringArgument {
- private int fOffset= 0;
- private int fLength= 0;
+ private int fOffset;
+ private int fLength;
private String fText= ""; //$NON-NLS-1$
private int fKind= CRefactory.ARGUMENT_UNKNOWN;
private IFile fFile;
}
}
- // overrider
public String getName() {
return fText;
}
- // overrider
public IFile getSourceFile() {
return fFile;
}
- // overrider
public int getArgumentKind() {
return fKind;
}
- // overrider
public int getOffset() {
return fOffset;
}
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
- * Sergey Prigogin (Google)
+ * Markus Schorn - initial API and implementation
+ * Sergey Prigogin (Google)
******************************************************************************/
package org.eclipse.cdt.internal.ui.refactoring.rename;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IWorkingCopy;
-import org.eclipse.cdt.ui.CUIPlugin;
-
-import org.eclipse.cdt.internal.ui.refactoring.RefactoringStarter;
/**
* Serves to launch the various refactorings.
*/
public class CRefactory {
- public static final int OPTION_ASK_SCOPE = 0x01;
- public static final int OPTION_IN_COMMENT = 0x02;
- public static final int OPTION_IN_STRING_LITERAL = 0x04;
- public static final int OPTION_IN_INCLUDE_DIRECTIVE = 0x08;
- public static final int OPTION_IN_MACRO_DEFINITION = 0x10;
- public static final int OPTION_IN_PREPROCESSOR_DIRECTIVE = 0x20;
- public static final int OPTION_IN_INACTIVE_CODE = 0x40;
- public static final int OPTION_IN_CODE = 0x80;
- public static final int OPTION_DO_VIRTUAL = 0x100;
- public static final int OPTION_EXHAUSTIVE_FILE_SEARCH = 0x200;
+ public static final int OPTION_IN_CODE_REFERENCES = 0x01;
+ public static final int OPTION_IN_INACTIVE_CODE = 0x02;
+ public static final int OPTION_IN_COMMENT = 0x04;
+ public static final int OPTION_IN_STRING_LITERAL = 0x08;
+ public static final int OPTION_IN_INCLUDE_DIRECTIVE = 0x10;
+ public static final int OPTION_IN_MACRO_DEFINITION = 0x20;
+ public static final int OPTION_IN_PREPROCESSOR_DIRECTIVE = 0x40;
+ public static final int OPTION_DO_VIRTUAL = 0x80;
+ public static final int OPTION_EXHAUSTIVE_FILE_SEARCH = 0x100;
public static final int ARGUMENT_UNKNOWN = 0;
public static final int ARGUMENT_LOCAL_VAR = 1;
public static final int ARGUMENT_ENUMERATOR = 13;
public static final int ARGUMENT_CLASS_TYPE = 14;
public static final int ARGUMENT_NAMESPACE = 15;
-
+
private static CRefactory sInstance= new CRefactory();
private TextSearchWrapper fTextSearch;
CRefactoringArgument iarg= new CRefactoringArgument(arg);
final CRenameProcessor processor = new CRenameProcessor(this, iarg);
CRenameRefactoring refactoring= new CRenameRefactoring(processor);
- openDialog(shell, refactoring, false);
+ RenameSupport.openDialog(shell, refactoring);
}
public void rename(Shell shell, IWorkingCopy workingCopy, ITextSelection selection) {
new CRefactoringArgument((IFile) res, selection.getOffset(), selection.getLength());
final CRenameProcessor processor = new CRenameProcessor(this, iarg);
CRenameRefactoring refactoring= new CRenameRefactoring(processor);
- openDialog(shell, refactoring, false);
- }
-
- /**
- * Opens the refactoring dialog.
- *
- * <p>
- * This method has to be called from within the UI thread.
- * </p>
- *
- * @param shell a shell used as a parent for the refactoring, preview, or error dialog
- * @param showPreviewOnly if <code>true</code>, the dialog skips all user input pages and
- * directly shows the preview or error page. Otherwise, shows all pages.
- * @return <code>true</code> if the refactoring has been executed successfully,
- * or <code>false</code> if it has been canceled.
- */
- static boolean openDialog(Shell shell, CRenameRefactoring refactoring, boolean showPreviewOnly) {
- try {
- CRenameRefactoringWizard wizard;
- if (!showPreviewOnly) {
- wizard = new CRenameRefactoringWizard(refactoring);
- } else {
- wizard = new CRenameRefactoringWizard(refactoring) {
- @Override
- protected void addUserInputPages() {
- // nothing to add
- }
- };
- wizard.setForcePreviewReview(showPreviewOnly);
- }
- RefactoringStarter starter = new RefactoringStarter();
- CRenameProcessor processor = (CRenameProcessor) refactoring.getProcessor();
- processor.lockIndex();
- try {
- processor.checkInitialConditions(new NullProgressMonitor());
- return starter.activate(wizard, shell, RenameMessages.CRefactory_title_rename, processor.getSaveMode());
- } finally {
- processor.unlockIndex();
- }
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- } catch (CoreException e) {
- CUIPlugin.log(e);
- }
- return false;
+ RenameSupport.openDialog(shell, refactoring);
}
public TextSearchWrapper getTextSearch() {
IContentType[] cts= Platform.getContentTypeManager().getAllContentTypes();
HashSet<String> all= new HashSet<String>();
for (IContentType type : cts) {
- boolean useit= false;
- while (!useit && type != null) {
+ boolean useIt= false;
+ while (!useIt && type != null) {
String id= type.getId();
if (id.equals(CCorePlugin.CONTENT_TYPE_CHEADER) ||
id.equals(CCorePlugin.CONTENT_TYPE_CSOURCE) ||
id.equals(CCorePlugin.CONTENT_TYPE_CXXHEADER) ||
id.equals(CCorePlugin.CONTENT_TYPE_CXXSOURCE)) {
- useit= true;
+ useIt= true;
} else {
type= type.getBaseType();
}
}
- if (useit) {
+ if (useIt) {
String exts[] = type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
all.addAll(Arrays.asList(exts));
}
import org.eclipse.cdt.internal.ui.refactoring.RefactoringSaveHelper;
-
/**
* Rename processor that sets up the input page for renaming a global entity.
*/
public CRenameGlobalProcessor(CRenameProcessor processor, String name) {
super(processor, name);
- setAvailableOptions(CRefactory.OPTION_ASK_SCOPE |
- CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH |
- CRefactory.OPTION_IN_CODE |
+ setAvailableOptions(
+ CRefactory.OPTION_IN_CODE_REFERENCES |
CRefactory.OPTION_IN_COMMENT |
- CRefactory.OPTION_IN_MACRO_DEFINITION);
+ CRefactory.OPTION_IN_MACRO_DEFINITION |
+ CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH);
}
@Override
public CRenameIncludeProcessor(CRenameProcessor input, String kind) {
super(input, kind);
- setAvailableOptions(CRefactory.OPTION_ASK_SCOPE |
- CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH |
+ setAvailableOptions(
CRefactory.OPTION_IN_COMMENT |
- CRefactory.OPTION_IN_MACRO_DEFINITION);
+ CRefactory.OPTION_IN_MACRO_DEFINITION |
+ CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH);
setOptionsForcingPreview(-1);
- setOptionsEnablingScope(-1);
+ setOptionsEnablingExhaustiveSearch(-1);
}
@Override
setOptionsForcingPreview(0);
}
- // overrider
@Override
protected int getAcceptedLocations(int selectedOptions) {
- return CRefactory.OPTION_IN_CODE | CRefactory.OPTION_IN_MACRO_DEFINITION | selectedOptions;
+ return CRefactory.OPTION_IN_CODE_REFERENCES | CRefactory.OPTION_IN_MACRO_DEFINITION | selectedOptions;
}
- // overrider
@Override
protected int getSearchScope() {
return TextSearchWrapper.SCOPE_FILE;
public CRenameMacroProcessor(CRenameProcessor processor, String name) {
super(processor, name);
- setAvailableOptions(CRefactory.OPTION_ASK_SCOPE |
- CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH |
- CRefactory.OPTION_IN_CODE |
+ setAvailableOptions(
+ CRefactory.OPTION_IN_CODE_REFERENCES |
CRefactory.OPTION_IN_COMMENT |
- CRefactory.OPTION_IN_PREPROCESSOR_DIRECTIVE);
+ CRefactory.OPTION_IN_PREPROCESSOR_DIRECTIVE |
+ CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH);
}
-
+
@Override
protected int getAcceptedLocations(int selectedOptions) {
return selectedOptions | CRefactory.OPTION_IN_MACRO_DEFINITION;
/*******************************************************************************
- * Copyright (c) 2004, 2010 Wind River Systems, Inc. and others.
+ * Copyright (c) 2004, 2011 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.internal.ui.refactoring.RefactoringSaveHelper;
+
/**
* This is the processor used for the rename. It decides which of the delegates to
* use and forwards further calls to the delegate.
private final CRefactoringArgument fArgument;
private CRenameProcessorDelegate fDelegate;
private String fReplacementText;
- private String fWorkingSet;
- private int fScope;
+ private String fWorkingSetName;
+ private int fExhaustiveSearchScope;
private int fSelectedOptions;
private final CRefactory fManager;
private final ASTManager fAstManager;
private IIndex fIndex;
+ private int indexLockCount;
private RefactoringStatus fInitialConditionsStatus;
+
+ private Change fChange;
public CRenameProcessor(CRefactory refactoringManager, CRefactoringArgument arg) {
fManager= refactoringManager;
return fArgument;
}
- // overrider
@Override
public Object[] getElements() {
return new Object[] { fArgument.getBinding() };
}
- // overrider
@Override
public String getProcessorName() {
String result= null;
private CRenameProcessorDelegate createDelegate() {
switch (fArgument.getArgumentKind()) {
case CRefactory.ARGUMENT_LOCAL_VAR:
- return new CRenameLocalProcessor(this,
+ return new CRenameLocalProcessor(this,
RenameMessages.CRenameTopProcessor_localVar,
fArgument.getScope());
case CRefactory.ARGUMENT_PARAMETER:
- return new CRenameLocalProcessor(this,
+ return new CRenameLocalProcessor(this,
RenameMessages.CRenameTopProcessor_parameter,
fArgument.getScope());
case CRefactory.ARGUMENT_FILE_LOCAL_VAR:
- return new CRenameLocalProcessor(this,
+ return new CRenameLocalProcessor(this,
RenameMessages.CRenameTopProcessor_filelocalVar,
null);
case CRefactory.ARGUMENT_GLOBAL_VAR:
case CRefactory.ARGUMENT_FIELD:
return new CRenameGlobalProcessor(this, RenameMessages.CRenameTopProcessor_field);
case CRefactory.ARGUMENT_FILE_LOCAL_FUNCTION:
- return new CRenameLocalProcessor(this,
+ return new CRenameLocalProcessor(this,
RenameMessages.CRenameTopProcessor_filelocalFunction,
null);
case CRefactory.ARGUMENT_GLOBAL_FUNCTION:
@Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
- return fDelegate.createChange(pm);
+ fChange = fDelegate.createChange(pm);
+ return fChange;
}
- @Override
+ /**
+ * @return the change if it has been created, or <code>null</code> otherwise.
+ */
+ Change getChange() {
+ return fChange;
+ }
+
+ @Override
public RefactoringParticipant[] loadParticipants(RefactoringStatus status,
SharableParticipants sharedParticipants) throws CoreException {
RenameArguments arguments= new RenameArguments(getReplacementText(), true);
return result.toArray(new RefactoringParticipant[result.size()]);
}
- // options for the input page in the refactoring wizard
+ /**
+ * Options for the input page in the refactoring wizard
+ */
public int getAvailableOptions() {
if (fDelegate == null) {
return 0;
return fDelegate.getAvailableOptions();
}
- // options for the input page that trigger the preview
+ /**
+ * Options for the input page that trigger the preview
+ */
public int getOptionsForcingPreview() {
if (fDelegate == null) {
return 0;
return fDelegate.getOptionsForcingPreview();
}
- // options for the input page that trigger the preview
- public int getOptionsEnablingScope() {
+ /**
+ * The options that may need exhaustive file search since index lookup is not guaranteed to
+ * return all files participating in refactoring. When one of these options is selected,
+ * the exhaustive file search is enabled.
+ */
+ public int getOptionsEnablingExhaustiveSearch() {
if (fDelegate == null) {
return 0;
}
- return fDelegate.getOptionsEnablingScope();
+ return fDelegate.getOptionsEnablingExhaustiveSearch();
}
@Override
return IDENTIFIER;
}
- public int getScope() {
- return fScope;
+ public int getExhaustiveSearchScope() {
+ return (fSelectedOptions & CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH) != 0 ?
+ fExhaustiveSearchScope : TextSearchWrapper.SCOPE_FILE;
}
- public void setScope(int scope) {
- fScope = scope;
+ public void setExhaustiveSearchScope(int scope) {
+ fExhaustiveSearchScope = scope;
}
public int getSelectedOptions() {
fSelectedOptions = selectedOptions;
}
- public String getWorkingSet() {
- return fWorkingSet;
+ public boolean isPreviewRequired() {
+ return (fSelectedOptions & getOptionsForcingPreview()) != 0;
+ }
+
+ public String getWorkingSetName() {
+ return fWorkingSetName;
}
/**
* Sets the name of the working set. If the name of the working set is invalid,
* it's set to an empty string.
*/
- public void setWorkingSet(String workingSet) {
- fWorkingSet = checkWorkingSet(workingSet);
+ public void setWorkingSetName(String workingSet) {
+ fWorkingSetName = checkWorkingSet(workingSet);
}
public String getReplacementText() {
}
public void lockIndex() throws CoreException, InterruptedException {
- if (fIndex == null) {
- ICProject[] projects= CoreModel.getDefault().getCModel().getCProjects();
- fIndex= CCorePlugin.getIndexManager().getIndex(projects);
+ if (indexLockCount == 0) {
+ if (fIndex == null) {
+ ICProject[] projects= CoreModel.getDefault().getCModel().getCProjects();
+ fIndex= CCorePlugin.getIndexManager().getIndex(projects);
+ }
+ fIndex.acquireReadLock();
}
- fIndex.acquireReadLock();
+ indexLockCount++;
}
public void unlockIndex() {
- if (fAstManager != null) {
- fAstManager.dispose();
+ if (--indexLockCount <= 0) {
+ if (fAstManager != null) {
+ fAstManager.dispose();
+ }
+ if (fIndex != null) {
+ fIndex.releaseReadLock();
+ }
+ fIndex= null;
}
- if (fIndex != null) {
- fIndex.releaseReadLock();
- }
- fIndex= null;
}
public IIndex getIndex() {
* @return a save mode from {@link org.eclipse.cdt.internal.ui.refactoring.RefactoringSaveHelper}
*/
public int getSaveMode() {
+ if (fDelegate == null) {
+ return RefactoringSaveHelper.SAVE_NOTHING;
+ }
return fDelegate.getSaveMode();
}
-
+
private String checkWorkingSet(String workingSet) {
if (workingSet != null && workingSet.length() > 0) {
IWorkingSetManager wsManager= PlatformUI.getWorkbench().getWorkingSetManager();
import org.eclipse.cdt.core.index.IIndexName;
import org.eclipse.cdt.ui.refactoring.CTextFileChange;
-
/**
* Abstract base for all different rename processors used by the top processor.
*/
private CRenameProcessor fTopProcessor;
private ArrayList<CRefactoringMatch> fMatches;
protected String fProcessorBaseName;
- private int fAvailableOptions=
- CRefactory.OPTION_ASK_SCOPE |
- CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH |
- CRefactory.OPTION_IN_CODE |
+ private int fAvailableOptions=
+ CRefactory.OPTION_IN_CODE_REFERENCES |
CRefactory.OPTION_IN_COMMENT |
CRefactory.OPTION_IN_MACRO_DEFINITION |
- CRefactory.OPTION_IN_STRING_LITERAL;
+ CRefactory.OPTION_IN_STRING_LITERAL |
+ CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH;
private int fOptionsForcingPreview=
- CRefactory.OPTION_IN_INACTIVE_CODE |
- CRefactory.OPTION_IN_COMMENT |
+ CRefactory.OPTION_IN_COMMENT |
CRefactory.OPTION_IN_MACRO_DEFINITION |
CRefactory.OPTION_IN_PREPROCESSOR_DIRECTIVE |
CRefactory.OPTION_IN_STRING_LITERAL;
-
- private int fOptionsEnablingScope= fOptionsForcingPreview;
+ private int fOptionsEnablingExhaustiveSearch= fOptionsForcingPreview |
+ CRefactory.OPTION_IN_INACTIVE_CODE | CRefactory.OPTION_IN_CODE_REFERENCES;
protected CRenameProcessorDelegate(CRenameProcessor topProcessor, String name) {
fTopProcessor= topProcessor;
}
final public int getSelectedScope() {
- return fTopProcessor.getScope();
+ return fTopProcessor.getExhaustiveSearchScope();
}
final public int getSelectedOptions() {
}
final public String getSelectedWorkingSet() {
- return fTopProcessor.getWorkingSet();
+ return fTopProcessor.getWorkingSetName();
}
final public CRefactory getManager() {
}
/**
- * The options that need the scope definition. When one of them is
- * selected, the scope options are enabled.
+ * Sets the options that enable exhaustive file search.
+ * @see #getOptionsEnablingExhaustiveSearch()
*/
- public void setOptionsEnablingScope(int options) {
- fOptionsEnablingScope= options;
+ void setOptionsEnablingExhaustiveSearch(int options) {
+ fOptionsEnablingExhaustiveSearch= options;
}
-
- final int getOptionsEnablingScope() {
- return fOptionsEnablingScope;
+
+ /**
+ * The options that may need exhaustive file search since index lookup is not guaranteed to
+ * return all files participating in refactoring. When one of these options is selected,
+ * the exhaustive file search is enabled.
+ */
+ final int getOptionsEnablingExhaustiveSearch() {
+ return fOptionsEnablingExhaustiveSearch;
}
protected int getSearchScope() {
/**
* Builds an index-based file filter for the name search.
+ *
* @param bindings bindings being renamed
- * @return A set of files containing references to the bindings, or <code>null</code> if
- * exhaustive file search is requested.
+ * @return A set of files containing references to the bindings.
*/
- private Collection<IResource> getFileFilter(IBinding[] bindings) {
- if ((getSelectedOptions() & CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH) != 0) {
- return null;
- }
+ private Collection<IFile> getReferringFiles(IBinding[] bindings) {
+ ArrayList<IFile> files = new ArrayList<IFile>();
IIndex index = getIndex();
if (index == null) {
- return null;
+ return files;
}
Set<IIndexFileLocation> locations = new HashSet<IIndexFileLocation>();
try {
}
}
} catch (InterruptedException e) {
- return null;
+ return files;
} catch (CoreException e) {
- return null;
+ return files;
} finally {
index.releaseReadLock();
}
- ArrayList<IResource> files = new ArrayList<IResource>(locations.size());
+ files.ensureCapacity(locations.size());
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
for (IIndexFileLocation location : locations) {
String fullPath= location.getFullPath();
if (fullPath != null) {
IResource file= workspaceRoot.findMember(fullPath);
- if (file != null) {
- files.add(file);
+ if (file instanceof IFile) {
+ files.add((IFile) file);
}
}
}
// perform text-search
fMatches= new ArrayList<CRefactoringMatch>();
TextSearchWrapper txtSearch= getManager().getTextSearch();
- Collection<IResource> fileFilter = getFileFilter(renameBindings);
- if (fileFilter != null && !fileFilter.contains(file)) {
- fileFilter.add(file);
+ Collection<IFile> filesToSearch = getReferringFiles(renameBindings);
+ if (!filesToSearch.contains(file)) {
+ filesToSearch.add(file);
}
- IStatus stat= txtSearch.searchWord(getSearchScope(), file, getSelectedWorkingSet(),
- fileFilter != null ? fileFilter.toArray(new IResource[fileFilter.size()]) : null,
- getManager().getCCppPatterns(),
+ IStatus stat= txtSearch.searchWord(filesToSearch.toArray(new IFile[filesToSearch.size()]),
+ getSearchScope(), file, getSelectedWorkingSet(), getManager().getCCppPatterns(),
getArgument().getName(), new SubProgressMonitor(monitor, 1), fMatches);
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
if (match.getAstInformation() != CRefactoringMatch.AST_REFERENCE_OTHER) {
IFile mfile= match.getFile();
- if (file==null || !file.equals(mfile) || fileEdit == null || fileChange == null) {
+ if (file == null || !file.equals(mfile) || fileEdit == null || fileChange == null) {
file= mfile;
fileEdit= new MultiTextEdit();
fileChange = new CTextFileChange(file.getName(), file);
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
- * Emanuel Graf (Institute for Software, HSR Hochschule fuer Technik)
- * Sergey Prigogin (Google)
+ * Markus Schorn - initial API and implementation
+ * Emanuel Graf (Institute for Software, HSR Hochschule fuer Technik)
+ * Sergey Prigogin (Google)
******************************************************************************/
package org.eclipse.cdt.internal.ui.refactoring.rename;
private String fSearchString;
private int fOptions;
private int fForcePreviewOptions= 0;
- private int fEnableScopeOptions;
+ private int fExhaustiveSearchEnablingOptions;
private Text fNewName;
private Button fDoVirtual;
fSearchString= processor.getArgument().getName();
fOptions= processor.getAvailableOptions();
fForcePreviewOptions= processor.getOptionsForcingPreview();
- fEnableScopeOptions= processor.getOptionsEnablingScope();
+ fExhaustiveSearchEnablingOptions= processor.getOptionsEnablingExhaustiveSearch();
Composite top= new Composite(parent, SWT.NONE);
initializeDialogUnits(top);
top.setLayout(new GridLayout(2, false));
- // new name
+ // New name
Composite group= top;
GridData gd;
GridLayout gl;
Label label= new Label(top, SWT.NONE);
label.setText(RenameMessages.CRenameRefactoringInputPage_label_newName);
fNewName= new Text(top, SWT.BORDER);
- fNewName.setText(fSearchString);
+ String name = processor.getReplacementText();
+ if (name == null) {
+ name = fSearchString;
+ }
+ fNewName.setText(name);
fNewName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fNewName.selectAll();
gd.horizontalSpan= 2;
}
- if (hasOption(CRefactory.OPTION_ASK_SCOPE)) {
- // Specify the scope.
- skipLine(top);
- label = new Label(top, SWT.NONE);
- label.setText(RenameMessages.CRenameRefactoringInputPage_label_scope);
- label.setLayoutData(gd= new GridData(GridData.FILL_HORIZONTAL));
- gd.horizontalSpan= 2;
-
- group= new Composite(top, SWT.NONE);
- group.setLayoutData(gd= new GridData(GridData.FILL_HORIZONTAL));
- gd.horizontalSpan= 2;
- group.setLayout(gl= new GridLayout(4, false));
- gl.marginHeight= 0;
- gl.marginLeft = gl.marginWidth;
- gl.marginWidth = 0;
-
- fWorkspace= new Button(group, SWT.RADIO);
- fWorkspace.setText(RenameMessages.CRenameRefactoringInputPage_button_workspace);
- fWorkspace.setLayoutData(gd= new GridData());
-
- fDependent= new Button(group, SWT.RADIO);
- fDependent.setText(RenameMessages.CRenameRefactoringInputPage_button_relatedProjects);
- fDependent.setLayoutData(gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- gd.horizontalIndent= 8;
-
- fSingle= new Button(group, SWT.RADIO);
- fSingle.setText(RenameMessages.CRenameRefactoringInputPage_button_singleProject);
- fSingle.setLayoutData(gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- gd.horizontalIndent= 8;
- gd.horizontalSpan= 2;
-
- fWorkingSet= new Button(group, SWT.RADIO);
- fWorkingSet.setText(RenameMessages.CRenameRefactoringInputPage_button_workingSet);
-
- fWorkingSetSpec= new Text(group, SWT.SINGLE|SWT.BORDER|SWT.READ_ONLY);
- fWorkingSetSpec.setLayoutData(gd= new GridData(GridData.FILL_HORIZONTAL));
- gd.horizontalIndent= 8;
- gd.horizontalSpan= 2;
- fWorkingSetButton= new Button(group, SWT.PUSH);
- fWorkingSetButton.setText(RenameMessages.CRenameRefactoringInputPage_button_chooseWorkingSet);
- setButtonLayoutData(fWorkingSetButton);
- }
-
boolean skippedLine= false;
group= null;
- if (hasOption(CRefactory.OPTION_IN_CODE)) {
+ if (hasOption(CRefactory.OPTION_IN_CODE_REFERENCES)) {
group= createLabelAndGroup(group, skippedLine, top);
fReferences= new Button(group, SWT.CHECK);
fReferences.setText(RenameMessages.CRenameRefactoringInputPage_button_sourceCode);
fExhausiveFileSearch.setLayoutData(gd= new GridData());
gd.horizontalIndent= 5;
gd.horizontalSpan= 2;
- }
+
+ // Specify the scope.
+ group= new Composite(top, SWT.NONE);
+ group.setLayoutData(gd= new GridData(GridData.FILL_HORIZONTAL));
+ gd.horizontalSpan= 2;
+ gd.horizontalIndent= 16;
+ group.setLayout(gl= new GridLayout(4, false));
+ gl.marginHeight= 0;
+ gl.marginLeft = gl.marginWidth;
+ gl.marginWidth = 0;
+
+ fWorkspace= new Button(group, SWT.RADIO);
+ fWorkspace.setText(RenameMessages.CRenameRefactoringInputPage_button_workspace);
+ fWorkspace.setLayoutData(gd= new GridData());
+
+ fDependent= new Button(group, SWT.RADIO);
+ fDependent.setText(RenameMessages.CRenameRefactoringInputPage_button_relatedProjects);
+ fDependent.setLayoutData(gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+ gd.horizontalIndent= 8;
+
+ fSingle= new Button(group, SWT.RADIO);
+ fSingle.setText(RenameMessages.CRenameRefactoringInputPage_button_singleProject);
+ fSingle.setLayoutData(gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+ gd.horizontalIndent= 8;
+ gd.horizontalSpan= 2;
+
+ fWorkingSet= new Button(group, SWT.RADIO);
+ fWorkingSet.setText(RenameMessages.CRenameRefactoringInputPage_button_workingSet);
+
+ fWorkingSetSpec= new Text(group, SWT.SINGLE|SWT.BORDER|SWT.READ_ONLY);
+ fWorkingSetSpec.setLayoutData(gd= new GridData(GridData.FILL_HORIZONTAL));
+ gd.horizontalIndent= 8;
+ gd.horizontalSpan= 2;
+ fWorkingSetButton= new Button(group, SWT.PUSH);
+ fWorkingSetButton.setText(RenameMessages.CRenameRefactoringInputPage_button_chooseWorkingSet);
+ setButtonLayoutData(fWorkingSetButton);
+ }
Dialog.applyDialogFont(top);
hookSelectionListeners();
}
protected void onSelectedScope(int scope) {
- getRenameProcessor().setScope(scope);
+ getRenameProcessor().setExhaustiveSearchScope(scope);
updateEnablement();
}
fDependent.setSelection(true);
break;
}
- processor.setScope(scope);
+ processor.setExhaustiveSearchScope(scope);
String workingSet= fPreferences.getWorkingSet();
- processor.setWorkingSet(workingSet); // CRenameProcessor validates the working set name.
- fWorkingSetSpec.setText(processor.getWorkingSet());
+ processor.setWorkingSetName(workingSet); // CRenameProcessor validates the working set name.
+ fWorkingSetSpec.setText(processor.getWorkingSetName());
}
if (fDoVirtual != null) {
boolean val= !fPreferences.getBoolean(CRenameRefactoringPreferences.KEY_REFERENCES_INV);
fReferences.setSelection(val);
}
+ initOption(fInInactiveCode, CRenameRefactoringPreferences.KEY_INACTIVE);
initOption(fInComment, CRenameRefactoringPreferences.KEY_COMMENT);
initOption(fInString, CRenameRefactoringPreferences.KEY_STRING);
initOption(fInInclude, CRenameRefactoringPreferences.KEY_INCLUDE);
initOption(fInMacro, CRenameRefactoringPreferences.KEY_MACRO_DEFINITION);
initOption(fInPreprocessor, CRenameRefactoringPreferences.KEY_PREPROCESSOR);
- initOption(fInInactiveCode, CRenameRefactoringPreferences.KEY_INACTIVE);
initOption(fExhausiveFileSearch, CRenameRefactoringPreferences.KEY_EXHAUSTIVE_FILE_SEARCH);
}
private int computeSelectedOptions() {
- int options= 0;
- options |= computeOption(fDoVirtual, CRefactory.OPTION_DO_VIRTUAL);
- options |= computeOption(fReferences, CRefactory.OPTION_IN_CODE);
- options |= computeOption(fInComment, CRefactory.OPTION_IN_COMMENT);
- options |= computeOption(fInString, CRefactory.OPTION_IN_STRING_LITERAL);
- options |= computeOption(fInInclude, CRefactory.OPTION_IN_INCLUDE_DIRECTIVE);
- options |= computeOption(fInMacro, CRefactory.OPTION_IN_MACRO_DEFINITION);
- options |= computeOption(fInPreprocessor, CRefactory.OPTION_IN_PREPROCESSOR_DIRECTIVE);
- options |= computeOption(fInInactiveCode, CRefactory.OPTION_IN_INACTIVE_CODE);
- options |= computeOption(fExhausiveFileSearch, CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH);
+ int options= fPreferences.getOptions();
+ options = updateOptions(options, fDoVirtual, CRefactory.OPTION_DO_VIRTUAL);
+ options = updateOptions(options, fInInactiveCode, CRefactory.OPTION_IN_INACTIVE_CODE);
+ options = updateOptions(options, fInComment, CRefactory.OPTION_IN_COMMENT);
+ options = updateOptions(options, fInString, CRefactory.OPTION_IN_STRING_LITERAL);
+ options = updateOptions(options, fInInclude, CRefactory.OPTION_IN_INCLUDE_DIRECTIVE);
+ options = updateOptions(options, fInMacro, CRefactory.OPTION_IN_MACRO_DEFINITION);
+ options = updateOptions(options, fInPreprocessor, CRefactory.OPTION_IN_PREPROCESSOR_DIRECTIVE);
+ options = updateOptions(options, fReferences, CRefactory.OPTION_IN_CODE_REFERENCES);
+ options = updateOptions(options, fExhausiveFileSearch, CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH);
return options;
}
- private int computeOption(Button button, int option) {
- if (button != null && button.getSelection()) {
- return option;
+ private int updateOptions(int options, Button button, int optionMask) {
+ if (button == null)
+ return options;
+ if (button.getSelection()) {
+ return options | optionMask;
+ } else {
+ return options & ~optionMask;
}
- return 0;
}
private void initOption(Button button, String key) {
- boolean val= false;
+ initOption(button, key, false);
+ }
+
+ private void initOption(Button button, String key, boolean defaultValue) {
if (button != null) {
- val= fPreferences.getBoolean(key);
+ boolean val= fPreferences.getBoolean(key, defaultValue);
button.setSelection(val);
}
}
fDependent.setSelection(false);
fSingle.setSelection(false);
fWorkingSet.setSelection(true);
- processor.setScope(TextSearchWrapper.SCOPE_WORKING_SET);
+ processor.setExhaustiveSearchScope(TextSearchWrapper.SCOPE_WORKING_SET);
wsName= ws.getName();
}
}
- processor.setWorkingSet(wsName); // CRenameProcessor validates the working set name.
- fWorkingSetSpec.setText(processor.getWorkingSet());
+ processor.setWorkingSetName(wsName); // CRenameProcessor validates the working set name.
+ fWorkingSetSpec.setText(processor.getWorkingSetName());
updateEnablement();
}
}
protected void updateEnablement() {
- boolean enable= fEnableScopeOptions == -1 ||
- (computeSelectedOptions() & fEnableScopeOptions) != 0;
-
- if (fWorkspace != null) {
- fWorkspace.setEnabled(enable);
- fDependent.setEnabled(enable);
- fSingle.setEnabled(enable);
-
- boolean enableSpec= false;
- fWorkingSet.setEnabled(enable);
- if (enable && fWorkingSet.getSelection()) {
- enableSpec= true;
- }
- fWorkingSetSpec.setEnabled(enableSpec);
- fWorkingSetButton.setEnabled(enable);
- }
+ if (fExhausiveFileSearch != null) {
+ boolean enable= fExhaustiveSearchEnablingOptions == -1 ||
+ (computeSelectedOptions() & fExhaustiveSearchEnablingOptions) != 0;
+
+ fExhausiveFileSearch.setEnabled(enable);
+ enable = enable && fExhausiveFileSearch.getSelection();
+ if (fWorkspace != null) {
+ fWorkspace.setEnabled(enable);
+ fDependent.setEnabled(enable);
+ fSingle.setEnabled(enable);
+
+ boolean enableSpec= false;
+ fWorkingSet.setEnabled(enable);
+ if (enable && fWorkingSet.getSelection()) {
+ enableSpec= true;
+ }
+ fWorkingSetSpec.setEnabled(enableSpec);
+ fWorkingSetButton.setEnabled(enable);
+ }
+ }
}
private CRenameProcessor getRenameProcessor() {
return fDialogSettings.getBoolean(key);
}
+ public boolean getBoolean(String key, boolean defaultValue) {
+ String value = fDialogSettings.get(key);
+ return value != null ? Boolean.parseBoolean(value) : defaultValue;
+ }
+
public void put(String key, int value) {
fDialogSettings.put(key, value);
}
if (!getBoolean(KEY_IGNORE_VIRTUAL))
options |= CRefactory.OPTION_DO_VIRTUAL;
if (!getBoolean(KEY_REFERENCES_INV))
- options |= CRefactory.OPTION_IN_CODE;
+ options |= CRefactory.OPTION_IN_CODE_REFERENCES;
+ if (getBoolean(KEY_INACTIVE))
+ options |= CRefactory.OPTION_IN_INACTIVE_CODE;
if (getBoolean(KEY_COMMENT))
options |= CRefactory.OPTION_IN_COMMENT;
if (getBoolean(KEY_STRING))
options |= CRefactory.OPTION_IN_MACRO_DEFINITION;
if (getBoolean(KEY_PREPROCESSOR))
options |= CRefactory.OPTION_IN_PREPROCESSOR_DIRECTIVE;
- if (getBoolean(KEY_INACTIVE))
- options |= CRefactory.OPTION_IN_INACTIVE_CODE;
if (getBoolean(KEY_EXHAUSTIVE_FILE_SEARCH))
options |= CRefactory.OPTION_EXHAUSTIVE_FILE_SEARCH;
return options;
if (fShowPreview) { // could have been updated by undoAndCreateRenameSupport(..)
executed= renameSupport.openDialog(shell, true);
} else {
- renameSupport.perform(shell, fEditor.getSite().getWorkbenchWindow());
- executed= true;
+ executed= renameSupport.perform(shell, fEditor.getSite().getWorkbenchWindow());
}
if (executed) {
restoreFullSelection();
processor.setReplacementText(newName);
CRenameRefactoringPreferences preferences = new CRenameRefactoringPreferences();
processor.setSelectedOptions(preferences.getOptions());
- processor.setScope(preferences.getScope());
- processor.setWorkingSet(preferences.getWorkingSet());
- RenameSupport renameSupport= RenameSupport.create(processor);
- return renameSupport;
+ processor.setExhaustiveSearchScope(preferences.getScope());
+ processor.setWorkingSetName(preferences.getWorkingSet());
+ return RenameSupport.create(processor);
}
private void reconcile() throws CModelException {
public static String CRenameRefactoringInputPage_button_workingSet;
public static String CRenameRefactoringInputPage_errorInvalidIdentifier;
public static String CRenameRefactoringInputPage_label_newName;
- public static String CRenameRefactoringInputPage_label_scope;
public static String CRenameRefactoringInputPage_label_updateWithin;
public static String CRenameRefactoringInputPage_renameBaseAndDerivedMethods;
public static String CRenameTopProcessor_enumerator;
CRenameRefactoringInputPage_button_macroDefinitions=Macro definitions
CRenameRefactoringInputPage_button_preprocessor=Other preprocessor directives
CRenameRefactoringInputPage_button_strings=String literals
-CRenameRefactoringInputPage_button_exhaustiveFileSearch=Exhaustive file search (slow)
+CRenameRefactoringInputPage_button_exhaustiveFileSearch=Exhaustive (slow) file search in:
CRenameRefactoringInputPage_button_singleProject=Project
CRenameRefactoringInputPage_button_relatedProjects=Related projects
CRenameRefactoringInputPage_button_workspace=All projects
CRenameRefactoringInputPage_button_workingSet=Working set:
CRenameRefactoringInputPage_errorInvalidIdentifier=''{0}'' is not a valid identifier
CRenameRefactoringInputPage_label_newName=New Name:
-CRenameRefactoringInputPage_label_scope=Scope of Rename:
-CRenameRefactoringInputPage_label_updateWithin=Update within:
+CRenameRefactoringInputPage_label_updateWithin=Update occurrences in:
CRenameRefactoringInputPage_renameBaseAndDerivedMethods=Rename virtual methods in base and derived classes, also (if any).
CRenameTopProcessor_enumerator=enumerator
CRenameTopProcessor_error_invalidName=The selected name cannot be renamed.
import java.lang.reflect.InvocationTargetException;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.RefactoringCore;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.internal.ui.refactoring.RefactoringExecutionHelper;
+import org.eclipse.cdt.internal.ui.refactoring.RefactoringStarter;
/**
* Central access point to execute rename refactorings.
/** Flag indicating that the setter method is to be updated as well. */
public static final int UPDATE_SETTER_METHOD= 1 << 5;
+ /** @see #openDialog(Shell, CRenameRefactoring, DialogMode) */
+ private enum DialogMode { ALL_PAGES, PREVIEW_ONLY, CONDITIONAL_PREVIEW }
+ /** @see #openDialog(Shell, CRenameRefactoring, DialogMode) */
+ private enum DialogResult { OK, CANCELED, SKIPPED }
+ // Same as org.eclipse.ltk.internal.ui.refactoring.IErrorWizardPage#PAGE_NAME
+ private static final String ERROR_PAGE_NAME = "ErrorPage"; //$NON-NLS-1$
+
private CRenameRefactoring fRefactoring;
private RefactoringStatus fPreCheckStatus;
* @throws CoreException if an unexpected exception occurs while performing the checking.
*
* @see #openDialog(Shell)
- * @see #perform(Shell, IRunnableContext)
+ * @see #perform(Shell, IWorkbenchWindow)
*/
public IStatus preCheck() throws CoreException {
ensureChecked();
/**
* Opens the refactoring dialog for this rename support.
*
- * @param parent a shell used as a parent for the refactoring dialog.
- * @throws CoreException if an unexpected exception occurs while opening the
- * dialog.
+ * @param shell a shell used as a parent for the refactoring dialog.
+ * @throws CoreException if an unexpected exception occurs while opening the dialog.
*
* @see #openDialog(Shell, boolean)
*/
- public void openDialog(Shell parent) throws CoreException {
- openDialog(parent, false);
+ public boolean openDialog(Shell shell) throws CoreException {
+ return openDialog(shell, false);
}
/**
return false;
}
- return CRefactory.openDialog(shell, fRefactoring, showPreviewOnly);
+ DialogMode mode = showPreviewOnly ? DialogMode.PREVIEW_ONLY : DialogMode.ALL_PAGES;
+ return openDialog(shell, fRefactoring, mode) == DialogResult.OK;
+ }
+
+ /**
+ * Opens the refactoring dialog for a given rename refactoring.
+ *
+ * @param shell a shell used as a parent for the refactoring dialog.
+ * @param refactoring the refactoring object.
+ *
+ * @see #openDialog(Shell, boolean)
+ */
+ public static void openDialog(Shell shell, CRenameRefactoring refactoring) {
+ openDialog(shell, refactoring, DialogMode.ALL_PAGES);
+ }
+
+ /**
+ * Opens the refactoring dialog.
+ *
+ * <p>
+ * This method has to be called from within the UI thread.
+ * </p>
+ *
+ * @param shell A shell used as a parent for the refactoring, preview, or error dialog
+ * @param refactoring The refactoring.
+ * @param mode One of DialogMode values. ALL_PAGES opens wizard with all pages shown;
+ * PREVIEW_ONLY opens the preview page only; CONDITIONAL_PREVIEW opens the wizard with
+ * preview page only and only if a warning was generated during the final conditions check.
+ * @return One of DialogResult values. OK is returned if the dialog was shown and
+ * the refactoring change was applied; CANCELED is returned if the refactoring was
+ * cancelled. SKIPPED is returned if the dialog was skipped in CONDITIONAL_PREVIEW mode and
+ * the refactoring change has not been applied yet.
+ */
+ static DialogResult openDialog(Shell shell, CRenameRefactoring refactoring, final DialogMode mode) {
+ try {
+ final boolean[] dialogSkipped = new boolean[1];
+ CRenameRefactoringWizard wizard;
+ if (mode == DialogMode.ALL_PAGES) {
+ wizard = new CRenameRefactoringWizard(refactoring);
+ } else {
+ wizard = new CRenameRefactoringWizard(refactoring) {
+ @Override
+ protected void addUserInputPages() {
+ // Nothing to add
+ }
+
+ @Override
+ public IWizardPage getStartingPage() {
+ IWizardPage startingPage = super.getStartingPage();
+ if (mode == DialogMode.CONDITIONAL_PREVIEW &&
+ !startingPage.getName().equals(ERROR_PAGE_NAME)) {
+ dialogSkipped[0] = true;
+ return null;
+ }
+ return startingPage;
+ }
+ };
+ wizard.setForcePreviewReview(mode != DialogMode.ALL_PAGES);
+ }
+ RefactoringStarter starter = new RefactoringStarter();
+ CRenameProcessor processor = (CRenameProcessor) refactoring.getProcessor();
+ processor.lockIndex();
+ try {
+ RefactoringStatus status = processor.checkInitialConditions(new NullProgressMonitor());
+ if (status.hasFatalError()) {
+ showInformation(shell, status);
+ return DialogResult.CANCELED;
+ }
+ if (starter.activate(wizard, shell, RenameMessages.CRefactory_title_rename,
+ processor.getSaveMode())) {
+ return DialogResult.OK;
+ }
+ if (dialogSkipped[0]) {
+ // If the dialog was not shown, it is our responsibility to close it.
+ wizard.getContainer().getShell().close();
+ return DialogResult.SKIPPED;
+ }
+ } finally {
+ processor.unlockIndex();
+ }
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ } catch (CoreException e) {
+ CUIPlugin.log(e);
+ }
+ return DialogResult.CANCELED;
}
/**
* @see #openDialog(Shell)
* @see IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
*/
- public void perform(Shell parent, IRunnableContext context) throws InterruptedException, InvocationTargetException {
+ public boolean perform(Shell parent, IWorkbenchWindow context) throws InterruptedException, InvocationTargetException {
try {
ensureChecked();
if (fPreCheckStatus.hasFatalError()) {
showInformation(parent, fPreCheckStatus);
- return;
+ return false;
}
CRenameProcessor renameProcessor = getRenameProcessor();
+ renameProcessor.lockIndex();
try {
- renameProcessor.lockIndex();
fPreCheckStatus = renameProcessor.checkInitialConditions(new NullProgressMonitor());
if (fPreCheckStatus.hasFatalError()) {
showInformation(parent, fPreCheckStatus);
- return;
+ return false;
+ }
+ DialogResult result = openDialog(context.getShell(), fRefactoring,
+ DialogMode.CONDITIONAL_PREVIEW);
+ switch (result) {
+ case OK:
+ return true;
+ case SKIPPED:
+ RefactoringExecutionHelper helper= new RefactoringExecutionHelper(fRefactoring,
+ RefactoringCore.getConditionCheckingFailedSeverity(),
+ renameProcessor.getSaveMode(), parent, context);
+ Change change = renameProcessor.getChange();
+ Assert.isNotNull(change);
+ helper.performChange(change, true);
+ return true;
+ default:
+ return false;
}
- RefactoringExecutionHelper helper= new RefactoringExecutionHelper(fRefactoring,
- RefactoringCore.getConditionCheckingFailedSeverity(), renameProcessor.getSaveMode(),
- parent, context);
- helper.perform(true, true);
} finally {
renameProcessor.unlockIndex();
}
}
}
- private void showInformation(Shell parent, RefactoringStatus status) {
+ private static void showInformation(Shell parent, RefactoringStatus status) {
String message= status.getMessageMatchingSeverity(RefactoringStatus.FATAL);
MessageDialog.openInformation(parent, RenameMessages.RenameSupport_dialog_title, message);
}
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
- * Sergey Prigogin (Google)
+ * Markus Schorn - initial API and implementation
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.ui.refactoring.rename;
import org.eclipse.search.core.text.TextSearchRequestor;
import org.eclipse.search.core.text.TextSearchScope;
import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
import org.eclipse.cdt.core.model.CoreModel;
public final static int SCOPE_WORKING_SET = 5;
private static class SearchScope extends TextSearchScope {
- public static SearchScope newSearchScope(IWorkingSet ws, IResource[] filter) {
+ public static SearchScope newSearchScope(IFile[] files, IWorkingSet ws) {
IAdaptable[] adaptables= ws.getElements();
ArrayList<IResource> resources = new ArrayList<IResource>();
for (int i = 0; i < adaptables.length; i++) {
IAdaptable adaptable = adaptables[i];
- IResource r= (IResource) adaptable.getAdapter(IResource.class);
- if (r != null) {
- resources.add(r);
+ IResource resource= (IResource) adaptable.getAdapter(IResource.class);
+ if (resource != null) {
+ resources.add(resource);
}
}
- return newSearchScope(resources.toArray(new IResource[resources.size()]), filter);
+ return newSearchScope(files, resources.toArray(new IResource[resources.size()]));
}
- public static SearchScope newSearchScope(IResource[] roots, IResource[] filter) {
- if (filter != null) {
- ArrayList<IResource> files = new ArrayList<IResource>(filter.length);
- for (IResource file : filter) {
- if (isInForest(file, roots)) {
- files.add(file);
+ public static SearchScope newSearchScope(IFile[] files, IResource[] roots) {
+ if (files != null) {
+ ArrayList<IResource> resources = new ArrayList<IResource>(files.length + roots.length);
+ for (IFile file : files) {
+ if (!isInForest(file, roots)) {
+ resources.add(file);
}
}
- roots = files.toArray(new IResource[files.size()]);
+ Collections.addAll(resources, roots);
+ roots = resources.toArray(new IResource[resources.size()]);
}
return new SearchScope(roots);
}
public TextSearchWrapper() {
}
- private TextSearchScope createSearchScope(IFile file, int scope, String workingSetName,
- IResource[] filter, String[] patterns) {
+ private TextSearchScope createSearchScope(IFile[] files, int scope, IFile file,
+ String workingSetName, String[] patterns) {
switch (scope) {
case SCOPE_WORKSPACE:
- return defineSearchScope(file.getWorkspace().getRoot(), filter, patterns);
+ return defineSearchScope(files, file.getWorkspace().getRoot(), patterns);
case SCOPE_SINGLE_PROJECT:
- return defineSearchScope(file.getProject(), filter, patterns);
+ return defineSearchScope(files, file.getProject(), patterns);
case SCOPE_FILE:
- return defineSearchScope(file, filter, patterns);
+ return defineSearchScope(files, file, patterns);
case SCOPE_WORKING_SET: {
- TextSearchScope result= defineWorkingSetAsSearchScope(workingSetName, filter, patterns);
- if (result == null) {
- result= defineSearchScope(file.getWorkspace().getRoot(), filter, patterns);
- }
- return result;
+ return defineWorkingSetAsSearchScope(files, workingSetName, patterns);
}
}
- return defineRelatedProjectsAsSearchScope(file.getProject(), filter, patterns);
+ return defineRelatedProjectsAsSearchScope(files, file.getProject(), patterns);
}
- private TextSearchScope defineRelatedProjectsAsSearchScope(IProject project, IResource[] filter, String[] patterns) {
+ private TextSearchScope defineRelatedProjectsAsSearchScope(IFile[] files, IProject project, String[] patterns) {
HashSet<IProject> projects= new HashSet<IProject>();
LinkedList<IProject> workThrough= new LinkedList<IProject>();
workThrough.add(project);
while (!workThrough.isEmpty()) {
- IProject prj= workThrough.removeLast();
- if (projects.add(prj)) {
+ IProject proj= workThrough.removeLast();
+ if (projects.add(proj)) {
try {
- workThrough.addAll(Arrays.asList(prj.getReferencedProjects()));
- workThrough.addAll(Arrays.asList(prj.getReferencingProjects()));
+ workThrough.addAll(Arrays.asList(proj.getReferencedProjects()));
+ workThrough.addAll(Arrays.asList(proj.getReferencingProjects()));
} catch (CoreException e) {
// need to ignore
}
}
}
IResource[] roots= projects.toArray(new IResource[projects.size()]);
- return defineSearchScope(roots, filter, patterns);
+ return defineSearchScope(files, roots, patterns);
}
- private TextSearchScope defineWorkingSetAsSearchScope(String workingSetName, IResource[] filter, String[] patterns) {
- if (workingSetName == null) {
- return null;
- }
- IWorkingSetManager wsManager= PlatformUI.getWorkbench().getWorkingSetManager();
- IWorkingSet ws= wsManager.getWorkingSet(workingSetName);
- if (ws == null) {
- return null;
- }
- SearchScope result= SearchScope.newSearchScope(ws, filter);
+ private TextSearchScope defineWorkingSetAsSearchScope(IFile[] files, String workingSetName, String[] patterns) {
+ IWorkingSet workingSet = workingSetName != null ?
+ PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(workingSetName) :
+ null;
+ SearchScope result= workingSet != null ?
+ SearchScope.newSearchScope(files, workingSet) :
+ SearchScope.newSearchScope(files, new IResource[0]);
applyFilePatterns(result, patterns);
return result;
}
private void applyFilePatterns(SearchScope scope, String[] patterns) {
- for (int i = 0; i < patterns.length; i++) {
- String pattern = patterns[i];
+ for (String pattern : patterns) {
scope.addFileNamePattern(pattern);
}
}
- private TextSearchScope defineSearchScope(IResource root, IResource[] filter, String[] patterns) {
- SearchScope result= SearchScope.newSearchScope(new IResource[] { root }, filter);
+ private TextSearchScope defineSearchScope(IFile[] files, IResource root, String[] patterns) {
+ SearchScope result= SearchScope.newSearchScope(files, new IResource[] { root });
applyFilePatterns(result, patterns);
return result;
}
- private TextSearchScope defineSearchScope(IResource[] roots, IResource[] filter, String[] patterns) {
- SearchScope result= SearchScope.newSearchScope(roots, filter);
+ private TextSearchScope defineSearchScope(IFile[] files, IResource[] roots, String[] patterns) {
+ SearchScope result= SearchScope.newSearchScope(files, roots);
applyFilePatterns(result, patterns);
return result;
}
/**
* Searches for a given word.
- *
- * @param scope One of SCOPE_FILE, SCOPE_WORKSPACE, SCOPE_RELATED_PROJECTS, SCOPE_SINGLE_PROJECT,
- * or SCOPE_WORKING_SET.
- * @param file The file used as an anchor for the scope.
- * @param workingSet The name of a working set. Ignored is scope is not SCOPE_WORKING_SET.
- * @param filter If not null, further limits the scope of the search.
+ *
+ * @param filesToSearch The files to search.
+ * @param scope Together with {@code file} and {@code workingSet} defines set of additional
+ * file to search. One of SCOPE_FILE, SCOPE_WORKSPACE, SCOPE_RELATED_PROJECTS,
+ * SCOPE_SINGLE_PROJECT, or SCOPE_WORKING_SET.
+ * @param scopeAnchor The file used as an anchor for the scope.
+ * @param workingSet The name of a working set. Ignored if {@code scope} is not
+ * SCOPE_WORKING_SET.
* @param patterns File name patterns.
* @param word The word to search for.
* @param monitor A progress monitor.
* @param target The list that gets populated with search results.
*/
- public IStatus searchWord(int scope, IFile file, String workingSet, IResource[] filter, String[] patterns,
- String word, IProgressMonitor monitor, final List<CRefactoringMatch> target) {
+ public IStatus searchWord(IFile[] filesToSearch, int scope, IFile scopeAnchor, String workingSet,
+ String[] patterns, String word, IProgressMonitor monitor,
+ final List<CRefactoringMatch> target) {
int startPos= target.size();
TextSearchEngine engine= TextSearchEngine.create();
StringBuilder searchPattern= new StringBuilder(word.length() + 8);
Pattern pattern= Pattern.compile(searchPattern.toString());
- TextSearchScope searchscope= createSearchScope(file, scope, workingSet, filter, patterns);
+ TextSearchScope searchscope= createSearchScope(filesToSearch, scope, scopeAnchor, workingSet, patterns);
TextSearchRequestor requestor= new TextSearchRequestor() {
@Override
public boolean acceptPatternMatch(TextSearchMatchAccess access) {
Token token;
int lastState= 0;
while ((token= scanner.nextToken()) != null) {
- int state= CRefactory.OPTION_IN_CODE;
+ int state= CRefactory.OPTION_IN_CODE_REFERENCES;
switch (token.getType()) {
case Token.tLINECOMMENT:
case Token.tBLOCKCOMMENT:
break;
}
if (state != lastState) {
- locations.add(new int[] {token.getOffset(), state});
+ locations.add(new int[] { token.getOffset(), state });
lastState= state;
}
}
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Institute for Software - initial API and implementation
+ * Institute for Software - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.ui.refactoring.utils;
import org.eclipse.cdt.internal.ui.editor.CEditor;
/**
- * A collection of helper methods to interact with the
- * workbench's IDocuments and IFiles
- *
+ * A collection of helper methods to interact with the workbench's IDocuments and IFiles
*/
public class EclipseObjects {
static public IWorkbenchPage getActivePage() {
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.ILanguage;
+import org.eclipse.cdt.core.model.IMethodDeclaration;
import org.eclipse.cdt.core.model.ISourceRange;
import org.eclipse.cdt.core.model.ISourceReference;
+import org.eclipse.cdt.core.model.IStructureDeclaration;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
if (uniqueElements.size() == 1) {
target= (ISourceReference) uniqueElements.get(0);
} else {
- if (OpenDeclarationsAction.sIsJUnitTest) {
- throw new RuntimeException("ambiguous input: " + uniqueElements.size()); //$NON-NLS-1$
+ if (uniqueElements.size() == 2) {
+ final ICElement e0 = uniqueElements.get(0);
+ final ICElement e1 = uniqueElements.get(1);
+ if (e0 instanceof IStructureDeclaration && e1 instanceof IMethodDeclaration) {
+ target= (ISourceReference) e1;
+ } else if (e1 instanceof IStructureDeclaration && e0 instanceof IMethodDeclaration) {
+ target= (ISourceReference) e0;
+ }
+ }
+ if (target == null) {
+ if (OpenDeclarationsAction.sIsJUnitTest) {
+ throw new RuntimeException("ambiguous input: " + uniqueElements.size()); //$NON-NLS-1$
+ }
+ ICElement[] elemArray= uniqueElements.toArray(new ICElement[uniqueElements.size()]);
+ target = (ISourceReference) OpenActionUtil.selectCElement(elemArray, fAction.getSite().getShell(),
+ CEditorMessages.OpenDeclarationsAction_dialog_title, CEditorMessages.OpenDeclarationsAction_selectMessage,
+ CElementLabels.ALL_DEFAULT | CElementLabels.ALL_FULLY_QUALIFIED | CElementLabels.MF_POST_FILE_QUALIFIED, 0);
}
- ICElement[] elemArray= uniqueElements.toArray(new ICElement[uniqueElements.size()]);
- target = (ISourceReference) OpenActionUtil.selectCElement(elemArray, fAction.getSite().getShell(),
- CEditorMessages.OpenDeclarationsAction_dialog_title, CEditorMessages.OpenDeclarationsAction_selectMessage,
- CElementLabels.ALL_DEFAULT | CElementLabels.ALL_FULLY_QUALIFIED | CElementLabels.MF_POST_FILE_QUALIFIED, 0);
}
if (target != null) {
ITranslationUnit tu= target.getTranslationUnit();
/*******************************************************************************
- * Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2011 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.PreferenceConstants;
+import org.eclipse.cdt.internal.ui.text.c.hover.SourceViewerInformationControl;
+
/**
* Abstract class for "quick" compare views in light-weight controls.
*
private ICompareInput fCompareInput;
private Color fBackgroundColor;
- private boolean fIsSystemBackgroundColor;
+ private boolean fIsSystemBackgroundColor = true;
private Label fTitleLabel;
}
private void initializeColors() {
- RGB bgRGB= getHoverBackgroundColorRGB();
+ IPreferenceStore store= CUIPlugin.getDefault().getPreferenceStore();
+ RGB bgRGB;
+ if (store.getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)) {
+ bgRGB= SourceViewerInformationControl.getVisibleBackgroundColor(getShell().getDisplay());
+ } else {
+ bgRGB= PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR);
+ }
if (bgRGB != null) {
fBackgroundColor= new Color(getShell().getDisplay(), bgRGB);
fIsSystemBackgroundColor= false;
}
}
- private RGB getHoverBackgroundColorRGB() {
- IPreferenceStore store= CUIPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)
- ? null
- : PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR);
- }
-
@Override
protected void createContent(Composite parent) {
initializeColors();
return false;
}
+ protected Color getBackgroundColor() {
+ return fBackgroundColor;
+ }
+
@Override
public void setInformation(String content) {
}
/*******************************************************************************
- * Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2011 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
import org.eclipse.cdt.ui.text.ICPartitions;
import org.eclipse.cdt.internal.ui.editor.CSourceViewer;
+import org.eclipse.cdt.internal.ui.text.c.hover.SourceViewerInformationControl;
/**
* Abstract class for "quick" source views in light-weight controls.
public abstract class AbstractSourceViewerInformationControl extends org.eclipse.jface.text.AbstractInformationControl implements IInformationControlExtension2, DisposeListener {
private ISourceViewer fSourceViewer;
-
private Color fBackgroundColor;
-
- private boolean fIsSystemBackgroundColor;
-
+ private boolean fIsSystemBackgroundColor = true;
private Font fTextFont;
-
private StyledText fText;
-
private Label fTitleLabel;
/**
}
private void initializeColors() {
- RGB bgRGB= getHoverBackgroundColorRGB();
+ IPreferenceStore store= CUIPlugin.getDefault().getPreferenceStore();
+ RGB bgRGB;
+ if (store.getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)) {
+ bgRGB= SourceViewerInformationControl.getVisibleBackgroundColor(getShell().getDisplay());
+ } else {
+ bgRGB= PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR);
+ }
if (bgRGB != null) {
fBackgroundColor= new Color(getShell().getDisplay(), bgRGB);
fIsSystemBackgroundColor= false;
}
}
- private RGB getHoverBackgroundColorRGB() {
- IPreferenceStore store= CUIPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)
- ? null
- : PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR);
- }
-
@Override
public void createContent(Composite parent) {
Composite content= new Composite(parent, SWT.NONE);
if ((flags & ICElementDelta.F_CONTENT) != 0) {
if (!fIsReconciling && isRelevantElement(delta.getElement())) {
// mark model changed, but don't update immediately
- fIndexerListener.ignoreChanges(false);
setCModelChanged(true);
- } else if (delta.getElement() instanceof ITranslationUnit) {
- fIndexerListener.ignoreChanges(true);
}
}
if ((flags & (
private class IndexerListener implements IIndexerStateListener, IIndexChangeListener {
private boolean fIndexChanged;
- private boolean fIgnoreChanges;
/*
* @see org.eclipse.cdt.core.index.IIndexerStateListener#indexChanged(org.eclipse.cdt.core.index.IIndexerStateEvent)
setCModelChanged(true);
}
}
- fIgnoreChanges= false;
}
}
- public void ignoreChanges(boolean ignore) {
- fIgnoreChanges= ignore;
- }
-
/*
* @see org.eclipse.cdt.core.index.IIndexChangeListener#indexChanged(org.eclipse.cdt.core.index.IIndexChangeEvent)
*/
public void indexChanged(IIndexChangeEvent event) {
if (!fIndexChanged && isRelevantProject(event.getAffectedProject())) {
- if (!fIgnoreChanges || event.isCleared() || event.isReloaded() || event.hasNewFile()) {
- fIndexChanged= true;
- }
+ fIndexChanged= true;
}
}
-
}
/** The reconciler's editor */
GridData gd= new GridData(GridData.BEGINNING | GridData.FILL_BOTH);
gd.heightHint= fMacroText.getLineHeight() * 2;
fMacroText.setLayoutData(gd);
- fMacroText.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
-
+
final Document doc= new Document();
CUIPlugin.getDefault().getTextTools().setupCDocument(doc);
sourceViewer.setDocument(doc);
String[] sourceLines= Strings.convertIntoLines(source);
String firstLine= sourceLines[0];
- if (firstLine.length() > 0 && !Character.isWhitespace(firstLine.charAt(0)))
- sourceLines[0]= ""; //$NON-NLS-1$
- Strings.trimIndentation(sourceLines, getTabWidth(), getTabWidth());
-
- if (!Character.isWhitespace(firstLine.charAt(0)))
- sourceLines[0]= firstLine;
+ boolean ignoreFirstLine = firstLine.length() > 0 && !Character.isWhitespace(firstLine.charAt(0));
+ Strings.trimIndentation(sourceLines, getTabWidth(), getTabWidth(), !ignoreFirstLine);
source = Strings.concatenate(sourceLines, delim);
return source;
/*******************************************************************************
- * Copyright (c) 2002, 2008 QNX Software Systems and others.
+ * Copyright (c) 2002, 2011 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * QNX Software Systems - Initial API and implementation
- * Anton Leherbauer (Wind River Systems)
+ * QNX Software Systems - Initial API and implementation
+ * Anton Leherbauer (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.ui.text.c.hover;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.texteditor.AbstractTextEditor;
+import org.eclipse.cdt.ui.CDTUITools;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.PreferenceConstants;
+import org.eclipse.cdt.ui.text.ICColorConstants;
import org.eclipse.cdt.ui.text.ICPartitions;
import org.eclipse.cdt.internal.ui.editor.CSourceViewer;
*/
private Font fStatusTextFont;
/**
+ * The color of the optional status text label or <code>null</code> if none.
+ */
+ private Color fStatusTextForegroundColor;
+ /**
* The width size constraint.
* @since 4.0
*/
GridData gd2= new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
fStatusField.setLayoutData(gd2);
- // Regarding the color see bug 41128
- fStatusField.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
+ RGB defaultColor= CDTUITools.getColorManager().getColor(ICColorConstants.C_DEFAULT).getRGB();
+ fStatusTextForegroundColor= new Color(fStatusField.getDisplay(), blend(fBackgroundColor.getRGB(), defaultColor, 0.56f));
+ fStatusField.setForeground(fStatusTextForegroundColor);
fStatusField.setBackground(fBackgroundColor);
}
addDisposeListener(this);
}
+ /**
+ * Returns an RGB that lies between the given foreground and background
+ * colors using the given mixing factor. A <code>factor</code> of 1.0 will produce a
+ * color equal to <code>fg</code>, while a <code>factor</code> of 0.0 will produce one
+ * equal to <code>bg</code>.
+ * @param bg the background color
+ * @param fg the foreground color
+ * @param factor the mixing factor, must be in [0, 1]
+ *
+ * @return the interpolated color
+ */
+ @SuppressWarnings("null")
+ private static RGB blend(RGB bg, RGB fg, float factor) {
+ // copy of org.eclipse.jface.internal.text.revisions.Colors#blend(..)
+ Assert.isLegal(bg != null);
+ Assert.isLegal(fg != null);
+ Assert.isLegal(factor >= 0f && factor <= 1f);
+
+ float complement= 1f - factor;
+ return new RGB(
+ (int) (complement * bg.red + factor * fg.red),
+ (int) (complement * bg.green + factor * fg.green),
+ (int) (complement * bg.blue + factor * fg.blue)
+ );
+ }
+
private void initializeColors() {
- RGB bgRGB= getHoverBackgroundColorRGB();
+ IPreferenceStore store= CUIPlugin.getDefault().getPreferenceStore();
+ RGB bgRGB;
+ if (store.getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)) {
+ bgRGB= getVisibleBackgroundColor(fShell.getDisplay());
+ } else {
+ bgRGB= PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR);
+ }
if (bgRGB != null) {
fBackgroundColor= new Color(fShell.getDisplay(), bgRGB);
fIsSystemBackgroundColor= false;
}
}
- private RGB getHoverBackgroundColorRGB() {
- IPreferenceStore store= CUIPlugin.getDefault().getPreferenceStore();
- return store.getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)
- ? null
- : PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR);
+ /**
+ * Returns <code>null</code> if {@link SWT#COLOR_INFO_BACKGROUND} is visibly distinct from the
+ * default source text color. Otherwise, returns the editor background color.
+ *
+ * @param display the display
+ * @return an RGB or <code>null</code>
+ */
+ public static RGB getVisibleBackgroundColor(Display display) {
+ float[] infoBgHSB= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB().getHSB();
+
+ Color defaultColor= CDTUITools.getColorManager().getColor(ICColorConstants.C_DEFAULT);
+ RGB defaultRGB= defaultColor != null ? defaultColor.getRGB() : new RGB(255, 255, 255);
+ float[] defaultHSB= defaultRGB.getHSB();
+
+ if (Math.abs(infoBgHSB[2] - defaultHSB[2]) < 0.5f) {
+ // workaround for dark tooltip background color, see https://bugs.eclipse.org/365051
+ IPreferenceStore preferenceStore= CUIPlugin.getDefault().getCombinedPreferenceStore();
+ boolean useDefault= preferenceStore.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT);
+ if (useDefault)
+ return display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB();
+ return PreferenceConverter.getColor(preferenceStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
+ }
+ return null;
}
/**
if (fStatusTextFont != null && !fStatusTextFont.isDisposed())
fStatusTextFont.dispose();
+ if (fStatusTextForegroundColor != null && !fStatusTextForegroundColor.isDisposed())
+ fStatusTextForegroundColor.dispose();
+
+ fStatusTextForegroundColor= null;
fStatusTextFont= null;
fTextFont= null;
fShell= null;
final int prefixLength = namePrefix.length();
final IProject project= tu.getCProject().getProject();
File[] files= fileDir.listFiles();
+ if (files == null) {
+ return;
+ }
IContentAssistMatcher matcher = ContentAssistMatcherFactory.getInstance().createMatcher(namePrefix);
for (File file : files) {
final String name= file.getName();
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
IDocument document= viewer.getDocument();
Point selection= viewer.getSelectedRange();
- boolean multipleLinesSelected= areMultipleLinesSelected(viewer);
- if (multipleLinesSelected) {
+ boolean linesSelected= areLinesSelected(viewer);
+ boolean showLineSelectionTemplates = linesSelected;
+ boolean showWordSelectionTemplates = !linesSelected || isOnlyWordOnLine(viewer);
+ if (linesSelected) {
// adjust line selection to start at column 1 and end at line delimiter
try {
IRegion startLine = document.getLineInformationOfOffset(selection.x);
} else {
- if (multipleLinesSelected || context.getKey().length() == 0)
+ if (linesSelected || context.getKey().length() == 0)
context.setForceEvaluation(true);
for (int i= 0; i != templates.length; i++) {
Template template= templates[i];
if (context.canEvaluate(template) &&
template.getContextTypeId().equals(context.getContextType().getId()) &&
- (!multipleLinesSelected && template.getPattern().indexOf($_WORD_SELECTION) != -1 || (multipleLinesSelected && template.getPattern().indexOf($_LINE_SELECTION) != -1)))
+ ((showWordSelectionTemplates && template.getPattern().indexOf($_WORD_SELECTION) != -1 ||
+ (showLineSelectionTemplates && template.getPattern().indexOf($_LINE_SELECTION) != -1))))
{
fProposals.add(new CTemplateProposal(templates[i], context, region, image));
}
*
* @return <code>true</code> if one or multiple lines are selected
*/
- private boolean areMultipleLinesSelected(ITextViewer viewer) {
+ private boolean areLinesSelected(ITextViewer viewer) {
if (viewer == null)
return false;
return false;
}
}
+
+ /**
+ * Returns <code>true</code> if there's only one word on the line
+ *
+ * @return <code>true</code> if only one word is on the line
+ */
+ private boolean isOnlyWordOnLine(ITextViewer viewer) {
+ if (viewer == null)
+ return false;
+
+ Point s= viewer.getSelectedRange();
+ if (s.y == 0)
+ return false;
+
+ try {
+
+ IDocument document= viewer.getDocument();
+ int startLine= document.getLineOfOffset(s.x);
+ IRegion line= document.getLineInformation(startLine);
+
+ String lineContent = document.get(line.getOffset(), line.getLength());
+
+ return lineContent.trim().lastIndexOf(' ', s.x) == -1;
+
+ } catch (BadLocationException x) {
+ return false;
+ }
+ }
}
package org.eclipse.cdt.internal.ui.viewsupport;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jface.preference.JFacePreferences;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.IDecoration;
* renders the label using the qualifier (gray) color.
*/
public class ExcludedFileDecorator implements ILightweightLabelDecorator {
-
public void decorate(Object element, IDecoration decoration) {
- if (element instanceof IFile) {
- IFile resource = (IFile) element;
+ if (element instanceof IFile || element instanceof IFolder) {
+ IResource resource = (IResource) element;
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
ICProjectDescription desc = mngr.getProjectDescription(resource.getProject(), false);
if (desc == null)
return;
ICConfigurationDescription conf = desc.getDefaultSettingConfiguration();
ICSourceEntry[] entries = conf.getSourceEntries();
- boolean isSource = false;
+ boolean isUnderSourceRoot = false;
for (ICSourceEntry icSourceEntry : entries) {
if (icSourceEntry.getFullPath().isPrefixOf(resource.getFullPath())) {
- isSource = true;
+ isUnderSourceRoot = true;
break;
}
}
// Only bother to mark items that would be included otherwise
- if (isSource && CDataUtil.isExcluded(resource.getFullPath(), entries)) {
+ if (isUnderSourceRoot && CDataUtil.isExcluded(resource.getFullPath(), entries)) {
decoration.addOverlay(CPluginImages.DESC_OVR_INACTIVE);
- decoration.setForegroundColor(JFaceResources.getColorRegistry().get(
- JFacePreferences.QUALIFIER_COLOR));
+ decoration.setForegroundColor(JFaceResources.getColorRegistry().get(JFacePreferences.QUALIFIER_COLOR));
}
}
}
public void removeListener(ILabelProviderListener listener) {
// We don't track state changes
}
-}
\ No newline at end of file
+}
package org.eclipse.cdt.internal.ui.wizards.classwizard;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.cdt.core.browser.ITypeReference;
import org.eclipse.cdt.core.browser.QualifiedTypeName;
import org.eclipse.cdt.core.formatter.CodeFormatter;
+import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICContainer;
new SubProgressMonitor(monitor, 50));
if (headerFile != null) {
headerTU = (ITranslationUnit) CoreModel.getDefault().create(headerFile);
+ if (headerTU == null) {
+ throw new CodeGeneratorException("Failed to create " + headerFile); //$NON-NLS-1$
+ }
// Create a working copy with a new owner
headerWorkingCopy = headerTU.getWorkingCopy();
new SubProgressMonitor(monitor, 50));
if (sourceFile != null) {
sourceTU = (ITranslationUnit) CoreModel.getDefault().create(sourceFile);
+ if (sourceTU == null) {
+ throw new CodeGeneratorException("Failed to create " + sourceFile); //$NON-NLS-1$
+ }
monitor.worked(50);
// Create a working copy with a new owner
new SubProgressMonitor(monitor, 50));
if (testFile != null) {
testTU = (ITranslationUnit) CoreModel.getDefault().create(testFile);
+ if (testTU == null) {
+ throw new CodeGeneratorException("Failed to create " + testFile); //$NON-NLS-1$
+ }
monitor.worked(50);
// Create a working copy with a new owner
fCreatedTestTU = testTU;
}
+ } catch (CodeGeneratorException e) {
+ deleteAllCreatedFiles();
} finally {
if (headerWorkingCopy != null) {
headerWorkingCopy.destroy();
return fCreatedClass;
}
+ private void deleteAllCreatedFiles() {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ for (IPath path : new IPath[] { fHeaderPath, fSourcePath, fSourcePath }) {
+ if (path != null) {
+ try {
+ IFile file = root.getFile(path);
+ file.delete(true, null);
+ } catch (CoreException e) {
+ }
+ }
+ }
+ }
+
/**
* Format given source content according to the project's code style options.
*
*/
private String formatSource(String content, ITranslationUnit tu) throws CModelException {
String lineDelimiter= StubUtility.getLineDelimiterUsed(tu);
- TextEdit edit= CodeFormatterUtil.format(CodeFormatter.K_TRANSLATION_UNIT, content, 0, lineDelimiter,
- tu.getCProject().getOptions(true));
+ Map<String, Object> options = new HashMap<String, Object>(tu.getCProject().getOptions(true));
+ options.put(DefaultCodeFormatterConstants.FORMATTER_TRANSLATION_UNIT, tu);
+ TextEdit edit= CodeFormatterUtil.format(CodeFormatter.K_TRANSLATION_UNIT, content, 0,
+ lineDelimiter, options);
if (edit != null) {
IDocument doc= new Document(content);
try {
edit.apply(doc);
content= doc.get();
- } catch (MalformedTreeException exc) {
- CUIPlugin.log(exc);
- } catch (BadLocationException exc) {
- CUIPlugin.log(exc);
+ } catch (MalformedTreeException e) {
+ CUIPlugin.log(e);
+ } catch (BadLocationException e) {
+ CUIPlugin.log(e);
}
}
return content;
* IBM Corporation
* Markus Schorn (Wind River Systems)
* Warren Paul (Nokia) - 174238
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.ui.wizards.classwizard;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
}
return null;
}
+
+ //XXX Remove
+// /**
+// * Returns the parent source folder for the given resource. If the given
+// * resource is already a source folder, the corresponding C element is returned.
+// *
+// * @param resource the resource
+// * @return the source folder
+// */
+// public static ICContainer getSourceFolder(IResource resource) {
+// if (resource != null && resource.exists()) {
+// int resType = resource.getType();
+// if (resType == IResource.PROJECT || resType == IResource.FOLDER) {
+// ICElement elem = CoreModel.getDefault().create(resource.getFullPath());
+// if (elem != null) {
+// ICContainer sourceFolder = getSourceFolder(elem);
+// if (sourceFolder != null)
+// return sourceFolder;
+// }
+// } else {
+// return getSourceFolder(resource.getParent());
+// }
+// }
+// return null;
+// }
/**
- * Returns the parent source folder for the given resource. If the given
- * resource is already a source folder, the corresponding C element is returned.
+ * Checks if a given resource is under a source root.
*
* @param resource the resource
- * @return the source folder
+ * @return <code>true</code> if the resource is under one of the project source roots
*/
- public static ICContainer getSourceFolder(IResource resource) {
- if (resource != null && resource.exists()) {
- int resType = resource.getType();
- if (resType == IResource.PROJECT || resType == IResource.FOLDER) {
- ICElement elem = CoreModel.getDefault().create(resource.getFullPath());
- if (elem != null) {
- ICContainer sourceFolder = getSourceFolder(elem);
- if (sourceFolder != null)
- return sourceFolder;
- }
- } else {
- return getSourceFolder(resource.getParent());
- }
- }
- return null;
+ public static boolean isOnSourceRoot(IResource resource) {
+ IProject project = resource.getProject();
+ ICProject cProject = CoreModel.getDefault().create(project);
+ return cProject.isOnSourceRoot(resource);
}
-
+
+ /**
+ * Checks if a given file path is under a source root.
+ *
+ * @param path the file path
+ * @return <code>true</code> if the resource is under one of the project source roots
+ */
+ public static boolean isOnSourceRoot(IPath path) {
+ IFile file = getWorkspaceRoot().getFile(path);
+ return isOnSourceRoot(file);
+ }
+
/**
* Returns the first source root in the given project. If the project has
* no source roots as children, the project itself is returned.
private Combo fBuildConfigComboBox;
private ControlEnableState fEnableState;
private Group fBuildConfigGroup;
+ private int fLastScope;
public IndexerBlock(){
super(INDEXER_LABEL);
protected void onPreferenceScopeChange() {
int scope= computeScope();
- if (fCurrentProperties == null || scope != IndexerPreferences.SCOPE_PROJECT_PRIVATE) {
+ if (fCurrentProperties == null || scope == IndexerPreferences.SCOPE_INSTANCE
+ || (fLastScope == IndexerPreferences.SCOPE_INSTANCE
+ && scope == IndexerPreferences.SCOPE_PROJECT_SHARED)) {
Properties props= IndexerPreferences.getProperties(getProject(), scope);
String indexerId= props.getProperty(IndexerPreferences.KEY_INDEXER_ID);
}
}
fCurrentProperties= props;
+ } else {
+ fCurrentProperties.putAll(fCurrentPage.getProperties());
}
updateForNewProperties(scope);
updateBuildConfigForScope(scope);
+ fLastScope= scope;
}
private void updateForNewProperties(int scope) {
String indexerId= fCurrentProperties.getProperty(IndexerPreferences.KEY_INDEXER_ID);
- if (indexerId.equals(IPDOMManager.ID_NO_INDEXER)) {
+ if (IPDOMManager.ID_NO_INDEXER.equals(indexerId)) {
fEnableIndexer.setSelection(false);
} else {
fEnableIndexer.setSelection(true);
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
};
private static final Comparator<Object> comp = CDTListComparator.getInstance();
+ private static String selectedLanguage;
private final static Image IMG_FOLDER = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_FOLDER);
private final static Image IMG_INCLUDES_FOLDER = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_INCLUDES_FOLDER);
ICLanguageSetting langSetting = (ICLanguageSetting) items[0].getData();
if (langSetting != null) {
lang = langSetting;
+ selectedLanguage = getLanguageName(lang);
update();
}
}
if (rcDes == null || !canBeVisible()) return;
updateExport();
langTree.removeAll();
- TreeItem firstItem = null;
+ TreeItem selectedItem = null;
ls = getLangSetting(rcDes);
if (ls != null) {
Arrays.sort(ls, CDTListComparator.getInstance());
for (ICLanguageSetting langSetting : ls) {
if ((langSetting.getSupportedEntryKinds() & getKind()) != 0) {
TreeItem t = new TreeItem(langTree, SWT.NONE);
- String langId = langSetting.getLanguageId();
- if (langId != null && !langId.equals(EMPTY_STR)) {
- // Bug #178033: get language name via LangManager.
- ILanguageDescriptor langDes = LanguageManager.getInstance().getLanguageDescriptor(langId);
- if (langDes == null)
- langId = null;
- else
- langId = langDes.getName();
- }
- if (langId == null || langId.equals(EMPTY_STR))
- langId = langSetting.getName();
+ String langId = getLanguageName(langSetting);
t.setText(0, langId);
t.setData(langSetting);
- if (firstItem == null) {
- firstItem = t;
+ if (selectedItem == null
+ || (selectedLanguage != null && selectedLanguage.equals(langId))) {
+ selectedItem = t;
lang = langSetting;
}
}
}
- if (firstItem != null && table != null) {
- langTree.setSelection(firstItem);
+ if (selectedItem != null && table != null) {
+ langTree.setSelection(selectedItem);
}
}
update();
}
+ private String getLanguageName(ICLanguageSetting langSetting) {
+ String langId = langSetting.getLanguageId();
+ String langName = null;
+ if (langId != null && langId.length() != 0) {
+ // Bug #178033: get language name via LangManager.
+ ILanguageDescriptor langDes = LanguageManager.getInstance().getLanguageDescriptor(langId);
+ if (langDes != null)
+ langName = langDes.getName();
+ }
+ if (langName == null || langName.length() == 0)
+ langName = langSetting.getName();
+ if (langName == null || langName.length() == 0)
+ langName = langId;
+ return langName;
+ }
+
private void updateExport() {
exported = new ArrayList<ICSettingEntry>();
ICExternalSetting[] extSettings = getResDesc().getConfiguration().getExternalSettings();
import org.eclipse.cdt.internal.ui.refactoring.DocumentAdapter;
import org.eclipse.cdt.internal.ui.refactoring.UndoCTextFileChange;
-
/**
* A TextFileChange that uses a working copy in order to generate CModel events.
*
setTextType(TEXT_TYPE);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.TextFileChange#acquireDocument(org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
protected IDocument acquireDocument(IProgressMonitor pm) throws CoreException {
IDocument doc= super.acquireDocument(pm);
protected void commit(final IDocument document, final IProgressMonitor pm) throws CoreException {
if (fWorkingCopy == null) {
super.commit(document, pm);
- }
- else if (needsSaving()) {
+ } else if (needsSaving()) {
fWorkingCopy.commit(false, pm);
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.TextFileChange#releaseDocument(org.eclipse.jface.text.IDocument, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
protected void releaseDocument(IDocument document, IProgressMonitor pm) throws CoreException {
super.releaseDocument(document, pm);
}
}
}
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.TextFileChange#createUndoChange(org.eclipse.text.edits.UndoEdit, org.eclipse.ltk.core.refactoring.ContentStamp)
- */
+
@Override
protected Change createUndoChange(UndoEdit edit, ContentStamp stampToRestore) {
return new UndoCTextFileChange(getName(), getFile(), edit, stampToRestore, getSaveMode());
@SuppressWarnings({ "unchecked", "rawtypes" })
public List filterItems(List items) {
- List<EntryDescriptor> ret = new ArrayList<EntryDescriptor>();
-
- for(Object item: items) {
- if(item instanceof EntryDescriptor) {
- if(((EntryDescriptor)(item)).getId().contains("samsung") == true || ((EntryDescriptor)(item)).getId().contains("tizen") == true) {
- }
- else {
- ret.add((EntryDescriptor)item);
- }
- }
- }
- return ret;
+ return items;
}
}
}
/**
- * handles changes to the source folder field
+ * Handles changes to the source folder field
*/
private final class SourceFolderFieldAdapter implements IStringButtonAdapter, IDialogFieldListener {
public void changeControlPressed(DialogField field) {
IPath oldFolderPath = getSourceFolderFullPath();
IPath newFolderPath = chooseSourceFolder(oldFolderPath);
if (newFolderPath != null) {
- IPath headerPath = getHeaderFileFullPath();
- IPath sourcePath = getSourceFileFullPath();
setSourceFolderFullPath(newFolderPath, false);
- if (oldFolderPath != null && oldFolderPath.matchingFirstSegments(newFolderPath) == 0) {
- if (headerPath != null) {
- headerPath = newFolderPath.append(headerPath.lastSegment());
- }
- if (sourcePath != null) {
- sourcePath = newFolderPath.append(sourcePath.lastSegment());
- }
- }
- // adjust the relative paths
- setHeaderFileFullPath(headerPath, false);
- setSourceFileFullPath(sourcePath, false);
handleFieldChanged(SOURCE_FOLDER_ID|ALL_FIELDS);
}
}
}
status.setWarning(NewClassWizardMessages.NewClassCreationWizardPage_warning_NotInACProject);
}
- if (NewClassWizardUtil.getSourceFolder(res) == null) {
+ if (!NewClassWizardUtil.isOnSourceRoot(res)) {
status.setError(NLS.bind(NewClassWizardMessages.NewClassCreationWizardPage_error_NotASourceFolder, folderPath));
return status;
}
}
// Make sure the file location is under a source root
- if (NewClassWizardUtil.getSourceFolder(path) == null) {
+ if (!NewClassWizardUtil.isOnSourceRoot(path)) {
status.setError(NewClassWizardMessages.NewClassCreationWizardPage_error_HeaderFileNotInSourceFolder);
return status;
}
}
// Make sure the file location is under a source root
- if (NewClassWizardUtil.getSourceFolder(path) == null) {
+ if (!NewClassWizardUtil.isOnSourceRoot(path)) {
status.setError(NewClassWizardMessages.NewClassCreationWizardPage_error_SourceFileNotInSourceFolder);
return status;
}
}
// Make sure the file location is under a source root
- if (NewClassWizardUtil.getSourceFolder(path) == null) {
+ if (!NewClassWizardUtil.isOnSourceRoot(path)) {
status.setError(NewClassWizardMessages.NewClassCreationWizardPage_error_TestFileNotInSourceFolder);
return status;
}
fDialogSettings.put(KEY_STUB_SELECTED + i, fMethodStubsDialogField.isChecked(stub));
}
- fCreatedClass = null;
+ fCreatedClass = null;
fCreatedHeaderFile = null;
fCreatedSourceFile = null;
fCreatedTestFile = null;
IPath headerPath = getHeaderFileFullPath();
IPath sourcePath = getSourceFileFullPath();
IPath testPath = getTestFileFullPath();
- createClass(
- headerPath != null ? getCanonicalPath(headerPath) : null,
- sourcePath != null ? getCanonicalPath(sourcePath) : null,
- testPath != null ? getCanonicalPath(testPath) : null,
- getClassName(),
- namespace,
- getBaseClasses(),
- getSelectedMethodStubs(), monitor);
+ createClass(headerPath, sourcePath, testPath, getClassName(), namespace, getBaseClasses(),
+ getSelectedMethodStubs(), monitor);
}
- private IPath getCanonicalPath(IPath path) throws CoreException {
- IWorkspaceRoot root = NewClassWizardUtil.getWorkspaceRoot();
- IFile file = root.getFile(path);
- URI location = file.getLocationURI();
- URI canonicalLocation = EFS.getStore(location).toURI();
- IFile[] files = root.findFilesForLocationURI(canonicalLocation);
- if (files.length > 0) {
- return files[0].getFullPath();
- }
- return null;
- }
-
/**
* Returns whether the generated header and source files should be
* opened in editors after the finish button is pressed.