View | Details | Raw Unified | Return to bug 199169
Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/compare/ManifestStructureCreator.java (-3 / +6 lines)
Lines 92-97 Link Here
92
		args[1] = 0;	// and here the offset of the first character of the line 
92
		args[1] = 0;	// and here the offset of the first character of the line 
93
		
93
		
94
		try {
94
		try {
95
			String id = "Manifest"; //$NON-NLS-1$
96
			ManifestNode parent = new ManifestNode(root, 0, id,
97
					doc, 0, doc.getLength());
95
			monitor = beginWork(monitor);
98
			monitor = beginWork(monitor);
96
			StringBuffer headerBuffer = new StringBuffer();
99
			StringBuffer headerBuffer = new StringBuffer();
97
			int headerStart = 0;
100
			int headerStart = 0;
Lines 102-108 Link Here
102
					return;
105
					return;
103
					
106
					
104
				if (line.length() <= 0) {
107
				if (line.length() <= 0) {
105
					saveNode(root, doc, headerBuffer.toString(), headerStart); // empty line, save buffer to node
108
					saveNode(parent, doc, headerBuffer.toString(), headerStart); // empty line, save buffer to node
106
					continue;
109
					continue;
107
				}
110
				}
108
				if (line.charAt(0) == ' ') {
111
				if (line.charAt(0) == ' ') {
Lines 112-118 Link Here
112
				}
115
				}
113
				
116
				
114
				// save old buffer and start loading again
117
				// save old buffer and start loading again
115
				saveNode(root, doc, headerBuffer.toString(), headerStart);
118
				saveNode(parent, doc, headerBuffer.toString(), headerStart);
116
				
119
				
117
				headerStart = lineStart;
120
				headerStart = lineStart;
118
				headerBuffer.replace(0, headerBuffer.length(), line);
121
				headerBuffer.replace(0, headerBuffer.length(), line);
Lines 138-144 Link Here
138
	private void saveNode(DocumentRangeNode root, IDocument doc, String header, int start) {
141
	private void saveNode(DocumentRangeNode root, IDocument doc, String header, int start) {
139
		if (header.length() > 0)
142
		if (header.length() > 0)
140
			new ManifestNode(
143
			new ManifestNode(
141
				root, 0, extractKey(header),
144
				root, 1, extractKey(header),
142
				doc, start, header.length());
145
				doc, start, header.length());
143
	}
146
	}
144
147
(-)src/org/eclipse/pde/internal/ui/compare/PluginStructureCreator.java (-2 / +9 lines)
Lines 27-32 Link Here
27
27
28
public class PluginStructureCreator extends StructureCreator {
28
public class PluginStructureCreator extends StructureCreator {
29
29
30
	public static final int ROOT = 0;
30
	public static final int LIBRARY = 1;
31
	public static final int LIBRARY = 1;
31
	public static final int IMPORT = 2;
32
	public static final int IMPORT = 2;
32
	public static final int EXTENSION_POINT = 3;
33
	public static final int EXTENSION_POINT = 3;
Lines 120-133 Link Here
120
		boolean isFragment = isFragment(input);
121
		boolean isFragment = isFragment(input);
121
		PluginModelBase model = createModel(input, document, isFragment);
122
		PluginModelBase model = createModel(input, document, isFragment);
122
		try {
123
		try {
123
			createChildren(rootNode, model, labelProvider, resources);
124
			String id = isFragment ? "fragment" : "plugin"; //$NON-NLS-1$ //$NON-NLS-2$
125
			ImageDescriptor icon = isFragment ? PDEPluginImages.DESC_FRAGMENT_MF_OBJ : PDEPluginImages.DESC_PLUGIN_MF_OBJ;
126
			PluginNode parent = new PluginNode(rootNode, ROOT, id,
127
					resources.createImage(icon), document, 0, document.getLength());
128
			createChildren(parent, model, labelProvider, resources);
124
		} finally {
129
		} finally {
125
			model.dispose();
130
			model.dispose();
126
		}
131
		}
127
	}
132
	}
128
	
133
	
129
	private boolean isFragment(Object input) {
134
	private boolean isFragment(Object input) {
130
		//TODO
135
		if (input instanceof ITypedElement &&
136
				((ITypedElement)input).getName().equals("fragment.xml")) //$NON-NLS-1$
137
			return true;
131
		return false;
138
		return false;
132
	}
139
	}
133
140

Return to bug 199169