Index: org/eclipse/pde/internal/ui/nls/InternationalizeWizard.java =================================================================== --- org/eclipse/pde/internal/ui/nls/InternationalizeWizard.java (revision 0) +++ org/eclipse/pde/internal/ui/nls/InternationalizeWizard.java (revision 137) @@ -0,0 +1,180 @@ +package org.eclipse.pde.internal.ui.nls; + +import java.util.*; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.*; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.*; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.wizard.IWizardPage; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.osgi.service.resolver.BundleDescription; +import org.eclipse.pde.core.plugin.IPluginModelBase; +import org.eclipse.pde.internal.core.plugin.ExternalPluginModel; +import org.eclipse.pde.internal.ui.*; +import org.eclipse.pde.internal.ui.launcher.BundleLauncherHelper; +import org.eclipse.pde.internal.ui.wizards.imports.BaseImportWizardSecondPage; +import org.eclipse.ui.IImportWizard; +import org.eclipse.ui.IWorkbench; + +public class InternationalizeWizard extends Wizard implements IImportWizard { + + private static final String STORE_SECTION = "InternationalizeWizard"; //$NON-NLS-1$ + + private IAction action; + private IStructuredSelection selection; + private IStructuredSelection externalizeSelection; + private InternationalizeWizardPluginPage page1; + private InternationalizeWizardLocalePage page2; + private InternationalizeModelTable fInternationalizePluginModelTable; + private InternationalizeModelTable fInternationalizeLocaleModelTable; + + public InternationalizeWizard(IAction action, InternationalizeModelTable pluginTable) { + fInternationalizePluginModelTable = pluginTable; + populateLocaleModelTable(); + IDialogSettings masterSettings = PDEPlugin.getDefault().getDialogSettings(); + setDialogSettings(getSettingsSection(masterSettings)); + setDefaultPageImageDescriptor(PDEPluginImages.DESC_EXTSTR_WIZ); + setWindowTitle(PDEUIMessages.InternationalizeWizard_title); + this.action = action; + } + + private void populateLocaleModelTable() { + fInternationalizeLocaleModelTable = new InternationalizeModelTable(); + for (Locale locale : Locale.getAvailableLocales()) { + fInternationalizeLocaleModelTable.addModel(locale); + } + } + + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.selection = selection; + externalizeSelection = this.selection; + } + + public void addPages() { + setNeedsProgressMonitor(true); + page1 = new InternationalizeWizardPluginPage(fInternationalizePluginModelTable, "Plug-ins"); //$NON-NLS-1$ + addPage(page1); + + page2 = new InternationalizeWizardLocalePage(fInternationalizeLocaleModelTable, "Locales"); //$NON-NLS-1$ + addPage(page2); + } + + private IDialogSettings getSettingsSection(IDialogSettings master) { + IDialogSettings setting = master.getSection(STORE_SECTION); + if (setting == null) { + setting = master.addNewSection(STORE_SECTION); + } + return setting; + } + + private List getPluginModelsForInternationalization() { + return page1.getModelsToInternationalize(); + } + + private List getLocalesForInternationalization() { + return page2.getLocalesForInternationalization(); + } + + public boolean performFinish() { + page1.storeSettings(); + ((BaseImportWizardSecondPage) page1.getNextPage()).storeSettings(); + ArrayList pluginModels = (ArrayList) getPluginModelsForInternationalization(); + final IPluginModelBase[] plugins = (IPluginModelBase[]) pluginModels.toArray(new IPluginModelBase[pluginModels.size()]); + + ArrayList localeModels = (ArrayList) getLocalesForInternationalization(); + final Locale[] locales = (Locale[]) localeModels.toArray(new IPluginModelBase[pluginModels.size()]); + + int launchedConfiguration = getConflictingConfigurationsCount(plugins); + if (launchedConfiguration > 0) { + String message = launchedConfiguration == 1 ? PDEUIMessages.PluginImportWizard_runningConfigDesc : PDEUIMessages.PluginImportWizard_runningConfigsDesc; + MessageDialog dialog = new MessageDialog(getShell(), PDEUIMessages.PluginImportWizard_runningConfigsTitle, null, message, MessageDialog.WARNING, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0); + if (dialog.open() != IDialogConstants.OK_ID) + return false; + + } + return true; + } + + // TODO to be eventually removed + private int getConflictingConfigurationsCount(IPluginModelBase[] modelsToImport) { + ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); + int count = 0; + ILaunch[] launches = launchManager.getLaunches(); + HashSet imported = new HashSet((4 * modelsToImport.length) / 3 + 1); + for (int j = 0; j < modelsToImport.length; ++j) { + BundleDescription bd = modelsToImport[j].getBundleDescription(); + if (bd != null) { + imported.add(bd.getSymbolicName()); + } + } + for (int i = 0; i < launches.length; ++i) { + if (!launches[i].isTerminated()) { + ILaunchConfiguration configuration = launches[i].getLaunchConfiguration(); + if (configuration == null) + continue; + try { + Map workspaceBundleMap = BundleLauncherHelper.getWorkspaceBundleMap(configuration, null); + for (Iterator iter = workspaceBundleMap.keySet().iterator(); iter.hasNext();) { + IPluginModelBase bm = (IPluginModelBase) iter.next(); + BundleDescription description = bm.getBundleDescription(); + if (description != null) { + if (imported.contains(description.getSymbolicName())) { + ++count; + break; + } + } + + } + } catch (CoreException e) { + ++count; + } + } + } + return count; + } + + public IWizardPage getNextPage(IWizardPage page) { + if (page.equals(page1)) { + //page.setVisible(false); + ensurePluginsAreExternalized(); + //page.setVisible(true); + + return page2; + } + return page; + } + + public IWizardPage getPreviousPage(IWizardPage page) { + return page.equals(page1) ? null : page1; + } + + public boolean canFinish() { + return !page1.isCurrentPage() && page1.getNextPage().isPageComplete(); + } + + public void ensurePluginsAreExternalized() { + GetNonExternalizedStringsAction externalize = new GetNonExternalizedStringsAction(); + + List projects = new ArrayList(); + List pluginModels = getPluginModelsForInternationalization(); + selection = new StructuredSelection(pluginModels); + for (IPluginModelBase pluginModel : pluginModels) { + if (!(pluginModel instanceof ExternalPluginModel)) { + IProject project = pluginModel.getUnderlyingResource().getProject(); + projects.add(project); + } + } + externalizeSelection = new StructuredSelection(projects); + externalize.selectionChanged(action, externalizeSelection); + externalize.setExternalizeSelectedPluginsOnly(true); + externalize.setSkipMessageDialog(true); + externalize.run(action); + } + + public boolean performCancel() { + return super.performCancel(); + } +} \ No newline at end of file Index: org/eclipse/pde/internal/ui/nls/InternationalizeOperation.java =================================================================== --- org/eclipse/pde/internal/ui/nls/InternationalizeOperation.java (revision 0) +++ org/eclipse/pde/internal/ui/nls/InternationalizeOperation.java (revision 137) @@ -0,0 +1,89 @@ +package org.eclipse.pde.internal.ui.nls; + +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.pde.core.plugin.IPluginModelBase; +import org.eclipse.pde.core.plugin.PluginRegistry; +import org.eclipse.pde.internal.core.WorkspaceModelManager; +import org.eclipse.pde.internal.ui.PDEUIMessages; + +/** + * TODO: Azure Documentation + * @author Haytham Y + * + */ +public class InternationalizeOperation implements IRunnableWithProgress { + + private ISelection fSelection; + private ArrayList fSelectedModels; + private InternationalizeModelTable fModelPluginTable; + private boolean fCanceled; + + /** + * TODO: Azure Documentation + * @param selection + */ + public InternationalizeOperation(ISelection selection) { + fSelection = selection; + } + + /** + * TODO: Azure Documentation + */ + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + + if (fSelection instanceof IStructuredSelection) { + Object[] elems = ((IStructuredSelection) fSelection).toArray(); + fSelectedModels = new ArrayList(elems.length); + for (int i = 0; i < elems.length; i++) { + if (elems[i] instanceof IFile) + elems[i] = ((IFile) elems[i]).getProject(); + + if (elems[i] instanceof IProject && WorkspaceModelManager.isPluginProject((IProject) elems[i]) && !WorkspaceModelManager.isBinaryProject((IProject) elems[i])) + fSelectedModels.add(elems[i]); + } + } + + //Get all models excluding fragment models + IPluginModelBase[] pluginModels = PluginRegistry.getAllModels(false); + monitor.beginTask(PDEUIMessages.GetNonExternalizedStringsOperation_taskMessage, pluginModels.length); + + //Populate list to a ModelPluginTable + fModelPluginTable = new InternationalizeModelTable(); + + for (int i = 0; i < pluginModels.length; i++) { + fModelPluginTable.addToModelTable(pluginModels[i], pluginModels[i].getUnderlyingResource() != null ? selected(pluginModels[i].getUnderlyingResource().getProject()) : false); + } + } + + /** + * TODO: Azure Documentation + * @return + */ + public boolean wasCanceled() { + return fCanceled; + } + + /** + * TODO: Azure Documentation + * @param project + * @return + */ + public boolean selected(IProject project) { + return fSelectedModels.contains(project); + } + + /** + * TODO: Azure Documentation + * @return + */ + public InternationalizeModelTable getPluginTable() { + return fModelPluginTable; + } +} Index: org/eclipse/pde/internal/ui/nls/InternationalizeWizardOpenOperation.java =================================================================== --- org/eclipse/pde/internal/ui/nls/InternationalizeWizardOpenOperation.java (revision 0) +++ org/eclipse/pde/internal/ui/nls/InternationalizeWizardOpenOperation.java (revision 137) @@ -0,0 +1,74 @@ +package org.eclipse.pde.internal.ui.nls; + +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.Assert; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.jobs.IJobManager; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.window.Window; +import org.eclipse.jface.wizard.IWizardContainer; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.swt.custom.BusyIndicator; +import org.eclipse.swt.widgets.Shell; + +/** + * A helper class to open a refactoring wizard dialog. The class first checks + * the initial conditions of the refactoring and depending on its outcome + * the wizard dialog or an error dialog is shown. + *

+ * Note: this class is not intended to be extended by clients. + *

+ * + * @since 3.0 + */ +public class InternationalizeWizardOpenOperation { + + private InternationalizeWizard fWizard; + + /** + * Creates a new refactoring wizard starter for the given wizard. + * + * @param wizard the wizard to open a dialog for + */ + public InternationalizeWizardOpenOperation(InternationalizeWizard wizard) { + Assert.isNotNull(wizard); + fWizard = wizard; + } + + public int run(final Shell parent, final String dialogTitle) throws InterruptedException { + Assert.isNotNull(dialogTitle); + final IJobManager manager = Job.getJobManager(); + final int[] result = new int[1]; + final InterruptedException[] canceled = new InterruptedException[1]; + Runnable r = new Runnable() { + public void run() { + try { + // we are getting the block dialog for free if we pass in null + manager.beginRule(ResourcesPlugin.getWorkspace().getRoot(), null); + + Dialog dialog = new WizardDialog(parent, fWizard); + dialog.create(); + IWizardContainer wizardContainer = (IWizardContainer) dialog; + if (wizardContainer.getCurrentPage() == null) + /* + * Don't show the dialog at all if there are no user + * input pages and change creation was cancelled. + */ + result[0] = Window.CANCEL; + else + result[0] = dialog.open(); + + } catch (OperationCanceledException e) { + canceled[0] = new InterruptedException(e.getMessage()); + } finally { + manager.endRule(ResourcesPlugin.getWorkspace().getRoot()); + } + } + }; + BusyIndicator.showWhile(parent.getDisplay(), r); + if (canceled[0] != null) + throw canceled[0]; + return result[0]; + } +} Index: org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsOperation.java =================================================================== --- org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsOperation.java (revision 73) +++ org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsOperation.java (revision 137) @@ -12,34 +12,18 @@ import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; - +import java.util.Iterator; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.core.runtime.*; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.pde.core.IBaseModel; -import org.eclipse.pde.core.plugin.IPluginAttribute; -import org.eclipse.pde.core.plugin.IPluginBase; -import org.eclipse.pde.core.plugin.IPluginElement; -import org.eclipse.pde.core.plugin.IPluginExtension; -import org.eclipse.pde.core.plugin.IPluginModelBase; -import org.eclipse.pde.core.plugin.IPluginObject; -import org.eclipse.pde.core.plugin.IPluginParent; -import org.eclipse.pde.core.plugin.ISharedExtensionsModel; -import org.eclipse.pde.core.plugin.PluginRegistry; -import org.eclipse.pde.internal.core.ICoreConstants; -import org.eclipse.pde.internal.core.PDECore; -import org.eclipse.pde.internal.core.WorkspaceModelManager; -import org.eclipse.pde.internal.core.ibundle.IBundle; -import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase; -import org.eclipse.pde.internal.core.ibundle.IManifestHeader; -import org.eclipse.pde.internal.core.ischema.ISchema; -import org.eclipse.pde.internal.core.ischema.ISchemaAttribute; -import org.eclipse.pde.internal.core.ischema.ISchemaElement; +import org.eclipse.pde.core.plugin.*; +import org.eclipse.pde.internal.core.*; +import org.eclipse.pde.internal.core.ibundle.*; +import org.eclipse.pde.internal.core.ischema.*; import org.eclipse.pde.internal.core.schema.SchemaRegistry; import org.eclipse.pde.internal.core.text.IDocumentAttributeNode; import org.eclipse.pde.internal.core.text.IDocumentElementNode; @@ -53,52 +37,71 @@ private ArrayList fSelectedModels; private ModelChangeTable fModelChangeTable; private boolean fCanceled; - - public GetNonExternalizedStringsOperation(ISelection selection) { + + //Azure: To indicate that only selected plug-ins under fSelection are to be externalized. + private boolean fExternalizeSelectedPluginsOnly; + + public GetNonExternalizedStringsOperation(ISelection selection, boolean externalizeSelectedPluginsOnly) { fSelection = selection; + fExternalizeSelectedPluginsOnly = externalizeSelectedPluginsOnly; } public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - + if (fSelection instanceof IStructuredSelection) { Object[] elems = ((IStructuredSelection) fSelection).toArray(); fSelectedModels = new ArrayList(elems.length); for (int i = 0; i < elems.length; i++) { if (elems[i] instanceof IFile) elems[i] = ((IFile) elems[i]).getProject(); - - if (elems[i] instanceof IProject - && WorkspaceModelManager.isPluginProject((IProject)elems[i]) - && !WorkspaceModelManager.isBinaryProject((IProject)elems[i])) + + if (elems[i] instanceof IProject && WorkspaceModelManager.isPluginProject((IProject) elems[i]) && !WorkspaceModelManager.isBinaryProject((IProject) elems[i])) fSelectedModels.add(elems[i]); } - + fModelChangeTable = new ModelChangeTable(); - - IPluginModelBase[] pluginModels = PluginRegistry.getWorkspaceModels(); - monitor.beginTask(PDEUIMessages.GetNonExternalizedStringsOperation_taskMessage, pluginModels.length); - for (int i = 0; i < pluginModels.length && !fCanceled; i++) { - IProject project = pluginModels[i].getUnderlyingResource().getProject(); - if (!WorkspaceModelManager.isBinaryProject(project)) - getUnExternalizedStrings(project, new SubProgressMonitor(monitor, 1)); + + /* + * Azure: This will add only the preselected plug-ins to the ModelChangeTable + * instead of adding the list of all plug-ins in the workspace. This is useful + * when the Internationalize action is run on a set of non-externalized plug-ins + * where there is no need to display all non-externalized plug-ins in the + * workspace, but only those selected. + */ + if (fExternalizeSelectedPluginsOnly) { + monitor.beginTask(PDEUIMessages.GetNonExternalizedStringsOperation_taskMessage, fSelectedModels.size()); + Iterator iterator = fSelectedModels.iterator(); + while (iterator.hasNext() && !fCanceled) { + IProject project = (IProject) iterator.next(); + if (!WorkspaceModelManager.isBinaryProject(project)) + getUnExternalizedStrings(project, new SubProgressMonitor(monitor, 1)); + } + } else { + IPluginModelBase[] pluginModels = PluginRegistry.getWorkspaceModels(); + monitor.beginTask(PDEUIMessages.GetNonExternalizedStringsOperation_taskMessage, pluginModels.length); + for (int i = 0; i < pluginModels.length && !fCanceled; i++) { + IProject project = pluginModels[i].getUnderlyingResource().getProject(); + if (!WorkspaceModelManager.isBinaryProject(project)) + getUnExternalizedStrings(project, new SubProgressMonitor(monitor, 1)); + } } } } - + private void getUnExternalizedStrings(IProject project, IProgressMonitor monitor) { PDEModelUtility.modifyModel(new ModelModification(project) { protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (model instanceof IBundlePluginModelBase) - inspectManifest((IBundlePluginModelBase)model, monitor); - + inspectManifest((IBundlePluginModelBase) model, monitor); + if (monitor.isCanceled()) { fCanceled = true; return; } - + if (model instanceof IPluginModelBase) - inspectXML((IPluginModelBase)model, monitor); - + inspectXML((IPluginModelBase) model, monitor); + if (monitor.isCanceled()) { fCanceled = true; return; @@ -107,9 +110,9 @@ }, monitor); monitor.done(); } - + private void inspectManifest(IBundlePluginModelBase model, IProgressMonitor monitor) throws CoreException { - IFile manifestFile = (IFile)model.getBundleModel().getUnderlyingResource(); + IFile manifestFile = (IFile) model.getBundleModel().getUnderlyingResource(); IBundle bundle = model.getBundleModel().getBundle(); for (int i = 0; i < ICoreConstants.TRANSLATABLE_HEADERS.length; i++) { IManifestHeader header = bundle.getManifestHeader(ICoreConstants.TRANSLATABLE_HEADERS[i]); @@ -117,31 +120,31 @@ fModelChangeTable.addToChangeTable(model, manifestFile, header, selected(manifestFile)); } } - + private void inspectXML(IPluginModelBase model, IProgressMonitor monitor) throws CoreException { IFile file; if (model instanceof IBundlePluginModelBase) { - ISharedExtensionsModel extModel = ((IBundlePluginModelBase)model).getExtensionsModel(); + ISharedExtensionsModel extModel = ((IBundlePluginModelBase) model).getExtensionsModel(); if (extModel == null) return; - file = (IFile)extModel.getUnderlyingResource(); + file = (IFile) extModel.getUnderlyingResource(); } else - file = (IFile)model.getUnderlyingResource(); - + file = (IFile) model.getUnderlyingResource(); + IPluginBase base = model.getPluginBase(); if (base instanceof IDocumentElementNode) { // old style xml plugin // check xml name declaration - IDocumentAttributeNode attr = ((IDocumentElementNode)base).getDocumentAttribute(IPluginObject.P_NAME); + IDocumentAttributeNode attr = ((IDocumentElementNode) base).getDocumentAttribute(IPluginObject.P_NAME); if (attr != null && isNotTranslated(attr.getAttributeValue())) fModelChangeTable.addToChangeTable(model, file, attr, selected(file)); - + // check xml provider declaration - attr = ((IDocumentElementNode)base).getDocumentAttribute(IPluginBase.P_PROVIDER); + attr = ((IDocumentElementNode) base).getDocumentAttribute(IPluginBase.P_PROVIDER); if (attr != null && isNotTranslated(attr.getAttributeValue())) fModelChangeTable.addToChangeTable(model, file, attr, selected(file)); } - + SchemaRegistry registry = PDECore.getDefault().getSchemaRegistry(); IPluginExtension[] extensions = model.getPluginBase().getExtensions(); for (int i = 0; i < extensions.length; i++) { @@ -150,31 +153,30 @@ inspectExtension(schema, extensions[i], model, file); } } - - + private void inspectExtension(ISchema schema, IPluginParent parent, IPluginModelBase memModel, IFile file) { IPluginObject[] children = parent.getChildren(); for (int i = 0; i < children.length; i++) { - IPluginElement child = (IPluginElement)children[i]; + IPluginElement child = (IPluginElement) children[i]; ISchemaElement schemaElement = schema.findElement(child.getName()); if (schemaElement != null) { if (schemaElement.hasTranslatableContent()) if (isNotTranslated(child.getText())) fModelChangeTable.addToChangeTable(memModel, file, child, selected(file)); - + IPluginAttribute[] attributes = child.getAttributes(); for (int j = 0; j < attributes.length; j++) { IPluginAttribute attr = attributes[j]; ISchemaAttribute attInfo = schemaElement.getAttribute(attr.getName()); - if (attInfo != null && attInfo.isTranslatable()) + if (attInfo != null && attInfo.isTranslatable()) if (isNotTranslated(attr.getValue())) - fModelChangeTable.addToChangeTable(memModel, file, attr, selected(file)); + fModelChangeTable.addToChangeTable(memModel, file, attr, selected(file)); } } inspectExtension(schema, child, memModel, file); } } - + private boolean isNotTranslated(String value) { if (value == null) return false; @@ -190,9 +192,8 @@ public boolean wasCanceled() { return fCanceled; } - + private boolean selected(IFile file) { return fSelectedModels.contains(file.getProject()); } } - Index: org/eclipse/pde/internal/ui/nls/InternationalizeModelTable.java =================================================================== --- org/eclipse/pde/internal/ui/nls/InternationalizeModelTable.java (revision 0) +++ org/eclipse/pde/internal/ui/nls/InternationalizeModelTable.java (revision 137) @@ -0,0 +1,82 @@ +package org.eclipse.pde.internal.ui.nls; + +import java.util.ArrayList; + +/** + * TODO: Azure Documentation + * + * Stores the list of BundlePluginModels and ExternalPluginModels to be passed to the + * InternationalizeWizard. Contains another ArrayList that stores the preselected plug-in + * models as well. + * + * @author Haytham Y + * + */ +public class InternationalizeModelTable { + private ArrayList fModels; + private ArrayList fPreSelected; + + /** + * TODO: Azure Documentation + */ + public InternationalizeModelTable() { + fModels = new ArrayList(); + fPreSelected = new ArrayList(); + } + + /** + * TODO: Azure Documentation + * @param model + * @param selected + */ + public void addToModelTable(Object model, boolean selected) { + if (selected) + fPreSelected.add(model); + else + fModels.add(model); + } + + public void addModel(Object model) { + fModels.add(model); + } + + public void removeModel(Object model) { + fModels.remove(model); + } + + public int getModelCount() { + return fPreSelected.size() + fModels.size(); + } + + /** + * TODO: Azure Documentation + * @return + */ + public Object[] getModels() { + return fModels.toArray(); + } + + /** + * TODO: Azure Documentation + * @return + */ + public Object[] getPreSelected() { + return fPreSelected.toArray(); + } + + /** + * TODO: Azure Documentation + * @return + */ + public boolean hasPreSelected() { + return fPreSelected.size() > 0; + } + + /** + * TODO: Azure Documentation + * @return + */ + public boolean isEmpty() { + return fModels.size() == 0; + } +} Index: org/eclipse/pde/internal/ui/nls/InternationalizeWizardPluginPage.java =================================================================== --- org/eclipse/pde/internal/ui/nls/InternationalizeWizardPluginPage.java (revision 0) +++ org/eclipse/pde/internal/ui/nls/InternationalizeWizardPluginPage.java (revision 137) @@ -0,0 +1,624 @@ +/** + * + */ +package org.eclipse.pde.internal.ui.nls; + +import java.util.*; +import java.util.List; +import java.util.regex.Pattern; +import org.eclipse.core.runtime.*; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.jface.viewers.*; +import org.eclipse.jface.wizard.IWizardContainer; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.osgi.util.NLS; +import org.eclipse.pde.core.IModelProviderEvent; +import org.eclipse.pde.core.IModelProviderListener; +import org.eclipse.pde.core.plugin.*; +import org.eclipse.pde.internal.core.ClasspathUtilCore; +import org.eclipse.pde.internal.core.PDECore; +import org.eclipse.pde.internal.core.util.PatternConstructor; +import org.eclipse.pde.internal.ui.*; +import org.eclipse.pde.internal.ui.elements.DefaultContentProvider; +import org.eclipse.pde.internal.ui.util.SWTUtil; +import org.eclipse.pde.internal.ui.wizards.ListUtil; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.*; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.*; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.progress.WorkbenchJob; + +/** + * @author Robbie + * + */ +public class InternationalizeWizardPluginPage extends WizardPage implements IModelProviderListener { + + public static final String PAGE_NAME = "InternationalizeWizardPluginPage"; //$NON-NLS-1$ + + protected IPluginModelBase[] fModels = new IPluginModelBase[0]; + private String fLocation; + + protected TableViewer fSelectedListViewer; + private boolean fRefreshNeeded = true; + + private Label fCountLabel; + private TableViewer fAvailableListViewer; + + // this job is used to delay the full filter refresh for 200 milliseconds in case the user is still typing + private WorkbenchJob fFilterJob; + private Text fFilterText; + private AvailableFilter fFilter; + + // fSelected is used to track the selection in a HashMap so we can efficiently + // filter selected items out of the available item list + private HashMap fSelected; + // used to block the selection listeners from updating button enablement when programatically removing items + private boolean fBlockSelectionListeners; + private Button fAddButton; + private Button fAddAllButton; + private Button fRemoveButton; + private Button fRemoveAllButton; + + private InternationalizeModelTable fInternationalizeModelTable; + + private class AvailableFilter extends ViewerFilter { + private Pattern fPattern; + + public AvailableFilter() { + setPattern("*"); //$NON-NLS-1$ + } + + public boolean select(Viewer viewer, Object parentElement, Object element) { + // filter out any items that are currently selected + // on a full refresh, these will have been added back to the list + if (fSelected.containsKey(element)) + return false; + if (!(element instanceof IPluginModelBase)) + return false; + + String itemID = ((IPluginModelBase) element).getPluginBase().getId(); + if (fPattern.matcher(itemID).matches()) + return true; + return false; + } + + public boolean setPattern(String newPattern) { + if (!newPattern.endsWith("*")) //$NON-NLS-1$ + newPattern += "*"; //$NON-NLS-1$ + if (!newPattern.startsWith("*")) //$NON-NLS-1$ + newPattern = "*" + newPattern; //$NON-NLS-1$ + if (fPattern != null) { + String oldPattern = fPattern.pattern(); + if (newPattern.equals(oldPattern)) + return false; + } + fPattern = PatternConstructor.createPattern(newPattern, true); + return true; + } + } + + private class ContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + public Object[] getElements(Object parent) { + return fInternationalizeModelTable.getModels(); + } + } + + private class SelectedContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + public Object[] getElements(Object parent) { + return fInternationalizeModelTable.getPreSelected(); + } + } + + public InternationalizeWizardPluginPage(InternationalizeModelTable modelTable, String pageName) { + super(pageName); + PDEPlugin.getDefault().getLabelProvider().connect(this); + PDECore.getDefault().getModelManager().getExternalModelManager().addModelProviderListener(this); + + fInternationalizeModelTable = modelTable; + fSelected = new HashMap(); + + IWizardContainer container = getContainer(); + if (container != null) + container.updateButtons(); + } + + private void addFilter() { + fFilter = new AvailableFilter(); + fAvailableListViewer.addFilter(fFilter); + fFilterJob = new WorkbenchJob("FilterJob") { //$NON-NLS-1$ + public IStatus runInUIThread(IProgressMonitor monitor) { + handleFilter(); + return Status.OK_STATUS; + } + }; + fFilterJob.setSystem(true); + } + + private void handleFilter() { + boolean changed = false; + String newFilter; + if (fFilterText == null || (newFilter = fFilterText.getText().trim()).length() == 0) + newFilter = "*"; //$NON-NLS-1$ + changed = fFilter.setPattern(newFilter); + if (changed) { + fAvailableListViewer.getTable().setRedraw(false); + fAvailableListViewer.refresh(); + fAvailableListViewer.getTable().setRedraw(true); + updateButtonEnablement(false, false); + } + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) + */ + public void createControl(Composite parent) { + Composite container = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + layout.makeColumnsEqualWidth = false; + layout.horizontalSpacing = 5; + layout.verticalSpacing = 10; + container.setLayout(layout); + + createScrollArea(container); + createAvailableList(container).setLayoutData(new GridData(GridData.FILL_BOTH)); + createButtonArea(container); + createInternationalizeList(container).setLayoutData(new GridData(GridData.FILL_BOTH)); + updateCount(); + + // create container for buttons + Composite buttonContainer = new Composite(container, SWT.NONE); + buttonContainer.setLayout(GridLayoutFactory.fillDefaults().create()); + + addViewerListeners(); + addFilter(); + + initialize(); + setControl(container); + Dialog.applyDialogFont(container); + PlatformUI.getWorkbench().getHelpSystem().setHelp(container, IHelpContextIds.PLUGIN_IMPORT_SECOND_PAGE); + } + + protected Composite createInternationalizeList(Composite parent) { + Composite container = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.marginWidth = 0; + layout.marginHeight = 0; + container.setLayout(layout); + container.setLayoutData(new GridData(GridData.FILL_BOTH)); + + Label label = new Label(container, SWT.NONE); + label.setText(PDEUIMessages.InternationalizeWizard_PluginPage_internationalizeList); + + Table table = new Table(container, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); + GridData gd = new GridData(GridData.FILL_BOTH); + gd.widthHint = 225; + table.setLayoutData(gd); + + fSelectedListViewer = new TableViewer(table); + fSelectedListViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); + fSelectedListViewer.setContentProvider(new SelectedContentProvider()); + fSelectedListViewer.setInput(PDECore.getDefault().getModelManager().getExternalModelManager()); + fSelectedListViewer.setComparator(ListUtil.PLUGIN_COMPARATOR); + return container; + } + + protected boolean isRefreshNeeded() { + if (fRefreshNeeded) { + fRefreshNeeded = false; + return true; + } + if (fLocation == null) { + return true; + } + return false; + } + + private IPluginModelBase findModel(String id) { + for (int i = 0; i < fModels.length; i++) { + String modelId = fModels[i].getPluginBase().getId(); + if (modelId != null && modelId.equals(id)) + return fModels[i]; + } + return null; + } + + private IFragmentModel[] findFragments(IPlugin plugin) { + ArrayList result = new ArrayList(); + for (int i = 0; i < fModels.length; i++) { + if (fModels[i] instanceof IFragmentModel) { + IFragment fragment = ((IFragmentModel) fModels[i]).getFragment(); + if (plugin.getId().equalsIgnoreCase(fragment.getPluginId())) { + result.add(fModels[i]); + } + } + } + return (IFragmentModel[]) result.toArray(new IFragmentModel[result.size()]); + } + + protected void addPluginAndDependencies(IPluginModelBase model, ArrayList selected, boolean addFragments) { + + boolean containsVariable = false; + if (!selected.contains(model)) { + selected.add(model); + boolean hasextensibleAPI = ClasspathUtilCore.hasExtensibleAPI(model); + if (!addFragments && !hasextensibleAPI && model instanceof IPluginModel) { + IPluginLibrary[] libraries = model.getPluginBase().getLibraries(); + for (int i = 0; i < libraries.length; i++) { + if (ClasspathUtilCore.containsVariables(libraries[i].getName())) { + containsVariable = true; + break; + } + } + } + addDependencies(model, selected, addFragments || containsVariable || hasextensibleAPI); + } + } + + protected void addDependencies(IPluginModelBase model, ArrayList selected, boolean addFragments) { + + IPluginImport[] required = model.getPluginBase().getImports(); + if (required.length > 0) { + for (int i = 0; i < required.length; i++) { + IPluginModelBase found = findModel(required[i].getId()); + if (found != null) { + addPluginAndDependencies(found, selected, addFragments); + } + } + } + + if (addFragments) { + if (model instanceof IPluginModel) { + IFragmentModel[] fragments = findFragments(((IPluginModel) model).getPlugin()); + for (int i = 0; i < fragments.length; i++) { + addPluginAndDependencies(fragments[i], selected, addFragments); + } + } else { + IFragment fragment = ((IFragmentModel) model).getFragment(); + IPluginModelBase found = findModel(fragment.getPluginId()); + if (found != null) { + addPluginAndDependencies(found, selected, addFragments); + } + } + } + } + + public List getModelsToInternationalize() { + TableItem[] items = fSelectedListViewer.getTable().getItems(); + List result = new ArrayList(); + for (int i = 0; i < items.length; i++) { + result.add(items[i].getData()); + } + return result; + } + + public void storeSettings() { + IDialogSettings settings = getDialogSettings(); + } + + /* (non-Javadoc) + * @see org.eclipse.pde.core.IModelProviderListener#modelsChanged(org.eclipse.pde.core.IModelProviderEvent) + */ + public void modelsChanged(IModelProviderEvent event) { + fRefreshNeeded = true; + } + + private void initialize() { + updateButtonEnablement(true, true); + setPageComplete(false); + } + + private void addViewerListeners() { + fAvailableListViewer.addDoubleClickListener(new IDoubleClickListener() { + public void doubleClick(DoubleClickEvent event) { + handleAdd(); + } + }); + + fSelectedListViewer.addDoubleClickListener(new IDoubleClickListener() { + public void doubleClick(DoubleClickEvent event) { + handleRemove(); + } + }); + + fAvailableListViewer.addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent event) { + if (!fBlockSelectionListeners) + updateSelectionBasedEnablement(event.getSelection(), true); + } + }); + + fSelectedListViewer.addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent event) { + if (!fBlockSelectionListeners) + updateSelectionBasedEnablement(event.getSelection(), false); + } + }); + + fFilterText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + fFilterJob.cancel(); + fFilterJob.schedule(200); + } + }); + + } + + private Composite createAvailableList(Composite parent) { + Composite container = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.marginWidth = 0; + layout.marginHeight = 0; + container.setLayout(layout); + container.setLayoutData(new GridData()); + + Label label = new Label(container, SWT.NONE); + label.setText(PDEUIMessages.InternationalizeWizard_PluginPage_availableList); + + Table table = new Table(container, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); + GridData gd = new GridData(GridData.FILL_BOTH); + gd.heightHint = 200; + gd.widthHint = 225; + table.setLayoutData(gd); + + fAvailableListViewer = new TableViewer(table); + fAvailableListViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); + fAvailableListViewer.setContentProvider(new ContentProvider()); + fAvailableListViewer.setInput(PDECore.getDefault().getModelManager()); + fAvailableListViewer.setComparator(ListUtil.PLUGIN_COMPARATOR); + + return container; + } + + private Composite createButtonArea(Composite parent) { + ScrolledComposite comp = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL); + GridLayout layout = new GridLayout(); + layout.marginWidth = layout.marginHeight = 0; + comp.setLayoutData(new GridData(GridData.FILL_VERTICAL)); + Composite container = new Composite(comp, SWT.NONE); + layout = new GridLayout(); + layout.marginWidth = 0; + container.setLayout(layout); + GridData gd = new GridData(GridData.FILL_VERTICAL); + gd.verticalIndent = 15; + container.setLayoutData(gd); + + fAddButton = new Button(container, SWT.PUSH); + fAddButton.setText(PDEUIMessages.ImportWizard_DetailedPage_add); + fAddButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + fAddButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleAdd(); + } + }); + SWTUtil.setButtonDimensionHint(fAddButton); + + fAddAllButton = new Button(container, SWT.PUSH); + fAddAllButton.setText(PDEUIMessages.ImportWizard_DetailedPage_addAll); + fAddAllButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + fAddAllButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleAddAll(); + } + }); + SWTUtil.setButtonDimensionHint(fAddAllButton); + + fRemoveButton = new Button(container, SWT.PUSH); + fRemoveButton.setText(PDEUIMessages.ImportWizard_DetailedPage_remove); + fRemoveButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + fRemoveButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleRemove(); + } + }); + SWTUtil.setButtonDimensionHint(fRemoveButton); + + fRemoveAllButton = new Button(container, SWT.PUSH); + fRemoveAllButton.setText(PDEUIMessages.ImportWizard_DetailedPage_removeAll); + fRemoveAllButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + fRemoveAllButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleRemoveAll(); + } + }); + SWTUtil.setButtonDimensionHint(fRemoveAllButton); + + fCountLabel = new Label(container, SWT.NONE); + fCountLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); + comp.setContent(container); + comp.setMinHeight(250); + comp.setExpandHorizontal(true); + comp.setExpandVertical(true); + return container; + } + + private Composite createScrollArea(Composite parent) { + Group container = new Group(parent, SWT.NONE); + GridLayout layout = new GridLayout(2, false); + layout.marginWidth = layout.marginHeight = 6; + container.setLayout(layout); + + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.horizontalSpan = 3; + container.setLayoutData(gd); + container.setText(PDEUIMessages.InternationalizeWizard_PluginPage_filter); + + Label filterLabel = new Label(container, SWT.NONE); + filterLabel.setText(PDEUIMessages.ImportWizard_DetailedPage_search); + + fFilterText = new Text(container, SWT.BORDER); + fFilterText.setText(""); //$NON-NLS-1$ + gd = new GridData(GridData.FILL_HORIZONTAL); + fFilterText.setLayoutData(gd); + + return container; + } + + public void setVisible(boolean visible) { + super.setVisible(visible); + } + + protected void refreshPage() { + fSelectedListViewer.getTable().removeAll(); + fSelected = new HashMap(); + fAvailableListViewer.refresh(); + pageChanged(); + } + + protected void pageChanged() { + pageChanged(false, false); + } + + protected void pageChanged(boolean doAddEnablement, boolean doRemoveEnablement) { + updateCount(); + updateButtonEnablement(doAddEnablement, doRemoveEnablement); + setPageComplete(fSelectedListViewer.getTable().getItemCount() > 0); + } + + private void updateCount() { + fCountLabel.setText(NLS.bind(PDEUIMessages.ImportWizard_DetailedPage_count, (new String[] {new Integer(fSelectedListViewer.getTable().getItemCount()).toString(), new Integer(fAvailableListViewer.getTable().getItemCount() + fSelectedListViewer.getTable().getItemCount()).toString()}))); + fCountLabel.getParent().layout(); + } + + private void updateButtonEnablement(boolean doAddEnablement, boolean doRemoveEnablement) { + int availableCount = fAvailableListViewer.getTable().getItemCount(); + int importCount = fSelectedListViewer.getTable().getItemCount(); + + if (doAddEnablement) + updateSelectionBasedEnablement(fAvailableListViewer.getSelection(), true); + if (doRemoveEnablement) + updateSelectionBasedEnablement(fSelectedListViewer.getSelection(), false); + + fAddAllButton.setEnabled(availableCount > 0); + fRemoveAllButton.setEnabled(importCount > 0); + } + + private void updateSelectionBasedEnablement(ISelection theSelection, boolean available) { + if (available) + fAddButton.setEnabled(!theSelection.isEmpty()); + else + fRemoveButton.setEnabled(!theSelection.isEmpty()); + } + + private void handleAdd() { + IStructuredSelection ssel = (IStructuredSelection) fAvailableListViewer.getSelection(); + if (ssel.size() > 0) { + Table table = fAvailableListViewer.getTable(); + int index = table.getSelectionIndices()[0]; + Object[] selection = ssel.toArray(); + setBlockSelectionListeners(true); + setRedraw(false); + for (int i = 0; i < selection.length; i++) { + doAdd(selection[i]); + } + setRedraw(true); + setBlockSelectionListeners(false); + table.setSelection(index < table.getItemCount() ? index : table.getItemCount() - 1); + pageChanged(true, false); + } + } + + private void handleAddAll() { + TableItem[] items = fAvailableListViewer.getTable().getItems(); + + ArrayList data = new ArrayList(); + for (int i = 0; i < items.length; i++) { + data.add(items[i].getData()); + } + if (data.size() > 0) { + Object[] datas = data.toArray(); + setBlockSelectionListeners(true); + setRedraw(false); + for (int i = 0; i < datas.length; i++) { + doAdd(datas[i]); + } + setRedraw(true); + setBlockSelectionListeners(false); + pageChanged(true, false); + } + } + + private void handleRemove() { + IStructuredSelection ssel = (IStructuredSelection) fSelectedListViewer.getSelection(); + if (ssel.size() > 0) { + Table table = fSelectedListViewer.getTable(); + int index = table.getSelectionIndices()[0]; + Object[] selection = ssel.toArray(); + setBlockSelectionListeners(true); + setRedraw(false); + for (int i = 0; i < selection.length; i++) { + doRemove(selection[i]); + } + setRedraw(true); + setBlockSelectionListeners(false); + table.setSelection(index < table.getItemCount() ? index : table.getItemCount() - 1); + pageChanged(false, true); + } + } + + private void doAdd(Object o) { + fInternationalizeModelTable.removeModel(o); + fSelectedListViewer.add(o); + fAvailableListViewer.remove(o); + fSelected.put(o, null); + } + + private void doRemove(Object o) { + fInternationalizeModelTable.addModel(o); + fSelected.remove(o); + fSelectedListViewer.remove(o); + fAvailableListViewer.add(o); + } + + // used to prevent flicker during operations that move items between lists + private void setRedraw(boolean redraw) { + fAvailableListViewer.getTable().setRedraw(redraw); + fSelectedListViewer.getTable().setRedraw(redraw); + } + + private void handleRemoveAll() { + TableItem[] items = fSelectedListViewer.getTable().getItems(); + + ArrayList data = new ArrayList(); + for (int i = 0; i < items.length; i++) { + data.add(items[i].getData()); + } + if (data.size() > 0) { + Object[] datas = data.toArray(); + setBlockSelectionListeners(true); + setRedraw(false); + for (int i = 0; i < datas.length; i++) { + doRemove(datas[i]); + } + setRedraw(true); + setBlockSelectionListeners(false); + pageChanged(false, true); + } + } + + public void dispose() { + PDEPlugin.getDefault().getLabelProvider().disconnect(this); + PDECore.getDefault().getModelManager().getExternalModelManager().removeModelProviderListener(this); + } + + private void setBlockSelectionListeners(boolean blockSelectionListeners) { + fBlockSelectionListeners = blockSelectionListeners; + } + + public boolean isCurrentPage() { + return super.isCurrentPage(); + } + + public boolean canFlipToNextPage() { + if (fSelectedListViewer.getTable().getItems().length > 0) { + return true; + } + return false; + } +} Index: org/eclipse/pde/internal/ui/nls/InternationalizeWizardLocalePage.java =================================================================== --- org/eclipse/pde/internal/ui/nls/InternationalizeWizardLocalePage.java (revision 0) +++ org/eclipse/pde/internal/ui/nls/InternationalizeWizardLocalePage.java (revision 137) @@ -0,0 +1,572 @@ +/** + * + */ +package org.eclipse.pde.internal.ui.nls; + +import java.util.*; +import java.util.List; +import java.util.regex.Pattern; +import org.eclipse.core.runtime.*; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.jface.viewers.*; +import org.eclipse.jface.wizard.IWizardContainer; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.osgi.util.NLS; +import org.eclipse.pde.core.IModelProviderEvent; +import org.eclipse.pde.core.IModelProviderListener; +import org.eclipse.pde.internal.core.PDECore; +import org.eclipse.pde.internal.core.util.PatternConstructor; +import org.eclipse.pde.internal.ui.*; +import org.eclipse.pde.internal.ui.elements.DefaultContentProvider; +import org.eclipse.pde.internal.ui.util.SWTUtil; +import org.eclipse.pde.internal.ui.wizards.ListUtil; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.*; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.*; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.progress.WorkbenchJob; + +/** + * @author Robbie + * + */ +public class InternationalizeWizardLocalePage extends WizardPage implements IModelProviderListener { + + public static final String PAGE_NAME = "InternationalizeWizardLocalePage"; //$NON-NLS-1$ + + protected Locale[] fModels = new Locale[0]; + private String fLocation; + + protected TableViewer fSelectedListViewer; + private boolean fRefreshNeeded = true; + + private Label fCountLabel; + private TableViewer fAvailableListViewer; + + // this job is used to delay the full filter refresh for 200 milliseconds in case the user is still typing + private WorkbenchJob fFilterJob; + private Text fFilterText; + private AvailableFilter fFilter; + + // fSelected is used to track the selection in a HashMap so we can efficiently + // filter selected items out of the available item list + private HashMap fSelected; + // used to block the selection listeners from updating button enablement when programatically removing items + private boolean fBlockSelectionListeners; + private Button fAddButton; + private Button fAddAllButton; + private Button fRemoveButton; + private Button fRemoveAllButton; + + private InternationalizeModelTable fInternationalizeModelTable; + + private class AvailableFilter extends ViewerFilter { + private Pattern fPattern; + + public AvailableFilter() { + setPattern("*"); //$NON-NLS-1$ + } + + public boolean select(Viewer viewer, Object parentElement, Object element) { + // filter out any items that are currently selected + // on a full refresh, these will have been added back to the list + if (fSelected.containsKey(element)) + return false; + if (!(element instanceof Locale)) + return false; + String localeName = ((Locale) element).toString(); + if (fPattern.matcher(localeName).matches()) + return true; + return false; + } + + public boolean setPattern(String newPattern) { + if (!newPattern.endsWith("*")) //$NON-NLS-1$ + newPattern += "*"; //$NON-NLS-1$ + if (!newPattern.startsWith("*")) //$NON-NLS-1$ + newPattern = "*" + newPattern; //$NON-NLS-1$ + if (fPattern != null) { + String oldPattern = fPattern.pattern(); + if (newPattern.equals(oldPattern)) + return false; + } + fPattern = PatternConstructor.createPattern(newPattern, true); + return true; + } + } + + /*private String[] getLocales() { + Locale[] locales = Locale.getAvailableLocales(); + String[] result = new String[locales.length]; + for (int i = 0; i < locales.length; i++) { + Locale locale = locales[i]; + StringBuffer buffer = new StringBuffer(); + buffer.append(locale.toString()); + buffer.append(" - "); //$NON-NLS-1$ + buffer.append(locale.getDisplayName()); + result[i] = buffer.toString(); + } + return result; + }*/ + + private class ContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + public Object[] getElements(Object parent) { + return fInternationalizeModelTable.getModels(); + } + } + + private class SelectedContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + public Object[] getElements(Object parent) { + return null; + } + } + + public InternationalizeWizardLocalePage(InternationalizeModelTable modelTable, String pageName) { + super(pageName); + PDEPlugin.getDefault().getLabelProvider().connect(this); + PDECore.getDefault().getModelManager().getExternalModelManager().addModelProviderListener(this); + + fInternationalizeModelTable = modelTable; + fSelected = new HashMap(); + + IWizardContainer container = getContainer(); + if (container != null) + container.updateButtons(); + } + + private void addFilter() { + fFilter = new AvailableFilter(); + fAvailableListViewer.addFilter(fFilter); + fFilterJob = new WorkbenchJob("FilterJob") { //$NON-NLS-1$ + public IStatus runInUIThread(IProgressMonitor monitor) { + handleFilter(); + return Status.OK_STATUS; + } + }; + fFilterJob.setSystem(true); + } + + private void handleFilter() { + boolean changed = false; + String newFilter; + if (fFilterText == null || (newFilter = fFilterText.getText().trim()).length() == 0) + newFilter = "*"; //$NON-NLS-1$ + changed = fFilter.setPattern(newFilter); + if (changed) { + fAvailableListViewer.getTable().setRedraw(false); + fAvailableListViewer.refresh(); + fAvailableListViewer.getTable().setRedraw(true); + updateButtonEnablement(false, false); + } + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) + */ + public void createControl(Composite parent) { + Composite container = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + layout.makeColumnsEqualWidth = false; + layout.horizontalSpacing = 5; + layout.verticalSpacing = 10; + container.setLayout(layout); + + createScrollArea(container); + createAvailableList(container).setLayoutData(new GridData(GridData.FILL_BOTH)); + createButtonArea(container); + createLocaleList(container).setLayoutData(new GridData(GridData.FILL_BOTH)); + updateCount(); + + // create container for buttons + Composite buttonContainer = new Composite(container, SWT.NONE); + buttonContainer.setLayout(GridLayoutFactory.fillDefaults().create()); + + addViewerListeners(); + addFilter(); + + initialize(); + setControl(container); + Dialog.applyDialogFont(container); + PlatformUI.getWorkbench().getHelpSystem().setHelp(container, IHelpContextIds.PLUGIN_IMPORT_SECOND_PAGE); + } + + protected Composite createLocaleList(Composite parent) { + Composite container = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.marginWidth = 0; + layout.marginHeight = 0; + container.setLayout(layout); + container.setLayoutData(new GridData(GridData.FILL_BOTH)); + + Label label = new Label(container, SWT.NONE); + label.setText(PDEUIMessages.InternationalizeWizard_PluginPage_internationalizeList); + + Table table = new Table(container, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); + GridData gd = new GridData(GridData.FILL_BOTH); + gd.widthHint = 225; + table.setLayoutData(gd); + + fSelectedListViewer = new TableViewer(table); + fSelectedListViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); + fSelectedListViewer.setContentProvider(new SelectedContentProvider()); + //fSelectedListViewer.setInput(); TODO Pass proper input to TableViewer + fSelectedListViewer.setComparator(ListUtil.NAME_COMPARATOR); + return container; + } + + protected boolean isRefreshNeeded() { + if (fRefreshNeeded) { + fRefreshNeeded = false; + return true; + } + if (fLocation == null) { + return true; + } + return false; + } + + protected void addLocale(Locale model, ArrayList selected) { + if (!selected.contains(model)) { + selected.add(model); + } + } + + public List getLocalesForInternationalization() { + TableItem[] items = fSelectedListViewer.getTable().getItems(); + List result = new ArrayList(); + for (int i = 0; i < items.length; i++) { + result.add(items[i].getData()); + } + return result; + } + + public void storeSettings() { + IDialogSettings settings = getDialogSettings(); + } + + /* (non-Javadoc) + * @see org.eclipse.pde.core.IModelProviderListener#modelsChanged(org.eclipse.pde.core.IModelProviderEvent) + */ + public void modelsChanged(IModelProviderEvent event) { + fRefreshNeeded = true; + } + + private void initialize() { + updateButtonEnablement(true, true); + setPageComplete(false); + } + + private void addViewerListeners() { + fAvailableListViewer.addDoubleClickListener(new IDoubleClickListener() { + public void doubleClick(DoubleClickEvent event) { + handleAdd(); + } + }); + + fSelectedListViewer.addDoubleClickListener(new IDoubleClickListener() { + public void doubleClick(DoubleClickEvent event) { + handleRemove(); + } + }); + + fAvailableListViewer.addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent event) { + if (!fBlockSelectionListeners) + updateSelectionBasedEnablement(event.getSelection(), true); + } + }); + + fSelectedListViewer.addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent event) { + if (!fBlockSelectionListeners) + updateSelectionBasedEnablement(event.getSelection(), false); + } + }); + + fFilterText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + fFilterJob.cancel(); + fFilterJob.schedule(200); + } + }); + + } + + private Composite createAvailableList(Composite parent) { + Composite container = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.marginWidth = 0; + layout.marginHeight = 0; + container.setLayout(layout); + container.setLayoutData(new GridData()); + + Label label = new Label(container, SWT.NONE); + label.setText(PDEUIMessages.InternationalizeWizard_PluginPage_availableList); + + Table table = new Table(container, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); + GridData gd = new GridData(GridData.FILL_BOTH); + gd.heightHint = 200; + gd.widthHint = 225; + table.setLayoutData(gd); + + fAvailableListViewer = new TableViewer(table); + fAvailableListViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); + fAvailableListViewer.setContentProvider(new ContentProvider()); + //fAvailableListViewer.setInput(); TODO Pass proper input to TableViewer + fAvailableListViewer.setComparator(ListUtil.NAME_COMPARATOR); + + return container; + } + + private Composite createButtonArea(Composite parent) { + ScrolledComposite comp = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL); + GridLayout layout = new GridLayout(); + layout.marginWidth = layout.marginHeight = 0; + comp.setLayoutData(new GridData(GridData.FILL_VERTICAL)); + Composite container = new Composite(comp, SWT.NONE); + layout = new GridLayout(); + layout.marginWidth = 0; + container.setLayout(layout); + GridData gd = new GridData(GridData.FILL_VERTICAL); + gd.verticalIndent = 15; + container.setLayoutData(gd); + + fAddButton = new Button(container, SWT.PUSH); + fAddButton.setText(PDEUIMessages.ImportWizard_DetailedPage_add); + fAddButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + fAddButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleAdd(); + } + }); + SWTUtil.setButtonDimensionHint(fAddButton); + + fAddAllButton = new Button(container, SWT.PUSH); + fAddAllButton.setText(PDEUIMessages.ImportWizard_DetailedPage_addAll); + fAddAllButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + fAddAllButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleAddAll(); + } + }); + SWTUtil.setButtonDimensionHint(fAddAllButton); + + fRemoveButton = new Button(container, SWT.PUSH); + fRemoveButton.setText(PDEUIMessages.ImportWizard_DetailedPage_remove); + fRemoveButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + fRemoveButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleRemove(); + } + }); + SWTUtil.setButtonDimensionHint(fRemoveButton); + + fRemoveAllButton = new Button(container, SWT.PUSH); + fRemoveAllButton.setText(PDEUIMessages.ImportWizard_DetailedPage_removeAll); + fRemoveAllButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + fRemoveAllButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleRemoveAll(); + } + }); + SWTUtil.setButtonDimensionHint(fRemoveAllButton); + + fCountLabel = new Label(container, SWT.NONE); + fCountLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); + comp.setContent(container); + comp.setMinHeight(250); + comp.setExpandHorizontal(true); + comp.setExpandVertical(true); + return container; + } + + private Composite createScrollArea(Composite parent) { + Group container = new Group(parent, SWT.NONE); + GridLayout layout = new GridLayout(2, false); + layout.marginWidth = layout.marginHeight = 6; + container.setLayout(layout); + + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.horizontalSpan = 3; + container.setLayoutData(gd); + container.setText(PDEUIMessages.InternationalizeWizard_PluginPage_filter); + + Label filterLabel = new Label(container, SWT.NONE); + filterLabel.setText(PDEUIMessages.ImportWizard_DetailedPage_search); + + fFilterText = new Text(container, SWT.BORDER); + fFilterText.setText(""); //$NON-NLS-1$ + gd = new GridData(GridData.FILL_HORIZONTAL); + fFilterText.setLayoutData(gd); + + return container; + } + + public void setVisible(boolean visible) { + super.setVisible(visible); + } + + protected void refreshPage() { + fSelectedListViewer.getTable().removeAll(); + fSelected = new HashMap(); + fAvailableListViewer.refresh(); + pageChanged(); + } + + protected void pageChanged() { + pageChanged(false, false); + } + + protected void pageChanged(boolean doAddEnablement, boolean doRemoveEnablement) { + updateCount(); + updateButtonEnablement(doAddEnablement, doRemoveEnablement); + setPageComplete(fSelectedListViewer.getTable().getItemCount() > 0); + } + + private void updateCount() { + fCountLabel.setText(NLS.bind(PDEUIMessages.ImportWizard_DetailedPage_count, (new String[] {new Integer(fSelectedListViewer.getTable().getItemCount()).toString(), new Integer(fAvailableListViewer.getTable().getItemCount() + fSelectedListViewer.getTable().getItemCount()).toString()}))); + fCountLabel.getParent().layout(); + } + + private void updateButtonEnablement(boolean doAddEnablement, boolean doRemoveEnablement) { + int availableCount = fAvailableListViewer.getTable().getItemCount(); + int importCount = fSelectedListViewer.getTable().getItemCount(); + + if (doAddEnablement) + updateSelectionBasedEnablement(fAvailableListViewer.getSelection(), true); + if (doRemoveEnablement) + updateSelectionBasedEnablement(fSelectedListViewer.getSelection(), false); + + fAddAllButton.setEnabled(availableCount > 0); + fRemoveAllButton.setEnabled(importCount > 0); + } + + private void updateSelectionBasedEnablement(ISelection theSelection, boolean available) { + if (available) + fAddButton.setEnabled(!theSelection.isEmpty()); + else + fRemoveButton.setEnabled(!theSelection.isEmpty()); + } + + private void handleAdd() { + IStructuredSelection ssel = (IStructuredSelection) fAvailableListViewer.getSelection(); + if (ssel.size() > 0) { + Table table = fAvailableListViewer.getTable(); + int index = table.getSelectionIndices()[0]; + Object[] selection = ssel.toArray(); + setBlockSelectionListeners(true); + setRedraw(false); + for (int i = 0; i < selection.length; i++) { + doAdd(selection[i]); + } + setRedraw(true); + setBlockSelectionListeners(false); + table.setSelection(index < table.getItemCount() ? index : table.getItemCount() - 1); + pageChanged(true, false); + } + } + + private void handleAddAll() { + TableItem[] items = fAvailableListViewer.getTable().getItems(); + + ArrayList data = new ArrayList(); + for (int i = 0; i < items.length; i++) { + data.add(items[i].getData()); + } + if (data.size() > 0) { + Object[] datas = data.toArray(); + setBlockSelectionListeners(true); + setRedraw(false); + for (int i = 0; i < datas.length; i++) { + doAdd(datas[i]); + } + setRedraw(true); + setBlockSelectionListeners(false); + pageChanged(true, false); + } + } + + private void handleRemove() { + IStructuredSelection ssel = (IStructuredSelection) fSelectedListViewer.getSelection(); + if (ssel.size() > 0) { + Table table = fSelectedListViewer.getTable(); + int index = table.getSelectionIndices()[0]; + Object[] selection = ssel.toArray(); + setBlockSelectionListeners(true); + setRedraw(false); + for (int i = 0; i < selection.length; i++) { + doRemove(selection[i]); + } + setRedraw(true); + setBlockSelectionListeners(false); + table.setSelection(index < table.getItemCount() ? index : table.getItemCount() - 1); + pageChanged(false, true); + } + } + + private void doAdd(Object o) { + fInternationalizeModelTable.removeModel(o); + fSelectedListViewer.add(o); + fAvailableListViewer.remove(o); + fSelected.put(o, null); + } + + private void doRemove(Object o) { + fInternationalizeModelTable.addModel(o); + fSelected.remove(o); + fSelectedListViewer.remove(o); + fAvailableListViewer.add(o); + } + + // used to prevent flicker during operations that move items between lists + private void setRedraw(boolean redraw) { + fAvailableListViewer.getTable().setRedraw(redraw); + fSelectedListViewer.getTable().setRedraw(redraw); + } + + private void handleRemoveAll() { + TableItem[] items = fSelectedListViewer.getTable().getItems(); + + ArrayList data = new ArrayList(); + for (int i = 0; i < items.length; i++) { + data.add(items[i].getData()); + } + if (data.size() > 0) { + Object[] datas = data.toArray(); + setBlockSelectionListeners(true); + setRedraw(false); + for (int i = 0; i < datas.length; i++) { + doRemove(datas[i]); + } + setRedraw(true); + setBlockSelectionListeners(false); + pageChanged(false, true); + } + } + + public void dispose() { + PDEPlugin.getDefault().getLabelProvider().disconnect(this); + PDECore.getDefault().getModelManager().getExternalModelManager().removeModelProviderListener(this); + } + + private void setBlockSelectionListeners(boolean blockSelectionListeners) { + fBlockSelectionListeners = blockSelectionListeners; + } + + public boolean isCurrentPage() { + return super.isCurrentPage(); + } + + public boolean canFlipToNextPage() { + if (fSelectedListViewer.getTable().getItems().length > 0) { + return true; + } + return false; + } +} Index: org/eclipse/pde/internal/ui/nls/InternationalizeAction.java =================================================================== --- org/eclipse/pde/internal/ui/nls/InternationalizeAction.java (revision 73) +++ org/eclipse/pde/internal/ui/nls/InternationalizeAction.java (revision 137) @@ -10,25 +10,60 @@ *******************************************************************************/ package org.eclipse.pde.internal.ui.nls; +import java.lang.reflect.InvocationTargetException; import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.pde.internal.ui.PDEPlugin; +import org.eclipse.pde.internal.ui.PDEUIMessages; +import org.eclipse.ui.*; +/** + * TODO: Azure Documentation + * @author Haytham Y + * + */ public class InternationalizeAction implements IWorkbenchWindowActionDelegate { - private ISelection fSelection; + private IStructuredSelection fSelection; public InternationalizeAction() { } + /* + * Azure: So far only populates the list of plug-ins (ExternalPluginModels and BundlePluginModels) + * i.e. those in the target platform as well as those in the user's workspace. These are + * populated in a ModelPluginTable that should be passed to the InternationalizeWizard. + */ public void run(IAction action) { - System.out.println(fSelection); - // DO STUFF + InternationalizeOperation runnable = new InternationalizeOperation(fSelection); + try { + PlatformUI.getWorkbench().getProgressService().busyCursorWhile(runnable); + } catch (InvocationTargetException e) { + } catch (InterruptedException e) { + } finally { + if (runnable.wasCanceled()) + return; + InternationalizeModelTable pluginTable = runnable.getPluginTable(); + if (!pluginTable.isEmpty()) { + + InternationalizeWizard wizard = new InternationalizeWizard(action, pluginTable); + wizard.init(PlatformUI.getWorkbench(), fSelection); + + InternationalizeWizardOpenOperation op = new InternationalizeWizardOpenOperation(wizard); + + try { + op.run(PDEPlugin.getActiveWorkbenchShell(), ""); //$NON-NLS-1$ + } catch (final InterruptedException irex) { + } + } else + MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), PDEUIMessages.InternationalizeAction_internationalizeTitle, PDEUIMessages.InternationalizeAction_internationalizeMessage); + } } public void selectionChanged(IAction action, ISelection selection) { - fSelection = selection; + fSelection = (IStructuredSelection) selection; } public void dispose() { Index: org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsAction.java =================================================================== --- org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsAction.java (revision 73) +++ org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsAction.java (revision 137) @@ -11,7 +11,6 @@ package org.eclipse.pde.internal.ui.nls; import java.lang.reflect.InvocationTargetException; - import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ISelection; @@ -19,41 +18,54 @@ import org.eclipse.pde.internal.ui.PDEPlugin; import org.eclipse.pde.internal.ui.PDEUIMessages; import org.eclipse.pde.internal.ui.refactoring.PDERefactor; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.*; public class GetNonExternalizedStringsAction implements IWorkbenchWindowActionDelegate { private ISelection fSelection; - + //Azure: To indicate that only selected plug-ins are to be externalized. False by default. + private boolean fExternalizeSelectedPluginsOnly = false; + + //Azure: To indicate that the post-externalization message dialog should not be displayed. + private boolean fSkipMessageDialog = false; + public GetNonExternalizedStringsAction() { } public void run(IAction action) { - GetNonExternalizedStringsOperation runnable = new GetNonExternalizedStringsOperation(fSelection); + /* + * Azure: Pass fExternalizeSelectedPluginsOnly to the operation to indicate + * that only the plug-ins passed in the selection are to be externalized and such that + * only those are displayed on the change table in the ExternalizeStringsWizard. + */ + GetNonExternalizedStringsOperation runnable = new GetNonExternalizedStringsOperation(fSelection, fExternalizeSelectedPluginsOnly); try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(runnable); } catch (InvocationTargetException e) { } catch (InterruptedException e) { } finally { - if (runnable.wasCanceled()) + if (runnable.wasCanceled()) return; ModelChangeTable changeTable = runnable.getChangeTable(); if (!changeTable.isEmpty()) { ExternalizeStringsProcessor processor = new ExternalizeStringsProcessor(); PDERefactor refactor = new PDERefactor(processor); ExternalizeStringsWizard wizard = new ExternalizeStringsWizard(changeTable, refactor); - RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation( wizard ); - - try { - op.run( PDEPlugin.getActiveWorkbenchShell(), "" ); //$NON-NLS-1$ - } catch( final InterruptedException irex ) { - } - } else - MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), - PDEUIMessages.GetNonExternalizedStringsAction_allExternalizedTitle, - PDEUIMessages.GetNonExternalizedStringsAction_allExternalizedMessage); + RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard); + + try { + op.run(PDEPlugin.getActiveWorkbenchShell(), ""); //$NON-NLS-1$ + } catch (final InterruptedException irex) { + } + } else { + /* + * Azure: When the InternationalizeAction invokes the ExternalizeStringsAction, + * fSkipMessageDialog is set to true in order for no intermediate + * message to appear if all selected plug-ins were already externalized. + */ + if (!fSkipMessageDialog) + MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), PDEUIMessages.GetNonExternalizedStringsAction_allExternalizedTitle, PDEUIMessages.GetNonExternalizedStringsAction_allExternalizedMessage); + } } } @@ -66,4 +78,36 @@ public void init(IWorkbenchWindow window) { } + + /** + * TODO: Azure Documentation + * @param externalizeSelectedPluginsOnly + */ + public void setExternalizeSelectedPluginsOnly(boolean externalizeSelectedPluginsOnly) { + fExternalizeSelectedPluginsOnly = externalizeSelectedPluginsOnly; + } + + /** + * TODO: Azure Documentation + * @return + */ + public boolean isExternalizeSelectedPluginsOnly() { + return fExternalizeSelectedPluginsOnly; + } + + /** + * TODO: Azure Documentation + * @param skipMessageDialog + */ + public void setSkipMessageDialog(boolean skipMessageDialog) { + this.fSkipMessageDialog = skipMessageDialog; + } + + /** + * TODO: Azure Documentation + * @return + */ + public boolean isSkipMessageDialog() { + return fSkipMessageDialog; + } } Index: org/eclipse/pde/internal/ui/pderesources.properties =================================================================== --- org/eclipse/pde/internal/ui/pderesources.properties (revision 73) +++ org/eclipse/pde/internal/ui/pderesources.properties (revision 137) @@ -2011,6 +2011,12 @@ IntroSection_sectionDescription=The welcome page appears the first time the product is launched. It is intended to introduce the features of the product to new users. IntroSection_undefinedProductId=Undefined Product ID +InternationalizeAction_internationalizeTitle=Internationalize Plug-ins +InternationalizeAction_internationalizeMessage=All plug-ins have been internationalized +InternationalizeWizard_title=Internationalize Plug-ins +InternationalizeWizard_PluginPage_internationalizeList = P&lug-ins to Internationlize: +InternationalizeWizard_PluginPage_availableList = P&lug-ins found: +InternationalizeWizard_PluginPage_filter = Filter Available Plug-ins MainTab_jreSection = Java Runtime Environment EquinoxLaunchConfiguration_oldTarget=The org.eclipse.osgi plug-in is missing from this configuration. Index: org/eclipse/pde/internal/ui/PDEUIMessages.java =================================================================== --- org/eclipse/pde/internal/ui/PDEUIMessages.java (revision 73) +++ org/eclipse/pde/internal/ui/PDEUIMessages.java (revision 137) @@ -2421,6 +2421,18 @@ public static String ExternalizeStringsWizardPage_keySuggested; + public static String InternationalizeAction_internationalizeTitle; + + public static String InternationalizeAction_internationalizeMessage; + + public static String InternationalizeWizard_title; + + public static String InternationalizeWizard_PluginPage_internationalizeList; + + public static String InternationalizeWizard_PluginPage_availableList; + + public static String InternationalizeWizard_PluginPage_filter; + public static String NewProjectCreationPage_target; public static String NewProjectCreationPage_ftarget;