mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 02:06:01 +02:00
disable source attachment for now
This commit is contained in:
parent
63dc1031e9
commit
13677b0555
5 changed files with 43 additions and 40 deletions
|
@ -61,7 +61,6 @@ abstract public class AbstractPathOptionBlock extends TabFolderOptionBlock imple
|
||||||
fBuildPathStatus = new StatusInfo();
|
fBuildPathStatus = new StatusInfo();
|
||||||
|
|
||||||
setOptionContainer(this);
|
setOptionContainer(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------- public api --------
|
// -------- public api --------
|
||||||
|
@ -111,7 +110,7 @@ abstract public class AbstractPathOptionBlock extends TabFolderOptionBlock imple
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cpathEntries != null) {
|
if (cpathEntries != null) {
|
||||||
newCPath = getFilteredEntries(cpathEntries, getFilteredTypes());
|
newCPath = getFilteredElements(cpathEntries, getFilteredTypes());
|
||||||
} else {
|
} else {
|
||||||
newCPath = new ArrayList();
|
newCPath = new ArrayList();
|
||||||
}
|
}
|
||||||
|
@ -122,7 +121,7 @@ abstract public class AbstractPathOptionBlock extends TabFolderOptionBlock imple
|
||||||
|
|
||||||
abstract protected void initialize(ICElement element, List cPaths);
|
abstract protected void initialize(ICElement element, List cPaths);
|
||||||
|
|
||||||
protected ArrayList getFilteredEntries(IPathEntry[] cPathEntries, int[] types) {
|
protected ArrayList getFilteredElements(IPathEntry[] cPathEntries, int[] types) {
|
||||||
ArrayList newCPath = new ArrayList();
|
ArrayList newCPath = new ArrayList();
|
||||||
for (int i = 0; i < cPathEntries.length; i++) {
|
for (int i = 0; i < cPathEntries.length; i++) {
|
||||||
IPathEntry curr = cPathEntries[i];
|
IPathEntry curr = cPathEntries[i];
|
||||||
|
|
|
@ -286,7 +286,7 @@ public class CPElement {
|
||||||
case IPathEntry.CDT_SOURCE:
|
case IPathEntry.CDT_SOURCE:
|
||||||
return new Object[] { findAttributeElement(EXCLUSION)};
|
return new Object[] { findAttributeElement(EXCLUSION)};
|
||||||
case IPathEntry.CDT_LIBRARY:
|
case IPathEntry.CDT_LIBRARY:
|
||||||
return new Object[] { findAttributeElement(SOURCEATTACHMENT) };
|
// return new Object[] { findAttributeElement(SOURCEATTACHMENT) };
|
||||||
case IPathEntry.CDT_INCLUDE:
|
case IPathEntry.CDT_INCLUDE:
|
||||||
case IPathEntry.CDT_MACRO:
|
case IPathEntry.CDT_MACRO:
|
||||||
return new Object[0];
|
return new Object[0];
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField;
|
||||||
import org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField;
|
import org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField;
|
||||||
import org.eclipse.core.resources.IFolder;
|
import org.eclipse.core.resources.IFolder;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.jface.viewers.StructuredSelection;
|
import org.eclipse.jface.viewers.StructuredSelection;
|
||||||
import org.eclipse.jface.viewers.Viewer;
|
import org.eclipse.jface.viewers.Viewer;
|
||||||
|
@ -34,7 +35,7 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
public class CPathContainerEntryPage extends CPathBasePage {
|
public class CPathContainerEntryPage extends CPathBasePage {
|
||||||
|
|
||||||
private ListDialogField fCPathList;
|
private ListDialogField fCPathList;
|
||||||
private ICProject fCurrJProject;
|
private ICProject fCurrCProject;
|
||||||
|
|
||||||
private TreeListDialogField fContainersList;
|
private TreeListDialogField fContainersList;
|
||||||
|
|
||||||
|
@ -72,7 +73,7 @@ public class CPathContainerEntryPage extends CPathBasePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(ICProject jproject) {
|
public void init(ICProject jproject) {
|
||||||
fCurrJProject = jproject;
|
fCurrCProject = jproject;
|
||||||
updateLibrariesList();
|
updateLibrariesList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +163,13 @@ public class CPathContainerEntryPage extends CPathBasePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasChildren(TreeListDialogField field, Object element) {
|
public boolean hasChildren(TreeListDialogField field, Object element) {
|
||||||
return (element instanceof CPElement || element instanceof CPElementGroup);
|
if (element instanceof CPElementGroup) {
|
||||||
|
return true;
|
||||||
|
} else if (element instanceof CPElement) {
|
||||||
|
return ((CPElement)element).getChildren().length != 0;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- IDialogFieldListener --------
|
// ---------- IDialogFieldListener --------
|
||||||
|
@ -293,7 +300,7 @@ public class CPathContainerEntryPage extends CPathBasePage {
|
||||||
}
|
}
|
||||||
Object elem = selElements.get(0);
|
Object elem = selElements.get(0);
|
||||||
if (fContainersList.getIndexOfElement(elem) != -1) {
|
if (fContainersList.getIndexOfElement(elem) != -1) {
|
||||||
((CPElement)elem).setExported(!((CPElement)elem).isExported()); // toggle export
|
((CPElement)elem).setExported(! ((CPElement)elem).isExported()); // toggle export
|
||||||
fContainersList.refresh(elem);
|
fContainersList.refresh(elem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,31 +317,31 @@ public class CPathContainerEntryPage extends CPathBasePage {
|
||||||
if (fContainersList.getIndexOfElement(elem) != -1) {
|
if (fContainersList.getIndexOfElement(elem) != -1) {
|
||||||
editElementEntry((CPElement)elem);
|
editElementEntry((CPElement)elem);
|
||||||
} else if (elem instanceof CPElementAttribute) {
|
} else if (elem instanceof CPElementAttribute) {
|
||||||
// editAttributeEntry((CPElementAttribute) elem);
|
editAttributeEntry((CPElementAttribute)elem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void editAttributeEntry(CPElementAttribute elem) {
|
private void editAttributeEntry(CPElementAttribute elem) {
|
||||||
// String key= elem.getKey();
|
String key = elem.getKey();
|
||||||
// if (key.equals(CPElement.SOURCEATTACHMENT)) {
|
if (key.equals(CPElement.SOURCEATTACHMENT)) {
|
||||||
// CPElement selElement= elem.getParent();
|
CPElement selElement = elem.getParent();
|
||||||
//
|
|
||||||
// IPath containerPath= null;
|
IPath containerPath = null;
|
||||||
// boolean applyChanges= false;
|
boolean applyChanges = false;
|
||||||
// Object parentContainer= selElement.getParentContainer();
|
Object parentContainer = selElement.getParentContainer();
|
||||||
// if (parentContainer instanceof CPElement) {
|
if (parentContainer instanceof CPElement) {
|
||||||
// containerPath= ((CPElement) parentContainer).getPath();
|
containerPath = ((CPElement)parentContainer).getPath();
|
||||||
// applyChanges= true;
|
applyChanges = true;
|
||||||
// }
|
}
|
||||||
// SourceAttachmentDialog dialog= new SourceAttachmentDialog(getShell(), selElement.getPathEntry(), containerPath,
|
// SourceAttachmentDialog dialog = new SourceAttachmentDialog(getShell(), (ILibraryEntry)selElement.getPathEntry(), containerPath,
|
||||||
// fCurrJProject, applyChanges);
|
// fCurrCProject, applyChanges);
|
||||||
// if (dialog.open() == Window.OK) {
|
// if (dialog.open() == Window.OK) {
|
||||||
// selElement.setAttribute(CPElement.SOURCEATTACHMENT, dialog.getSourceAttachmentPath());
|
// selElement.setAttribute(CPElement.SOURCEATTACHMENT, dialog.getSourceAttachmentPath());
|
||||||
// fContainersList.refresh();
|
// fContainersList.refresh();
|
||||||
// fCPathList.refresh(); // images
|
// fCPathList.refresh(); // images
|
||||||
// }
|
// }
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
private void editElementEntry(CPElement elem) {
|
private void editElementEntry(CPElement elem) {
|
||||||
CPElement[] res = null;
|
CPElement[] res = null;
|
||||||
|
@ -371,7 +378,7 @@ public class CPathContainerEntryPage extends CPathBasePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void containerPageDialogFieldChanged(DialogField field) {
|
private void containerPageDialogFieldChanged(DialogField field) {
|
||||||
if (fCurrJProject != null) {
|
if (fCurrCProject != null) {
|
||||||
// already initialized
|
// already initialized
|
||||||
updateCPathList();
|
updateCPathList();
|
||||||
}
|
}
|
||||||
|
@ -411,14 +418,14 @@ public class CPathContainerEntryPage extends CPathBasePage {
|
||||||
title = CPathEntryMessages.getString("ContainerEntryPage.ContainerDialog.edit.title"); //$NON-NLS-1$
|
title = CPathEntryMessages.getString("ContainerEntryPage.ContainerDialog.edit.title"); //$NON-NLS-1$
|
||||||
elem = existing.getPathEntry();
|
elem = existing.getPathEntry();
|
||||||
}
|
}
|
||||||
CPathContainerWizard wizard = new CPathContainerWizard(elem, fCurrJProject, getRawClasspath());
|
CPathContainerWizard wizard = new CPathContainerWizard(elem, fCurrCProject, getRawClasspath());
|
||||||
wizard.setWindowTitle(title);
|
wizard.setWindowTitle(title);
|
||||||
if (CPathContainerWizard.openWizard(getShell(), wizard) == Window.OK) {
|
if (CPathContainerWizard.openWizard(getShell(), wizard) == Window.OK) {
|
||||||
IPathEntry[] created = wizard.getContainers();
|
IPathEntry[] created = wizard.getContainers();
|
||||||
if (created != null) {
|
if (created != null) {
|
||||||
CPElement[] res = new CPElement[created.length];
|
CPElement[] res = new CPElement[created.length];
|
||||||
for (int i = 0; i < res.length; i++) {
|
for (int i = 0; i < res.length; i++) {
|
||||||
res[i] = new CPElement(fCurrJProject, IPathEntry.CDT_CONTAINER, created[i].getPath(), null);
|
res[i] = new CPElement(fCurrCProject, IPathEntry.CDT_CONTAINER, created[i].getPath(), null);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,8 @@ public class CPathLibraryEntryPage extends CPathBasePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasChildren(TreeListDialogField field, Object element) {
|
public boolean hasChildren(TreeListDialogField field, Object element) {
|
||||||
return (element instanceof CPElement);
|
// return (element instanceof CPElement);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- IDialogFieldListener --------
|
// ---------- IDialogFieldListener --------
|
||||||
|
|
|
@ -33,8 +33,6 @@ public class CPathTabBlock extends AbstractPathOptionBlock {
|
||||||
private CPathContainerEntryPage fContainerPage;
|
private CPathContainerEntryPage fContainerPage;
|
||||||
private CPathLibraryEntryPage fLibrariesPage;
|
private CPathLibraryEntryPage fLibrariesPage;
|
||||||
|
|
||||||
// private CPathOrderExportPage fOrderExportPage;
|
|
||||||
|
|
||||||
private class BuildPathAdapter implements IDialogFieldListener {
|
private class BuildPathAdapter implements IDialogFieldListener {
|
||||||
|
|
||||||
// ---------- IDialogFieldListener --------
|
// ---------- IDialogFieldListener --------
|
||||||
|
@ -86,8 +84,6 @@ public class CPathTabBlock extends AbstractPathOptionBlock {
|
||||||
addPage(fLibrariesPage);
|
addPage(fLibrariesPage);
|
||||||
fContainerPage = new CPathContainerEntryPage(fCPathList);
|
fContainerPage = new CPathContainerEntryPage(fCPathList);
|
||||||
addPage(fContainerPage);
|
addPage(fContainerPage);
|
||||||
// fOrderExportPage = new CPathOrderExportPage(fCPathList);
|
|
||||||
// addPage(fOrderExportPage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue