Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 252329 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsOperation.java (-1 / +28 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 252329
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.pde.internal.ui.nls;
12
package org.eclipse.pde.internal.ui.nls;
12
13
Lines 26-31 Link Here
26
import org.eclipse.pde.internal.core.schema.SchemaRegistry;
27
import org.eclipse.pde.internal.core.schema.SchemaRegistry;
27
import org.eclipse.pde.internal.core.text.IDocumentAttributeNode;
28
import org.eclipse.pde.internal.core.text.IDocumentAttributeNode;
28
import org.eclipse.pde.internal.core.text.IDocumentElementNode;
29
import org.eclipse.pde.internal.core.text.IDocumentElementNode;
30
import org.eclipse.pde.internal.core.text.plugin.PluginExtensionNode;
31
import org.eclipse.pde.internal.core.text.plugin.PluginExtensionPointNode;
29
import org.eclipse.pde.internal.ui.PDEUIMessages;
32
import org.eclipse.pde.internal.ui.PDEUIMessages;
30
import org.eclipse.pde.internal.ui.util.ModelModification;
33
import org.eclipse.pde.internal.ui.util.ModelModification;
31
import org.eclipse.pde.internal.ui.util.PDEModelUtility;
34
import org.eclipse.pde.internal.ui.util.PDEModelUtility;
Lines 130-138 Link Here
130
			if (schema != null)
133
			if (schema != null)
131
				inspectExtension(schema, extensions[i], model, file);
134
				inspectExtension(schema, extensions[i], model, file);
132
		}
135
		}
136
137
		IPluginExtensionPoint[] extensionPoints = model.getPluginBase().getExtensionPoints();
138
		for (int i = 0; i < extensionPoints.length; i++) {
139
			inspectExtensionPoint(extensionPoints[i], model, file);
140
		}
133
	}
141
	}
134
142
135
	private void inspectExtension(ISchema schema, IPluginParent parent, IPluginModelBase memModel, IFile file) {
143
	private void inspectExtension(ISchema schema, IPluginParent parent, IPluginModelBase memModel, IFile file) {
144
		if (parent instanceof PluginExtensionNode) {
145
			PluginExtensionNode parentNode = (PluginExtensionNode) parent;
146
			IDocumentAttributeNode[] attributes = parentNode.getNodeAttributes();
147
			ISchemaElement schemaElement = schema.findElement(parentNode.getXMLTagName());
148
			for (int j = 0; j < attributes.length; j++) {
149
				IPluginAttribute attr = (IPluginAttribute) attributes[j];
150
				ISchemaAttribute attInfo = schemaElement.getAttribute(attr.getName());
151
				if (attInfo != null && attInfo.isTranslatable())
152
					if (isNotTranslated(attr.getValue()))
153
						fModelChangeTable.addToChangeTable(memModel, file, attr, selected(file));
154
			}
155
		}
156
136
		IPluginObject[] children = parent.getChildren();
157
		IPluginObject[] children = parent.getChildren();
137
		for (int i = 0; i < children.length; i++) {
158
		for (int i = 0; i < children.length; i++) {
138
			IPluginElement child = (IPluginElement) children[i];
159
			IPluginElement child = (IPluginElement) children[i];
Lines 155-160 Link Here
155
		}
176
		}
156
	}
177
	}
157
178
179
	private void inspectExtensionPoint(IPluginExtensionPoint extensionPoint, IPluginModelBase memModel, IFile file) {
180
		if (extensionPoint instanceof PluginExtensionPointNode)
181
			if (isNotTranslated(extensionPoint.getName()))
182
				fModelChangeTable.addToChangeTable(memModel, file, ((PluginExtensionPointNode) extensionPoint).getNodeAttributesMap().get(IPluginObject.P_NAME), selected(file));
183
	}
184
158
	private boolean isNotTranslated(String value) {
185
	private boolean isNotTranslated(String value) {
159
		if (value == null)
186
		if (value == null)
160
			return false;
187
			return false;

Return to bug 252329