1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 00:45:28 +02:00

Bug Fixing

This commit is contained in:
Hoda Amer 2004-06-24 16:44:45 +00:00
parent 00bbe82978
commit 05ec4b4f52
2 changed files with 12 additions and 8 deletions

View file

@ -1,3 +1,6 @@
2004-06-24 Hoda Amer
A small fix to the New Class Wizard "link to file" option.
2004-06-24 Chris Wiebe
Fix for PR 48783 : [New Class Wizard] Err Create C++ Class with "Link to File" checkbox selected
Fix for PR 47571 : [New Class Wizard] resolved location can be blanked

View file

@ -180,6 +180,8 @@ public class NewClassWizardPage extends WizardPage implements Listener {
fConstDestButtons= new SelectionButtonDialogFieldGroup(SWT.CHECK, buttonNames2, 3);
fConstDestButtons.setDialogFieldListener(adapter);
fConstDestButtons.setSelection(1, true);
fConstDestButtons.setSelection(2, true);
linkedResourceGroupForHeader = new LinkToFileGroup(adapter, this);
linkedResourceGroupForHeader.setDialogFieldListener(adapter);
@ -778,10 +780,6 @@ public class NewClassWizardPage extends WizardPage implements Listener {
protected IFile createFileHandle(LinkToFileGroup linkedGroup, boolean isHeader) {
IWorkspaceRoot root= CUIPlugin.getWorkspace().getRoot();
if (linkedGroup.linkCreated()) {
IPath path = (isHeader) ? getHeaderFullPath() : getBodyFullPath();
return root.getFile(path);
}
IPath filePath = getContainerFullPath(linkedGroup);
IFile newFile = root.getFileForLocation(filePath);
if(newFile == null)
@ -933,8 +931,9 @@ public class NewClassWizardPage extends WizardPage implements Listener {
text.append(lineDelimiter);
text.append(lineDelimiter);
}
if(extendingBase){
// add the include statement if we are extending a base class
// and we are not already in the base class header file (via link to file option )
if((extendingBase) && (!(header.getElementName().equals(baseClassFileName)))){
text.append("#include "); //$NON-NLS-1$
if (systemIncludePath)
text.append('<'); //$NON-NLS-1$
@ -1006,8 +1005,10 @@ public class NewClassWizardPage extends WizardPage implements Listener {
protected String constructBodyFileContent(String lineDelimiter){
StringBuffer text = new StringBuffer();
text.append("#include \""); //$NON-NLS-1$
text.append(getCreatedClassHeaderFile().getElementName());
if(getCreatedClassHeaderFile() != null){
text.append("#include \""); //$NON-NLS-1$
text.append(getCreatedClassHeaderFile().getElementName());
}
text.append("\""); //$NON-NLS-1$
text.append(lineDelimiter);
text.append(lineDelimiter);