[340923] many comparator errors in latest I-build
diff --git a/org.eclipse.wst.common.snippets/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.wst.common.snippets/.settings/org.eclipse.jdt.core.prefs index 5da004d..9d72998 100644 --- a/org.eclipse.wst.common.snippets/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.wst.common.snippets/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@ -#Wed Mar 28 03:12:48 EDT 2007 +#Mon Mar 28 13:13:50 EDT 2011 eclipse.preferences.version=1 org.eclipse.jdt.core.builder.cleanOutputFolder=clean org.eclipse.jdt.core.builder.duplicateResourceTask=warning @@ -19,17 +19,22 @@ org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning org.eclipse.jdt.core.compiler.problem.deprecation=ignore org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error @@ -37,9 +42,10 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public @@ -47,17 +53,29 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error +org.eclipse.jdt.core.compiler.problem.nullReference=error org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning @@ -65,14 +83,19 @@ org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled org.eclipse.jdt.core.compiler.problem.unusedImport=error org.eclipse.jdt.core.compiler.problem.unusedLabel=error org.eclipse.jdt.core.compiler.problem.unusedLocal=error +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.source=1.3 org.eclipse.jdt.core.incompatibleJDKLevel=ignore
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/SnippetContributor.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/SnippetContributor.java index fea7880..b718708 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/SnippetContributor.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/SnippetContributor.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 SAP AG and others. + * Copyright (c) 2009, 2011 SAP AG and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -102,6 +102,6 @@ } public String toString() { - return super.toString() + ":" + extPointElement.getAttribute(CLASS); + return super.toString() + ":" + extPointElement.getAttribute(CLASS); //$NON-NLS-1$ } }
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/VariableInsertionDialog.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/VariableInsertionDialog.java index 65fe110..3088d08 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/VariableInsertionDialog.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/VariableInsertionDialog.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -97,7 +97,7 @@ */ protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); - getButton(IDialogConstants.OK_ID).setText(SnippetsMessages.Insert_14); //$NON-NLS-1$ + getButton(IDialogConstants.OK_ID).setText(SnippetsMessages.Insert_14); } /* @@ -123,25 +123,25 @@ instructions.setBackground(composite.getBackground()); doubleWide.heightHint = instructions.getFont().getFontData()[0].getHeight() * 3; instructions.setLayoutData(doubleWide); - instructions.setText(SnippetsMessages.Edit_Instruction); //$NON-NLS-1$ + instructions.setText(SnippetsMessages.Edit_Instruction); instructions.setEditable(false); Text tableLabel = new Text(composite, SWT.NONE); tableLabel.setBackground(composite.getBackground()); - tableLabel.setText(SnippetsMessages.Variables__4); //$NON-NLS-1$ + tableLabel.setText(SnippetsMessages.Variables__4); tableLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); tableLabel.setEditable(false); Text descriptionBoxLabel = new Text(composite, SWT.NONE); descriptionBoxLabel.setBackground(composite.getBackground()); - descriptionBoxLabel.setText(SnippetsMessages.Description_of_variable__5); //$NON-NLS-1$ + descriptionBoxLabel.setText(SnippetsMessages.Description_of_variable__5); descriptionBoxLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); descriptionBoxLabel.setEditable(false); // pity we can't just use a PropertySheetPage, but the column headers // aren't customizable fTableViewer = new StringPropertyTableViewer(); - fTableViewer.setColumnNames(new String[]{SnippetsMessages.Variable_Name_6, SnippetsMessages.Value_7}); //$NON-NLS-1$ //$NON-NLS-2$ + fTableViewer.setColumnNames(new String[]{SnippetsMessages.Variable_Name_6, SnippetsMessages.Value_7}); fTableViewer.setEditFirstColumn(false); fTableViewer.createContents(composite); GridData data = new GridData(GridData.FILL_BOTH); @@ -170,13 +170,13 @@ fDescriptionPane.setEditable(false); fDescriptionPane.addVerifyKeyListener(createVerifyListener(fDescriptionPane)); fDescriptionPane.setFont(JFaceResources.getDialogFont()); - setAccessible(fDescriptionPane, SnippetsMessages.Description_of_variable__5); //$NON-NLS-1$ + setAccessible(fDescriptionPane, SnippetsMessages.Description_of_variable__5); doubleWide = new GridData(GridData.FILL_BOTH); doubleWide.horizontalSpan = 2; Text previewLabel = new Text(composite, SWT.NULL); previewLabel.setBackground(composite.getBackground()); - previewLabel.setText(SnippetsMessages.Preview__9); //$NON-NLS-1$ + previewLabel.setText(SnippetsMessages.Preview__9); previewLabel.setEditable(false); doubleWide = new GridData(GridData.FILL_BOTH); @@ -194,7 +194,7 @@ fPreviewPane.setEditable(false); fPreviewPane.setFont(JFaceResources.getTextFont()); fPreviewPane.setLayoutData(doubleWide); - setAccessible(fPreviewPane, SnippetsMessages.Preview__9); //$NON-NLS-1$ + setAccessible(fPreviewPane, SnippetsMessages.Preview__9); if (fItem != null) { fTableViewer.clear(); @@ -232,9 +232,9 @@ String shellLabel = ""; //$NON-NLS-1$ String itemLabel = getItem().getLabel(); if (itemLabel != null && itemLabel.length() > 0) - shellLabel = SnippetsMessages.Insert_Template___1 + " " + itemLabel; //$NON-NLS-1$ //$NON-NLS-2$ + shellLabel = SnippetsMessages.Insert_Template___1 + " " + itemLabel; //$NON-NLS-1$ else - shellLabel = SnippetsMessages.Insert_Template_2; //$NON-NLS-1$ + shellLabel = SnippetsMessages.Insert_Template_2; return shellLabel; }
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/AbstractCategoryAction.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/AbstractCategoryAction.java index dde1e9e..a862cf9 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/AbstractCategoryAction.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/AbstractCategoryAction.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,7 +27,7 @@ public String isValid(String name) { // Don't allow blank names if (name == null || name.length() < 1) { - return (SnippetsMessages.A_name_must_be_specified_1); //$NON-NLS-1$ + return (SnippetsMessages.A_name_must_be_specified_1); } return null; } @@ -46,7 +46,7 @@ } public AbstractCategoryAction(String text, SnippetsView viewer, PaletteContainer entry) { - super(text); //$NON-NLS-1$ + super(text); fContainer = entry; fViewer = viewer; }
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/DeleteCategoryAction.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/DeleteCategoryAction.java index a5418f8..167c3db 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/DeleteCategoryAction.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/DeleteCategoryAction.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -22,7 +22,7 @@ public DeleteCategoryAction(SnippetsView viewer, PaletteContainer container) { - super(SnippetsMessages.Delete_1, viewer, container); //$NON-NLS-1$ + super(SnippetsMessages.Delete_1, viewer, container); } public void run() {
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/DeleteItemAction.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/DeleteItemAction.java index a1abd3e..e857bb8 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/DeleteItemAction.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/actions/DeleteItemAction.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,7 +30,7 @@ */ public DeleteItemAction(GraphicalViewer viewer, PaletteEntry entry) { super(viewer, entry); - setText(SnippetsMessages.Delete_1); //$NON-NLS-1$ + setText(SnippetsMessages.Delete_1); setId("delete"); //$NON-NLS-1$ }
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/editors/VariableItemEditor.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/editors/VariableItemEditor.java index a25ad75..c2208cd 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/editors/VariableItemEditor.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/editors/VariableItemEditor.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -232,7 +232,7 @@ variableComposite.setLayout(sublayout); Label nameLabel = new Label(variableComposite, SWT.NONE); - nameLabel.setText(SnippetsMessages.Variables__4); //$NON-NLS-1$ + nameLabel.setText(SnippetsMessages.Variables__4); GridData doubleData = new GridData(GridData.FILL_HORIZONTAL); nameLabel.setLayoutData(doubleData); @@ -240,9 +240,9 @@ throwAway.setLayoutData(new GridData()); // saved and made final here to update the template text area below - final String nameProperty = SnippetsMessages.Name_5; //$NON-NLS-1$ + final String nameProperty = SnippetsMessages.Name_5; fTableViewer = new StringPropertyTableViewer(); - fTableViewer.setColumnNames(new String[]{nameProperty, SnippetsMessages.Description_6, SnippetsMessages.Default_Value_7}); //$NON-NLS-1$ //$NON-NLS-2$ + fTableViewer.setColumnNames(new String[]{nameProperty, SnippetsMessages.Description_6, SnippetsMessages.Default_Value_7}); fTableViewer.createContents(variableComposite); GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); @@ -277,7 +277,7 @@ // input. // TODO: for usability, throw up a dialog in the middle Button addButton = new Button(variableButtons, SWT.PUSH); - addButton.setText(SnippetsMessages.New_1); //$NON-NLS-1$ + addButton.setText(SnippetsMessages.New_1); addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); addButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { @@ -300,11 +300,11 @@ // add the Remove button with a listener to enable it only when a // cell is selected and in focus final Button removeButton = new Button(variableButtons, SWT.PUSH); - removeButton.setText(SnippetsMessages.Remove_15); //$NON-NLS-1$ + removeButton.setText(SnippetsMessages.Remove_15); removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); nameLabel = new Label(parent, SWT.NONE); - nameLabel.setText(SnippetsMessages.Template_Pattern__16); //$NON-NLS-1$ + nameLabel.setText(SnippetsMessages.Template_Pattern__16); nameLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); // create a source viewer for to edit the text (makes it easier to @@ -399,7 +399,7 @@ // specifically associate the template pattern label w/ the content // styled text so screen reader reads it - setAccessible(content, SnippetsMessages.Template_Pattern__16); //$NON-NLS-1$ + setAccessible(content, SnippetsMessages.Template_Pattern__16); // add a value change listener to the fTableViewer so that changes to // the name property of a variable @@ -422,7 +422,7 @@ * making content assist obviously available in the source viewer. */ final Button insertVariableButton = new Button(parent, SWT.PUSH); - insertVariableButton.setText(SnippetsMessages.Insert_Variable_17); //$NON-NLS-1$ + insertVariableButton.setText(SnippetsMessages.Insert_Variable_17); insertVariableButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING)); insertVariableButton.setEnabled(fTableViewer.getTable().getItemCount() > 0); insertVariableButton.addSelectionListener(new SelectionListener() {
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/model/SnippetManager.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/model/SnippetManager.java index 7df3422..3a7bd18 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/model/SnippetManager.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/model/SnippetManager.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -78,7 +78,7 @@ if (instance == null) { instance = new SnippetManager(); try { - hiddenStateFile = SnippetsPlugin.getDefault().getStateLocation().append("hidden.xml").toFile(); + hiddenStateFile = SnippetsPlugin.getDefault().getStateLocation().append("hidden.xml").toFile(); //$NON-NLS-1$ } catch (Exception e) { hiddenStateFile = new File("/hidden.xml"); //$NON-NLS-1$ @@ -454,7 +454,7 @@ File storageFolder = new File(snippetStorage.toOSString()); if (!storageFolder.exists()){ if (!storageFolder.mkdirs()){ - return createErrorStatus("Could not create snippet storage folder.", null); + return createErrorStatus("Could not create snippet storage folder.", null); //$NON-NLS-1$ } } for (int i = 0; i < pathList.length; i++) { @@ -463,7 +463,7 @@ File destination = new File(destPath.toOSString()); if (!destination.getParentFile().exists()){ if (!destination.getParentFile().mkdirs()){ - return createErrorStatus("Could not create snippet storage folder.", null); + return createErrorStatus("Could not create snippet storage folder.", null); //$NON-NLS-1$ } } try {
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/ModelFactoryForUser.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/ModelFactoryForUser.java index 8a68321..326c918 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/ModelFactoryForUser.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/ModelFactoryForUser.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -306,11 +306,11 @@ } child = child.getNextSibling(); } - return s.toString(); //$NON-NLS-1$ + return s.toString(); } element = element.getNextSibling(); } - return s.toString(); //$NON-NLS-1$ + return s.toString(); } protected void setProperties(SnippetPaletteDrawer category, Object source) {
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetCustomizerDialog.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetCustomizerDialog.java index 07ea690..357aaa1 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetCustomizerDialog.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetCustomizerDialog.java
@@ -72,7 +72,7 @@ private class ExportAction extends PaletteCustomizationAction { public ExportAction() { setEnabled(false); - setText(SnippetsMessages.SnippetCustomizerDialog_1); //$NON-NLS-1$ + setText(SnippetsMessages.SnippetCustomizerDialog_1); setImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_ELCL_EXPORT)); setDisabledImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_DLCL_EXPORT)); setHoverImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_CLCL_EXPORT)); @@ -111,7 +111,7 @@ try { SnippetDefinitions definitions = getCategory(exportCategory, filename); outputStream = new ZipOutputStream(new FileOutputStream(filename)); - ZipEntry descriptorFile = new ZipEntry("snippets.xml"); + ZipEntry descriptorFile = new ZipEntry("snippets.xml"); //$NON-NLS-1$ outputStream.putNextEntry(descriptorFile); new UserModelDumper().write(definitions, outputStream); ISnippetCategory existingCategory = definitions.getCategory(exportCategory.getId()); @@ -202,7 +202,7 @@ if (existingCategory == null) definitions.getCategories().add(exportCategory); else { - String title = SnippetsMessages.SnippetCustomizerDialog_2; //$NON-NLS-1$ + String title = SnippetsMessages.SnippetCustomizerDialog_2; String message = NLS.bind(SnippetsMessages.SnippetCustomizerDialog_4, new String[]{existingCategory.getLabel()}); boolean answer = MessageDialog.openConfirm(getShell(), title, message); if (answer) { @@ -244,7 +244,7 @@ private class ImportAction extends PaletteCustomizationAction { public ImportAction() { setEnabled(false); - setText(SnippetsMessages.SnippetCustomizerDialog_0); //$NON-NLS-1$ + setText(SnippetsMessages.SnippetCustomizerDialog_0); setImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_ELCL_IMPORT)); setDisabledImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_DLCL_IMPORT)); setHoverImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_CLCL_IMPORT)); @@ -261,9 +261,9 @@ fileDialog.setFilterExtensions(filterExtensions); String filename = fileDialog.open(); try { - if (filename.toLowerCase().endsWith(".zip")) { + if (filename.toLowerCase().endsWith(".zip")) { //$NON-NLS-1$ ZipFile zip = new ZipFile(new File(filename)); - ZipEntry entry = zip.getEntry("snippets.xml"); + ZipEntry entry = zip.getEntry("snippets.xml"); //$NON-NLS-1$ loadMetadata(zip.getInputStream(entry)); Bundle bundle = Platform.getBundle(SnippetsPlugin.BUNDLE_ID); unzip(zip, Platform.getStateLocation(bundle).toOSString()); @@ -296,7 +296,7 @@ boolean found = false; for (int j = 0; j < currentCategories.size(); j++) { if (((PaletteEntry) currentCategories.get(j)).getId().compareToIgnoreCase((((PaletteEntry) importCategories.get(i))).getId()) == 0) { - String title = SnippetsMessages.SnippetCustomizerDialog_2; //$NON-NLS-1$ + String title = SnippetsMessages.SnippetCustomizerDialog_2; String message = NLS.bind(SnippetsMessages.SnippetCustomizerDialog_3, new String[]{((PaletteEntry) currentCategories.get(j)).getLabel()}); boolean answer = MessageDialog.openConfirm(getShell(), title, message); if (answer) { @@ -391,7 +391,7 @@ if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } - if (entry.getName().toLowerCase().equals("snippets.xml")) { + if (entry.getName().toLowerCase().equals("snippets.xml")) { //$NON-NLS-1$ continue; }
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetPaletteDrawerFactory.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetPaletteDrawerFactory.java index e72e562..7a03a53 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetPaletteDrawerFactory.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetPaletteDrawerFactory.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -23,7 +23,7 @@ public SnippetPaletteDrawerFactory() { super(); - setLabel(SnippetsMessages.New_Category_Title); //$NON-NLS-1$ + setLabel(SnippetsMessages.New_Category_Title); setImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_CLCL_NEW_CATEGORY)); } @@ -31,10 +31,10 @@ * @see org.eclipse.gef.ui.palette.customize.PaletteEntryFactory#createNewEntry(org.eclipse.swt.widgets.Shell) */ protected PaletteEntry createNewEntry(Shell shell) { - SnippetPaletteDrawer drawer = new SnippetPaletteDrawer(SnippetsMessages.Unnamed_Category); //$NON-NLS-1$ + SnippetPaletteDrawer drawer = new SnippetPaletteDrawer(SnippetsMessages.Unnamed_Category); drawer.setType(PaletteDrawer.PALETTE_TYPE_DRAWER); drawer.setDrawerType(PaletteTemplateEntry.PALETTE_TYPE_TEMPLATE); - drawer.setId(SnippetsMessages.category + "_" + System.currentTimeMillis()); //$NON-NLS-1$ //$NON-NLS-2$ + drawer.setId(SnippetsMessages.category + "_" + System.currentTimeMillis()); //$NON-NLS-1$ drawer.setUserModificationPermission(PaletteEntry.PERMISSION_FULL_MODIFICATION); drawer.setFilters(getDefaultFilters()); return drawer;
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetPaletteItemFactory.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetPaletteItemFactory.java index a036c8f..2b0b9ee 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetPaletteItemFactory.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/SnippetPaletteItemFactory.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,7 +24,7 @@ */ public SnippetPaletteItemFactory() { super(); - setLabel(SnippetsMessages.New_Item_Title); //$NON-NLS-1$ + setLabel(SnippetsMessages.New_Item_Title); setImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_CLCL_NEW_TEMPLATE)); } @@ -34,9 +34,9 @@ * @see org.eclipse.gef.ui.palette.customize.PaletteEntryFactory#createNewEntry(org.eclipse.swt.widgets.Shell) */ protected PaletteEntry createNewEntry(Shell shell) { - SnippetPaletteItem item = new SnippetPaletteItem(SnippetsMessages.Unnamed_Template_1); //$NON-NLS-1$ - item.setId(SnippetsMessages.item + "_" + System.currentTimeMillis()); //$NON-NLS-1$ //$NON-NLS-2$ - item.setLabel(SnippetsMessages.Unnamed_Template_1); //$NON-NLS-1$ + SnippetPaletteItem item = new SnippetPaletteItem(SnippetsMessages.Unnamed_Template_1); + item.setId(SnippetsMessages.item + "_" + System.currentTimeMillis()); //$NON-NLS-1$ + item.setLabel(SnippetsMessages.Unnamed_Template_1); item.setUserModificationPermission(PaletteEntry.PERMISSION_FULL_MODIFICATION); return item; }
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/WorkspaceModelDumper.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/WorkspaceModelDumper.java index 4c649a8..c6e8bca 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/WorkspaceModelDumper.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/palette/WorkspaceModelDumper.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -236,7 +236,7 @@ public void write(ISnippetCategory category, OutputStream ostream) { Document document = createDocument(category); try { - CommonXML.serialize(document, ostream); //$NON-NLS-1$ + CommonXML.serialize(document, ostream); ostream.flush(); } catch (IOException e) {
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/SnippetDrawerEntryPage.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/SnippetDrawerEntryPage.java index 6e1968e..e3d69ea 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/SnippetDrawerEntryPage.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/SnippetDrawerEntryPage.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -123,8 +123,8 @@ protected void browsePressed() { ListSelectionDialog dialog = new ListSelectionDialog(getControl().getShell(), Platform.getContentTypeManager(), new ContentTypeStructuredContentProvider(), new ContentTypeLabelProvider(), null); - dialog.setTitle(SnippetsMessages.SnippetDrawerEntryPage_5); //$NON-NLS-1$ - dialog.setMessage(SnippetsMessages.SnippetDrawerEntryPage_6); //$NON-NLS-1$ + dialog.setTitle(SnippetsMessages.SnippetDrawerEntryPage_5); + dialog.setMessage(SnippetsMessages.SnippetDrawerEntryPage_6); ArrayList initialSelections = new ArrayList(); IContentType[] contentTypes = Platform.getContentTypeManager().getAllContentTypes(); ISnippetsEntry snippetEntry = (ISnippetsEntry) getEntry(); @@ -185,16 +185,16 @@ }; fAlwaysShowButton = new Button(radioGroup, SWT.RADIO); - fAlwaysShowButton.setText(SnippetsMessages.SnippetDrawerEntryPage_1); //$NON-NLS-1$ + fAlwaysShowButton.setText(SnippetsMessages.SnippetDrawerEntryPage_1); fAlwaysShowButton.setSelection(true); fAlwaysShowButton.addSelectionListener(updateEnablement); fAlwaysHideButton = new Button(radioGroup, SWT.RADIO); - fAlwaysHideButton.setText(SnippetsMessages.SnippetDrawerEntryPage_2); //$NON-NLS-1$ + fAlwaysHideButton.setText(SnippetsMessages.SnippetDrawerEntryPage_2); fAlwaysHideButton.addSelectionListener(updateEnablement); fCustomButton = new Button(radioGroup, SWT.RADIO); - fCustomButton.setText(SnippetsMessages.SnippetDrawerEntryPage_3); //$NON-NLS-1$ + fCustomButton.setText(SnippetsMessages.SnippetDrawerEntryPage_3); fCustomButton.addSelectionListener(updateEnablement); return radioGroup; @@ -217,7 +217,7 @@ fContentTypeText.setLayoutData(contentTypeTextGridData); fBrowseButton = new Button(contentTypeTextRow, SWT.PUSH); - fBrowseButton.setText(SnippetsMessages.SnippetDrawerEntryPage_4); //$NON-NLS-1$ + fBrowseButton.setText(SnippetsMessages.SnippetDrawerEntryPage_4); fBrowseButton.setEnabled(false); GridData browseButtonGridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL); fBrowseButton.setLayoutData(browseButtonGridData); @@ -237,7 +237,7 @@ Control[] tablist = new Control[panel.getTabList().length + 2]; System.arraycopy(panel.getTabList(), 0, tablist, 0, tablist.length - 2); - createLabel(panel, SWT.NONE, SnippetsMessages.SnippetDrawerEntryPage_0); //$NON-NLS-1$ + createLabel(panel, SWT.NONE, SnippetsMessages.SnippetDrawerEntryPage_0); tablist[tablist.length - 2] = createContentTypeRadios(panel); tablist[tablist.length - 1] = createContentTypeTextRow(panel);
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/SnippetsView.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/SnippetsView.java index 45ceda2..448492a 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/SnippetsView.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/SnippetsView.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -91,7 +91,7 @@ protected class CopyAction extends Action { public CopyAction() { - super(SnippetsMessages.Copy_2); //$NON-NLS-1$ + super(SnippetsMessages.Copy_2); setImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_ELCL_COPY)); setHoverImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_CLCL_COPY)); setDisabledImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_DLCL_COPY)); @@ -107,7 +107,7 @@ protected class CutAction extends Action { public CutAction() { - super(SnippetsMessages.Cut_2); //$NON-NLS-1$ + super(SnippetsMessages.Cut_2); setImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_ELCL_CUT)); setHoverImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_CLCL_CUT)); setDisabledImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_DLCL_CUT)); @@ -124,7 +124,7 @@ protected class DeleteAction extends Action { public DeleteAction() { - super(SnippetsMessages.Delete_1); //$NON-NLS-1$ + super(SnippetsMessages.Delete_1); setImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_ELCL_DELETE)); setHoverImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_CLCL_DELETE)); setDisabledImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_DLCL_DELETE)); @@ -275,7 +275,7 @@ protected class PasteAction extends Action { public PasteAction() { - super(SnippetsMessages.Paste_4); //$NON-NLS-1$ + super(SnippetsMessages.Paste_4); setImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_ELCL_PASTE)); setHoverImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_CLCL_PASTE)); setDisabledImageDescriptor(SnippetsPluginImageHelper.getInstance().getImageDescriptor(SnippetsPluginImages.IMG_DLCL_PASTE)); @@ -315,7 +315,7 @@ // if the selected entry isn't user owned if (destination == null || destination.getSourceType() == ISnippetsEntry.SNIPPET_SOURCE_PLUGINS) { UserDrawerSelector selector = new UserDrawerSelector(getSite().getShell()); - selector.setSelectionPrompt(SnippetsMessages.Cant_add_to_this); //$NON-NLS-1$ + selector.setSelectionPrompt(SnippetsMessages.Cant_add_to_this); SnippetPaletteDrawer drawer = (SnippetPaletteDrawer) selector.getUserDrawer(); if (drawer != null) destination = drawer; @@ -352,7 +352,7 @@ ISnippetsEntry entry = SnippetsView.this.getSelectedEntry(); if (entry == null || entry.getSourceType() == ISnippetsEntry.SNIPPET_SOURCE_PLUGINS) { UserDrawerSelector selector = new UserDrawerSelector(getSite().getShell()); - selector.setSelectionPrompt(SnippetsMessages.Cant_add_to_this); //$NON-NLS-1$ + selector.setSelectionPrompt(SnippetsMessages.Cant_add_to_this); SnippetPaletteDrawer drawer = (SnippetPaletteDrawer) selector.getUserDrawer(); if (drawer != null) entry = drawer; @@ -374,10 +374,10 @@ public void update() { if (getClipboard().getContents(SnippetTransfer.getTransferInstance()) == null && getClipboard().getContents(TextTransfer.getInstance()) != null) { - setText(SnippetsMessages.Paste_as_Snippet); //$NON-NLS-1$ + setText(SnippetsMessages.Paste_as_Snippet); } else { - setText(SnippetsMessages.Paste_4); //$NON-NLS-1$ + setText(SnippetsMessages.Paste_4); } setToolTipText(getText()); }
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/StringPropertyTableViewer.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/StringPropertyTableViewer.java index edefceb..f51aa01 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/StringPropertyTableViewer.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/ui/StringPropertyTableViewer.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -255,7 +255,7 @@ */ public String[] getColumnNames() { if (fColumnNames == null) - return new String[]{SnippetsMessages.Variable_Name_3, SnippetsMessages.Value_4}; //$NON-NLS-1$ //$NON-NLS-2$ + return new String[]{SnippetsMessages.Variable_Name_3, SnippetsMessages.Value_4}; return fColumnNames; }
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/StringUtils.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/StringUtils.java index 98dac8e..e59b87d 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/StringUtils.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/StringUtils.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. + * Copyright (c) 2001, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -16,13 +16,15 @@ import java.util.ArrayList; import java.util.List; -import com.ibm.icu.util.StringTokenizer; +import org.eclipse.jface.internal.text.html.HTMLPrinter; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; +import com.ibm.icu.util.StringTokenizer; + public class StringUtils { protected static final String AMPERSTAND = "&"; //$NON-NLS-1$ @@ -33,7 +35,7 @@ protected static final String CRLF = "\r\n"; //$NON-NLS-1$ protected static final String DELIMITERS = " \t\n\r\f"; //$NON-NLS-1$ protected static final String DOUBLE_QUOTE = "\""; //$NON-NLS-1$ - protected static final char DOUBLE_QUOTE_CHAR = '\"'; //$NON-NLS-1$ + protected static final char DOUBLE_QUOTE_CHAR = '\"'; protected static final String DOUBLE_QUOTE_ENTITY = """; //$NON-NLS-1$ protected static final String EQUAL_SIGN = "="; //$NON-NLS-1$ @@ -51,7 +53,7 @@ protected static final String LINE_TAB_ENTITY = "\\t"; //$NON-NLS-1$ protected static final String LINE_TAB_TAG = "<dd>"; //$NON-NLS-1$ protected static final String SINGLE_QUOTE = "'"; //$NON-NLS-1$ - protected static final char SINGLE_QUOTE_CHAR = '\''; //$NON-NLS-1$ + protected static final char SINGLE_QUOTE_CHAR = '\''; protected static final String SINGLE_QUOTE_ENTITY = "'"; //$NON-NLS-1$ protected static final String SPACE = " "; //$NON-NLS-1$ protected static final String SPACE_ENTITY = " "; //$NON-NLS-1$
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/UserDrawerSelector.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/UserDrawerSelector.java index d6e7798..e3e27c1 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/UserDrawerSelector.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/UserDrawerSelector.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -36,7 +36,7 @@ public String isValid(String name) { // Don't allow blank names if (name == null || name.length() < 1) { - return (SnippetsMessages.A_name_must_be_specified_1); //$NON-NLS-1$ + return (SnippetsMessages.A_name_must_be_specified_1); } return null; } @@ -93,7 +93,7 @@ for (int i = 0; i < modifiableCategories.size(); i++) { userDrawers[i] = ((PaletteDrawer) modifiableCategories.get(i)).getLabel(); } - CComboSelectionDialog dlg = new CComboSelectionDialog(fShell, SnippetsMessages.New_Category_Title, (fSelectionPrompt != null ? fSelectionPrompt : SnippetsMessages.choose_or_create), userDrawers, 0, new CategoryNameValidator()) { //$NON-NLS-1$ //$NON-NLS-2$ + CComboSelectionDialog dlg = new CComboSelectionDialog(fShell, SnippetsMessages.New_Category_Title, (fSelectionPrompt != null ? fSelectionPrompt : SnippetsMessages.choose_or_create), userDrawers, 0, new CategoryNameValidator()) { protected Control createDialogArea(Composite parent) { Control mainHook = super.createDialogArea(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(mainHook, IHelpContextIds.ADD_TO_SNIPPETS_DIALOG_CATEGORY); @@ -145,9 +145,9 @@ defaultNewDrawerName = currentEditor.getEditorInput().getName(); } if (defaultNewDrawerName == null) { - defaultNewDrawerName = SnippetsMessages.new_category_name; //$NON-NLS-1$ + defaultNewDrawerName = SnippetsMessages.new_category_name; } - InputDialog d = new InputDialog(fShell, SnippetsMessages.New_Category_Title, (fInputPrompt != null ? fInputPrompt : SnippetsMessages.force_create), defaultNewDrawerName, new CategoryNameValidator()) {//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + InputDialog d = new InputDialog(fShell, SnippetsMessages.New_Category_Title, (fInputPrompt != null ? fInputPrompt : SnippetsMessages.force_create), defaultNewDrawerName, new CategoryNameValidator()) { protected Control createContents(Composite parent) { Control mainHook = super.createContents(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(mainHook, IHelpContextIds.ADD_TO_SNIPPETS_DIALOG_CATEGORY);
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/VisibilityUtil.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/VisibilityUtil.java index 43f8e62..e4bfc3e 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/VisibilityUtil.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/internal/util/VisibilityUtil.java
@@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. + * Copyright (c) 2004, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -15,13 +15,11 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IStorage; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.content.IContentDescription; import org.eclipse.core.runtime.content.IContentType; import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IStorageEditorInput; import org.eclipse.ui.model.IWorkbenchAdapter; import org.eclipse.wst.common.snippets.internal.Logger; @@ -32,7 +30,7 @@ public class VisibilityUtil { public static boolean isContentType(IEditorInput input, String[] filterContentTypes) { boolean isMatch = false; - if (filterContentTypes == null) { + if (filterContentTypes == null || filterContentTypes.length == 0) { isMatch = true; } else if (filterContentTypes.length >= 1) { @@ -61,19 +59,10 @@ // Try the optimized method contentDesc = file.getContentDescription(); if (contentDesc == null) { - // Dig a little deeper using its - // contents - if (file != null) { - contents = file.getContents(); - } - else { - if (input instanceof IStorageEditorInput) { - IStorage storage = ((IStorageEditorInput) input).getStorage(); - if (storage != null) { - contents = storage.getContents(); - } - } - } + /* + * Dig a little deeper using its contents + */ + contents = file.getContents(); contentDesc = Platform.getContentTypeManager().getDescriptionFor(contents, input.getName(), null); if (contents != null) { try {
diff --git a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java index 4edb5af..b1c1546 100644 --- a/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java +++ b/org.eclipse.wst.common.snippets/src/org/eclipse/wst/common/snippets/ui/DefaultSnippetInsertion.java
@@ -170,7 +170,7 @@ insertString = StringUtils.replace(fItem.getContentString(), "${cursor}", ""); //$NON-NLS-1$ //$NON-NLS-2$ } if (insertString == null) - insertString = ""; + insertString = ""; //$NON-NLS-1$ return insertString; }