\r
public class CustomXmlParserInputWizardPage extends WizardPage {\r
\r
- private static final String DEFAULT_TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";\r
- private static final String SIMPLE_DATE_FORMAT_URL = "http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#skip-navbar_top";\r
- private static final Image elementImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/element_icon.gif");\r
- private static final Image addImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/add_button.gif");\r
- private static final Image addNextImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/addnext_button.gif");\r
- private static final Image addChildImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/addchild_button.gif");\r
- private static final Image addManyImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/addmany_button.gif");\r
- private static final Image deleteImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/delete_button.gif");\r
- private static final Image moveUpImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/moveup_button.gif");\r
- private static final Image moveDownImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/movedown_button.gif");\r
- private static final Image helpImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/help_button.gif");\r
+ private static final String DEFAULT_TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS"; //$NON-NLS-1$\r
+ private static final String SIMPLE_DATE_FORMAT_URL = "http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#skip-navbar_top"; //$NON-NLS-1$\r
+ private static final Image elementImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/element_icon.gif"); //$NON-NLS-1$\r
+ private static final Image addImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/add_button.gif"); //$NON-NLS-1$\r
+ private static final Image addNextImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/addnext_button.gif"); //$NON-NLS-1$\r
+ private static final Image addChildImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/addchild_button.gif"); //$NON-NLS-1$\r
+ private static final Image addManyImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/addmany_button.gif"); //$NON-NLS-1$\r
+ private static final Image deleteImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/delete_button.gif"); //$NON-NLS-1$\r
+ private static final Image moveUpImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/moveup_button.gif"); //$NON-NLS-1$\r
+ private static final Image moveDownImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/movedown_button.gif"); //$NON-NLS-1$\r
+ private static final Image helpImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/help_button.gif"); //$NON-NLS-1$\r
private static final Color COLOR_LIGHT_RED = new Color(Display.getDefault(), 255, 192, 192);\r
private static final Color COLOR_TEXT_BACKGROUND = Display.getCurrent().getSystemColor(SWT.COLOR_WHITE);\r
private static final Color COLOR_WIDGET_BACKGROUND = Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);\r
private int logEntryNestedCount;\r
\r
protected CustomXmlParserInputWizardPage(ISelection selection, CustomXmlTraceDefinition definition) {\r
- super("CustomXmlParserWizardPage");\r
+ super("CustomXmlParserWizardPage"); //$NON-NLS-1$\r
if (definition == null) {\r
- setTitle("New Custom XML Parser");\r
- defaultDescription = "Create a new custom parser for XML log files";\r
+ setTitle(Messages.CustomXmlParserInputWizardPage_titleNew);\r
+ defaultDescription = Messages.CustomXmlParserInputWizardPage_descriptionNew;\r
} else {\r
- setTitle("Edit Custom XML Parser");\r
- defaultDescription = "Edit an existing custom parser for XML log files";\r
+ setTitle(Messages.CustomXmlParserInputWizardPage_titleEdit);\r
+ defaultDescription = Messages.CustomXmlParserInputWizardPage_descriptionEdit;\r
}\r
setDescription(defaultDescription);\r
this.selection = selection;\r
headerComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));\r
\r
Label logtypeLabel = new Label(headerComposite, SWT.NULL);\r
- logtypeLabel.setText("Log type:");\r
+ logtypeLabel.setText(Messages.CustomXmlParserInputWizardPage_logType);\r
\r
logtypeText = new Text(headerComposite, SWT.BORDER | SWT.SINGLE);\r
logtypeText.setLayoutData(new GridData(120, SWT.DEFAULT));\r
logtypeText.addModifyListener(updateListener);\r
\r
Label timeStampFormatLabel = new Label(headerComposite, SWT.NULL);\r
- timeStampFormatLabel.setText("Time Stamp format:");\r
+ timeStampFormatLabel.setText(Messages.CustomXmlParserInputWizardPage_timestampFormat);\r
\r
timeStampOutputFormatText = new Text(headerComposite, SWT.BORDER | SWT.SINGLE);\r
timeStampOutputFormatText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));\r
\r
Button dateFormatHelpButton = new Button(headerComposite, SWT.PUSH);\r
dateFormatHelpButton.setImage(helpImage);\r
- dateFormatHelpButton.setToolTipText("Date Format Help");\r
+ dateFormatHelpButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_dateFormatHelp);\r
dateFormatHelpButton.addSelectionListener(new SelectionAdapter() {\r
@Override\r
public void widgetSelected(SelectionEvent e) {\r
\r
Label timeStampPreviewLabel = new Label(headerComposite, SWT.NULL);\r
timeStampPreviewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 3, 1));\r
- timeStampPreviewLabel.setText("Preview:");\r
+ timeStampPreviewLabel.setText(Messages.CustomXmlParserInputWizardPage_preview);\r
\r
timeStampPreviewText = new Text(headerComposite, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);\r
timeStampPreviewText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));\r
- timeStampPreviewText.setText("*no time stamp element or attribute*");\r
+ timeStampPreviewText.setText("*no time stamp element or attribute*"); //$NON-NLS-1$\r
\r
createButtonBar();\r
\r
\r
if (definition.rootInputElement == null) {\r
removeButton.setEnabled(false);\r
- addChildButton.setToolTipText("Add document element");\r
+ addChildButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_addDocumentElement);\r
addNextButton.setEnabled(false);\r
moveUpButton.setEnabled(false);\r
moveDownButton.setEnabled(false);\r
sashBottom.setLayout(sashBottomLayout);\r
\r
Label previewLabel = new Label(sashBottom, SWT.NULL);\r
- previewLabel.setText("Preview input");\r
+ previewLabel.setText(Messages.CustomXmlParserInputWizardPage_previewInput);\r
\r
errorText = new Text(sashBottom, SWT.SINGLE | SWT.READ_ONLY);\r
errorText.setBackground(COLOR_WIDGET_BACKGROUND);\r
\r
inputText = new StyledText(sashBottom, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);\r
if (fixedFont == null) {\r
- if (System.getProperty("os.name").contains("Windows")) {\r
- fixedFont = new Font(Display.getCurrent(), new FontData("Courier New", 10, SWT.NORMAL));\r
+ if (System.getProperty("os.name").contains("Windows")) { //$NON-NLS-1$ //$NON-NLS-2$\r
+ fixedFont = new Font(Display.getCurrent(), new FontData("Courier New", 10, SWT.NORMAL)); //$NON-NLS-1$\r
} else {\r
- fixedFont = new Font(Display.getCurrent(), new FontData("Monospace", 10, SWT.NORMAL));\r
+ fixedFont = new Font(Display.getCurrent(), new FontData("Monospace", 10, SWT.NORMAL)); //$NON-NLS-1$\r
}\r
}\r
inputText.setFont(fixedFont);\r
\r
removeButton = new Button(buttonBar, SWT.PUSH);\r
removeButton.setImage(deleteImage);\r
- removeButton.setToolTipText("Remove element");\r
+ removeButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_removeElement);\r
removeButton.addSelectionListener(new SelectionAdapter() {\r
@Override\r
public void widgetSelected(SelectionEvent e) {\r
removeButton.setEnabled(false);\r
if (definition.rootInputElement == null) {\r
addChildButton.setEnabled(true);\r
- addChildButton.setToolTipText("Add document element");\r
+ addChildButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_addDocumentEleemnt);\r
} else {\r
addChildButton.setEnabled(false);\r
}\r
\r
addChildButton = new Button(buttonBar, SWT.PUSH);\r
addChildButton.setImage(addChildImage);\r
- addChildButton.setToolTipText("Add child element");\r
+ addChildButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_addChildElement);\r
addChildButton.addSelectionListener(new SelectionAdapter() {\r
@Override\r
public void widgetSelected(SelectionEvent e) {\r
- InputElement inputElement = new InputElement("", false, CustomXmlTraceDefinition.TAG_IGNORE, 0, "", null);\r
+ InputElement inputElement = new InputElement("", false, CustomXmlTraceDefinition.TAG_IGNORE, 0, "", null); //$NON-NLS-1$ //$NON-NLS-2$\r
if (definition.rootInputElement == null) {\r
definition.rootInputElement = inputElement;\r
inputElement.elementName = getChildNameSuggestion(null);\r
\r
addNextButton = new Button(buttonBar, SWT.PUSH);\r
addNextButton.setImage(addNextImage);\r
- addNextButton.setToolTipText("Add next element");\r
+ addNextButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_addNextElement);\r
addNextButton.addSelectionListener(new SelectionAdapter() {\r
@Override\r
public void widgetSelected(SelectionEvent e) {\r
- InputElement inputElement = new InputElement("", false, CustomXmlTraceDefinition.TAG_IGNORE, 0, "", null);\r
+ InputElement inputElement = new InputElement("", false, CustomXmlTraceDefinition.TAG_IGNORE, 0, "", null); //$NON-NLS-1$ //$NON-NLS-2$\r
if (definition.rootInputElement == null) {\r
definition.rootInputElement = inputElement;\r
inputElement.elementName = getChildNameSuggestion(null);\r
\r
feelingLuckyButton = new Button(buttonBar, SWT.PUSH);\r
feelingLuckyButton.setImage(addManyImage);\r
- feelingLuckyButton.setToolTipText("Feeling lucky");\r
+ feelingLuckyButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_feelingLucky);\r
feelingLuckyButton.addSelectionListener(new SelectionAdapter() {\r
@Override\r
public void widgetSelected(SelectionEvent e) {\r
InputElement inputElement = null;\r
if (definition.rootInputElement == null) {\r
if (getChildNameSuggestion(null).length() != 0) {\r
- inputElement = new InputElement(getChildNameSuggestion(null), false, CustomXmlTraceDefinition.TAG_IGNORE, 0, "", null);\r
+ inputElement = new InputElement(getChildNameSuggestion(null), false, CustomXmlTraceDefinition.TAG_IGNORE, 0, "", null); //$NON-NLS-1$\r
definition.rootInputElement = inputElement;\r
feelingLucky(inputElement);\r
}\r
\r
moveUpButton = new Button(buttonBar, SWT.PUSH);\r
moveUpButton.setImage(moveUpImage);\r
- moveUpButton.setToolTipText("Move up");\r
+ moveUpButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_moveUp);\r
moveUpButton.addSelectionListener(new SelectionAdapter() {\r
@Override\r
public void widgetSelected(SelectionEvent e) {\r
\r
moveDownButton = new Button(buttonBar, SWT.PUSH);\r
moveDownButton.setImage(moveDownImage);\r
- moveDownButton.setToolTipText("Move down");\r
+ moveDownButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_moveDown);\r
moveDownButton.addSelectionListener(new SelectionAdapter() {\r
@Override\r
public void widgetSelected(SelectionEvent e) {\r
if (attributeName.length() == 0) {\r
break;\r
} else {\r
- InputAttribute attribute = new InputAttribute(attributeName, attributeName, 0, "");\r
+ InputAttribute attribute = new InputAttribute(attributeName, attributeName, 0, ""); //$NON-NLS-1$\r
inputElement.addAttribute(attribute);\r
}\r
}\r
if (childName.length() == 0) {\r
break;\r
} else {\r
- InputElement childElement = new InputElement(childName, false, CustomXmlTraceDefinition.TAG_IGNORE, 0, "", null);\r
+ InputElement childElement = new InputElement(childName, false, CustomXmlTraceDefinition.TAG_IGNORE, 0, "", null); //$NON-NLS-1$\r
inputElement.addChild(childElement);\r
feelingLucky(childElement);\r
}\r
@Override\r
public String getText(Object element) {\r
InputElement inputElement = (InputElement) element;\r
- return (inputElement.elementName.trim().length() == 0) ? "?" : inputElement.elementName;\r
+ return (inputElement.elementName.trim().length() == 0) ? "?" : inputElement.elementName; //$NON-NLS-1$\r
}\r
}\r
\r
updatePreviews();\r
removeButton.setEnabled(true);\r
addChildButton.setEnabled(true);\r
- addChildButton.setToolTipText("Add child element");\r
+ addChildButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_addChildElement);\r
if (definition.rootInputElement == inputElement) {\r
addNextButton.setEnabled(false);\r
} else {\r
removeButton.setEnabled(false);\r
if (definition.rootInputElement == null) {\r
addChildButton.setEnabled(true);\r
- addChildButton.setToolTipText("Add document element");\r
+ addChildButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_addDocumentElement);\r
} else {\r
addChildButton.setEnabled(false);\r
}\r
}\r
\r
private String getName(InputElement inputElement) {\r
- String name = (inputElement.elementName.trim().length() == 0) ? "?" : inputElement.elementName.trim();\r
+ String name = (inputElement.elementName.trim().length() == 0) ? "?" : inputElement.elementName.trim(); //$NON-NLS-1$\r
if (inputElement.parentElement == null) {\r
return name;\r
}\r
- return getName(inputElement.parentElement) + " : " + name;\r
+ return getName(inputElement.parentElement) + " : " + name; //$NON-NLS-1$\r
}\r
\r
private String getName(InputAttribute inputAttribute, InputElement inputElement) {\r
- String name = (inputAttribute.attributeName.trim().length() == 0) ? "?" : inputAttribute.attributeName.trim();\r
- return getName(inputElement) + " : " + name;\r
+ String name = (inputAttribute.attributeName.trim().length() == 0) ? "?" : inputAttribute.attributeName.trim(); //$NON-NLS-1$\r
+ return getName(inputElement) + " : " + name; //$NON-NLS-1$\r
}\r
\r
/* (non-Javadoc)\r
try {\r
inputStream = file.getContents();\r
} catch (CoreException e) {\r
- return "";\r
+ return ""; //$NON-NLS-1$\r
}\r
}\r
}\r
StringBuilder sb = new StringBuilder();\r
String line = null;\r
while ((line = reader.readLine()) != null) {\r
- sb.append(line + "\n");\r
+ sb.append(line + "\n"); //$NON-NLS-1$\r
}\r
parseXmlInput(sb.toString());\r
return sb.toString();\r
} catch (IOException e) {\r
- return "";\r
+ return ""; //$NON-NLS-1$\r
}\r
}\r
- return "";\r
+ return ""; //$NON-NLS-1$\r
}\r
\r
private void parseXmlInput(final String string) {\r
EntityResolver resolver = new EntityResolver () {\r
@Override\r
public InputSource resolveEntity (String publicId, String systemId) {\r
- String empty = "";\r
+ String empty = ""; //$NON-NLS-1$\r
ByteArrayInputStream bais = new ByteArrayInputStream(empty.getBytes());\r
return new InputSource(bais);\r
}\r
dateFormat = new SimpleDateFormat(timeStampOutputFormatText.getText().trim());\r
timeStampPreviewText.setText(dateFormat.format(date));\r
} catch (ParseException e) {\r
- timeStampPreviewText.setText("*parse exception* [" + timeStampValue + "] <> [" + timeStampFormat + "]");\r
+ timeStampPreviewText.setText("*parse exception* [" + timeStampValue + "] <> [" + timeStampFormat + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\r
} catch (IllegalArgumentException e) {\r
- timeStampPreviewText.setText("*parse exception* [Illegal Argument]");\r
+ timeStampPreviewText.setText("*parse exception* [Illegal Argument]"); //$NON-NLS-1$\r
}\r
} else {\r
- timeStampPreviewText.setText("*no matching time stamp*");\r
+ timeStampPreviewText.setText("*no matching time stamp*"); //$NON-NLS-1$\r
}\r
}\r
\r
group.setText(getName(inputElement));\r
\r
Label label = new Label(group, SWT.NULL);\r
- label.setText("Element name:");\r
+ label.setText(Messages.CustomXmlParserInputWizardPage_elementName);\r
label.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));\r
\r
elementNameText = new Text(group, SWT.BORDER | SWT.SINGLE);\r
if (inputElement.parentElement != null) {\r
previewLabel = new Label(group, SWT.NULL);\r
previewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));\r
- previewLabel.setText("Preview:");\r
+ previewLabel.setText(Messages.CustomXmlParserInputWizardPage_preview);\r
\r
previewText = new Text(group, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);\r
gd = new GridData(SWT.FILL, SWT.CENTER, true, false);\r
gd.widthHint = 0;\r
previewText.setLayoutData(gd);\r
- previewText.setText("*no matching element*");\r
+ previewText.setText(Messages.CustomXmlParserInputWizardPage_noMatchingElement);\r
previewText.setBackground(COLOR_WIDGET_BACKGROUND);\r
\r
logEntryButton = new Button(group, SWT.CHECK);\r
- logEntryButton.setText("Log Entry");\r
+ logEntryButton.setText(Messages.CustomXmlParserInputWizardPage_logEntry);\r
logEntryButton.setSelection(inputElement.logEntry);\r
logEntryButton.addSelectionListener(new SelectionListener(){\r
@Override\r
actionCombo.setVisible(false);\r
break;\r
case 1: //Time Stamp\r
- tagLabel.setText("format:");\r
+ tagLabel.setText(Messages.CustomXmlParserInputWizardPage_format);\r
tagLabel.setVisible(true);\r
tagText.setVisible(true);\r
tagText.addModifyListener(updateListener);\r
actionCombo.setVisible(true);\r
break;\r
case 3: //Other\r
- tagLabel.setText("tag name:");\r
+ tagLabel.setText(Messages.CustomXmlParserInputWizardPage_tagName);\r
tagLabel.setVisible(true);\r
if (tagText.getText().trim().length() == 0) {\r
tagText.setText(elementNameText.getText().trim());\r
tagText.setLayoutData(gd);\r
\r
actionCombo = new Combo(tagComposite, SWT.DROP_DOWN | SWT.READ_ONLY);\r
- actionCombo.setItems(new String[] {"Set", "Append", "Append with |"});\r
+ actionCombo.setItems(new String[] {Messages.CustomXmlParserInputWizardPage_set, Messages.CustomXmlParserInputWizardPage_append, Messages.CustomXmlParserInputWizardPage_appendWith});\r
actionCombo.select(inputElement.inputAction);\r
actionCombo.addSelectionListener(updateListener);\r
\r
actionCombo.setVisible(false);\r
} else if (inputElement.inputName.equals(CustomXmlTraceDefinition.TAG_TIMESTAMP)) {\r
tagCombo.select(1);\r
- tagLabel.setText("format:");\r
+ tagLabel.setText(Messages.CustomXmlParserInputWizardPage_format);\r
tagText.setText(inputElement.inputFormat);\r
tagText.addModifyListener(updateListener);\r
} else if (inputElement.inputName.equals(CustomXmlTraceDefinition.TAG_MESSAGE)) {\r
tagText.setVisible(false);\r
} else {\r
tagCombo.select(3);\r
- tagLabel.setText("tag name:");\r
+ tagLabel.setText(Messages.CustomXmlParserInputWizardPage_tagName);\r
tagText.setText(inputElement.inputName);\r
tagText.addModifyListener(updateListener);\r
}\r
private void updatePreview() {\r
Element element = getPreviewElement(inputElement);\r
if (inputElement.parentElement != null) { // no preview text for document element\r
- previewText.setText("*no matching element*");\r
+ previewText.setText(Messages.CustomXmlParserInputWizardPage_noMatchingElement);\r
if (element != null) {\r
previewText.setText(CustomXmlTrace.parseElement(element, new StringBuffer()).toString());\r
if (logEntryButton.getSelection()) {\r
}\r
} else if (actionCombo.getSelectionIndex() == CustomXmlTraceDefinition.ACTION_APPEND_WITH_SEPARATOR) {\r
if (timeStampValue != null) {\r
- timeStampValue += " | " + value;\r
- timeStampFormat += " | " + tagText.getText().trim();\r
+ timeStampValue += " | " + value; //$NON-NLS-1$\r
+ timeStampFormat += " | " + tagText.getText().trim(); //$NON-NLS-1$\r
} else {\r
timeStampValue = value;\r
timeStampFormat = tagText.getText().trim();\r
}\r
} else if (attribute.actionCombo.getSelectionIndex() == CustomXmlTraceDefinition.ACTION_APPEND_WITH_SEPARATOR) {\r
if (timeStampValue != null) {\r
- timeStampValue += " | " + value;\r
- timeStampFormat += " | " + attribute.tagText.getText().trim();\r
+ timeStampValue += " | " + value; //$NON-NLS-1$\r
+ timeStampFormat += " | " + attribute.tagText.getText().trim(); //$NON-NLS-1$\r
} else {\r
timeStampValue = value;\r
timeStampFormat = attribute.tagText.getText().trim();\r
}\r
}\r
} else {\r
- attribute.previewText.setText("*no matching attribute*");\r
+ attribute.previewText.setText(Messages.CustomXmlParserInputWizardPage_noMatchingAttribute);\r
}\r
} else {\r
- attribute.previewText.setText("*no matching element*");\r
+ attribute.previewText.setText(Messages.CustomXmlParserInputWizardPage_noMatchingElement);\r
}\r
}\r
for (ElementNode child : childElements) {\r
\r
addAttributeButton = new Button(addAttributeComposite, SWT.PUSH);\r
addAttributeButton.setImage(addImage);\r
- addAttributeButton.setToolTipText("Add attribute");\r
+ addAttributeButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_addAttribute);\r
addAttributeButton.addSelectionListener(new SelectionAdapter() {\r
@Override\r
public void widgetSelected(SelectionEvent e) {\r
removeAddButton();\r
String attributeName = getAttributeNameSuggestion(inputElement);\r
- InputAttribute inputAttribute = new InputAttribute(attributeName, attributeName, 0, "");\r
+ InputAttribute inputAttribute = new InputAttribute(attributeName, attributeName, 0, ""); //$NON-NLS-1$\r
attributes.add(new Attribute(group, ElementNode.this, inputAttribute, attributes.size()+1));\r
createAddButton();\r
elementContainer.layout();\r
\r
addAttributeLabel = new Label(addAttributeComposite, SWT.NULL);\r
addAttributeLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));\r
- addAttributeLabel.setText("New attribute");\r
+ addAttributeLabel.setText(Messages.CustomXmlParserInputWizardPage_newAttibute);\r
}\r
\r
private void removeAddButton() {\r
Button deleteButton = new Button(labelComposite, SWT.PUSH);\r
deleteButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));\r
deleteButton.setImage(deleteImage);\r
- deleteButton.setToolTipText("Remove attribute");\r
+ deleteButton.setToolTipText(Messages.CustomXmlParserInputWizardPage_removeAttribute);\r
deleteButton.addSelectionListener(new SelectionAdapter() {\r
@Override\r
public void widgetSelected(SelectionEvent e) {\r
\r
attributeLabel = new Label(labelComposite, SWT.NULL);\r
attributeLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));\r
- attributeLabel.setText("Attribute");\r
+ attributeLabel.setText(Messages.CustomXmlParserInputWizardPage_attibute);\r
\r
attributeComposite = new Composite(parent, SWT.FILL);\r
GridLayout attributeLayout = new GridLayout(4, false);\r
attributeComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));\r
\r
Label nameLabel = new Label(attributeComposite, SWT.NONE);\r
- nameLabel.setText("name:");\r
+ nameLabel.setText(Messages.CustomXmlParserInputWizardPage_name);\r
\r
attributeNameText = new Text(attributeComposite, SWT.BORDER | SWT.SINGLE);\r
attributeNameText.setLayoutData(new GridData(120, SWT.DEFAULT));\r
attributeNameText.addModifyListener(updateListener);\r
\r
Label previewLabel = new Label(attributeComposite, SWT.NONE);\r
- previewLabel.setText("Preview:");\r
+ previewLabel.setText(Messages.CustomXmlParserInputWizardPage_preview);\r
\r
previewText = new Text(attributeComposite, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);\r
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);\r
gd.widthHint = 0;\r
previewText.setLayoutData(gd);\r
- previewText.setText("*no match*");\r
+ previewText.setText(Messages.CustomXmlParserInputWizardPage_noMatch);\r
previewText.setBackground(COLOR_WIDGET_BACKGROUND);\r
\r
filler = new Label(parent, SWT.NULL);\r
tagText.removeModifyListener(updateListener);\r
switch (tagCombo.getSelectionIndex()) {\r
case 0: //Time Stamp\r
- tagLabel.setText("format:");\r
+ tagLabel.setText(Messages.CustomXmlParserInputWizardPage_format);\r
tagLabel.setVisible(true);\r
tagText.setVisible(true);\r
tagText.addModifyListener(updateListener);\r
tagText.setVisible(false);\r
break;\r
case 2: //Other\r
- tagLabel.setText("tag name:");\r
+ tagLabel.setText(Messages.CustomXmlParserInputWizardPage_tagName);\r
tagLabel.setVisible(true);\r
if (tagText.getText().trim().length() == 0) {\r
tagText.setText(attributeNameText.getText().trim());\r
tagText.setText(attributeNameText.getText());\r
\r
actionCombo = new Combo(tagComposite, SWT.DROP_DOWN | SWT.READ_ONLY);\r
- actionCombo.setItems(new String[] {"Set", "Append", "Append with |"});\r
+ actionCombo.setItems(new String[] {Messages.CustomXmlParserInputWizardPage_set, Messages.CustomXmlParserInputWizardPage_append, Messages.CustomXmlParserInputWizardPage_appendWith});\r
actionCombo.select(inputAttribute.inputAction);\r
actionCombo.addSelectionListener(updateListener);\r
\r
if (inputAttribute.inputName.equals(CustomXmlTraceDefinition.TAG_TIMESTAMP)) {\r
tagCombo.select(0);\r
- tagLabel.setText("format:");\r
+ tagLabel.setText(Messages.CustomXmlParserInputWizardPage_format);\r
tagText.setText(inputAttribute.inputFormat);\r
tagText.addModifyListener(updateListener);\r
} else if (inputAttribute.inputName.equals(CustomXmlTraceDefinition.TAG_MESSAGE)) {\r
tagText.setVisible(false);\r
} else {\r
tagCombo.select(2);\r
- tagLabel.setText("tag name:");\r
+ tagLabel.setText(Messages.CustomXmlParserInputWizardPage_tagName);\r
tagText.setText(inputAttribute.inputName);\r
tagText.addModifyListener(updateListener);\r
}\r
}\r
}\r
}\r
- return ("");\r
+ return ""; //$NON-NLS-1$\r
}\r
\r
private String getAttributeNameSuggestion(InputElement inputElement) {\r
}\r
}\r
}\r
- return ("");\r
+ return ""; //$NON-NLS-1$\r
}\r
\r
private void validate() {\r
StringBuffer errors = new StringBuffer();\r
\r
if (definition.definitionName.length() == 0) {\r
- errors.append("Enter a name for the new log type. ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_62);\r
logtypeText.setBackground(COLOR_LIGHT_RED);\r
} else {\r
logtypeText.setBackground(COLOR_TEXT_BACKGROUND);\r
for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {\r
if (definition.definitionName.equals(def.definitionName)) {\r
if (editDefinitionName == null || ! editDefinitionName.equals(definition.definitionName)) {\r
- errors.append("The log type name already exists. ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_63);\r
logtypeText.setBackground(COLOR_LIGHT_RED);\r
break;\r
}\r
}\r
\r
if (definition.rootInputElement == null) {\r
- errors.append("Add a document element. ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_64);\r
}\r
\r
if (definition.rootInputElement != null) {\r
if ((definition.rootInputElement.attributes != null && definition.rootInputElement.attributes.size() != 0) ||\r
(definition.rootInputElement.childElements != null && definition.rootInputElement.childElements.size() != 0) || errors.length() == 0) {\r
if (!logEntryFound) {\r
- errors.append("Identify a Log Entry element. ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_65);\r
}\r
\r
if (timeStampFound) {\r
if (timeStampOutputFormatText.getText().trim().length() == 0) {\r
- errors.append("Enter the output format for the Time Stamp field. ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_66);\r
timeStampOutputFormatText.setBackground(COLOR_LIGHT_RED);\r
} else {\r
try {\r
new SimpleDateFormat(timeStampOutputFormatText.getText().trim());\r
timeStampOutputFormatText.setBackground(COLOR_TEXT_BACKGROUND);\r
} catch (IllegalArgumentException e) {\r
- errors.append("Enter a valid output format for the Time Stamp field. ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_67);\r
timeStampOutputFormatText.setBackground(COLOR_LIGHT_RED);\r
}\r
}\r
} else {\r
- timeStampPreviewText.setText("*no time stamp element or attribute*");\r
+ timeStampPreviewText.setText(Messages.CustomXmlParserInputWizardPage_68);\r
}\r
}\r
} else {\r
- timeStampPreviewText.setText("*no time stamp element or attribute*");\r
+ timeStampPreviewText.setText(Messages.CustomXmlParserInputWizardPage_69);\r
}\r
\r
if (errors.length() == 0) {\r
if (selectedElement != null && selectedElement.inputElement.equals(inputElement)) elementNode = selectedElement;\r
if (inputElement == definition.rootInputElement) {\r
if (inputElement.elementName.length() == 0) {\r
- errors.append("Enter a name for the document element. ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_70);\r
if (elementNode != null) elementNode.elementNameText.setBackground(COLOR_LIGHT_RED);\r
} else {\r
if (elementNode != null) elementNode.elementNameText.setBackground(COLOR_TEXT_BACKGROUND);\r
if (inputElement.inputName.equals(CustomXmlTraceDefinition.TAG_TIMESTAMP)) {\r
timeStampFound = true;\r
if (inputElement.inputFormat.length() == 0) {\r
- errors.append("Enter the input format for the Time Stamp (Element " + getName(inputElement) + "). ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_71 + getName(inputElement) + "). "); //$NON-NLS-1$\r
if (elementNode != null) elementNode.tagText.setBackground(COLOR_LIGHT_RED);\r
} else {\r
try {\r
new SimpleDateFormat(inputElement.inputFormat);\r
if (elementNode != null) elementNode.tagText.setBackground(COLOR_TEXT_BACKGROUND);\r
} catch (IllegalArgumentException e) {\r
- errors.append("Enter a valid input format for the Time Stamp (Element " + getName(inputElement) + "). ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_73 + getName(inputElement) + "). "); //$NON-NLS-1$\r
if (elementNode != null) elementNode.tagText.setBackground(COLOR_LIGHT_RED);\r
}\r
}\r
} else if (inputElement.inputName.length() == 0) {\r
- errors.append("Enter a name for the input . ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_75);\r
if (elementNode != null) elementNode.tagText.setBackground(COLOR_LIGHT_RED);\r
} else {\r
if (elementNode != null) elementNode.tagText.setBackground(COLOR_TEXT_BACKGROUND);\r
}\r
}\r
if (attribute.attributeName.length() == 0) {\r
- errors.append("Enter a name for the attribute (Attribute " + getName(inputElement) + ": ?). ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_76 + getName(inputElement) + ": ?). "); //$NON-NLS-1$\r
if (elementNode != null) elementNode.attributes.get(i).attributeNameText.setBackground(COLOR_LIGHT_RED);\r
} else if (duplicate) {\r
- errors.append("Duplicate attribute names (Attribute " + getName(attribute, inputElement) +"). ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_78 + getName(attribute, inputElement) +"). "); //$NON-NLS-1$\r
if (elementNode != null) elementNode.attributes.get(i).attributeNameText.setBackground(COLOR_LIGHT_RED);\r
}\r
if (attribute.inputName.equals(CustomXmlTraceDefinition.TAG_TIMESTAMP)) {\r
timeStampFound = true;\r
if (attribute.inputFormat.length() == 0) {\r
- errors.append("Enter the input format for the Time Stamp (Attribute " + getName(attribute, inputElement) +"). ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_80 + getName(attribute, inputElement) +"). "); //$NON-NLS-1$\r
if (elementNode != null) elementNode.attributes.get(i).tagText.setBackground(COLOR_LIGHT_RED);\r
} else {\r
try {\r
new SimpleDateFormat(attribute.inputFormat);\r
if (elementNode != null) elementNode.attributes.get(i).tagText.setBackground(COLOR_TEXT_BACKGROUND);\r
} catch (IllegalArgumentException e) {\r
- errors.append("Enter a valid input format for the Time Stamp (Attribute " + getName(attribute, inputElement) +"). ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_82 + getName(attribute, inputElement) +"). "); //$NON-NLS-1$\r
if (elementNode != null) elementNode.attributes.get(i).tagText.setBackground(COLOR_LIGHT_RED);\r
}\r
}\r
} else if (attribute.inputName.length() == 0) {\r
- errors.append("Enter a name for the data group (Attribute " + getName(attribute, inputElement) +"). ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_84 + getName(attribute, inputElement) +"). "); //$NON-NLS-1$\r
if (elementNode != null) elementNode.attributes.get(i).tagText.setBackground(COLOR_LIGHT_RED);\r
} else {\r
if (elementNode != null) elementNode.attributes.get(i).tagText.setBackground(COLOR_TEXT_BACKGROUND);\r
ElementNode childElementNode = null;\r
if (selectedElement != null && selectedElement.inputElement.equals(child)) childElementNode = selectedElement;\r
if (child.elementName.length() == 0) {\r
- errors.append("Enter a name for the element (Element " + getName(child) + "). ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_86 + getName(child) + "). "); //$NON-NLS-1$\r
if (childElementNode != null) childElementNode.elementNameText.setBackground(COLOR_LIGHT_RED);\r
} else {\r
boolean duplicate = false;\r
}\r
}\r
if (duplicate) {\r
- errors.append("Duplicate element names (Element " + getName(child) + "). ");\r
+ errors.append(Messages.CustomXmlParserInputWizardPage_88 + getName(child) + "). "); //$NON-NLS-1$\r
if (childElementNode != null) childElementNode.elementNameText.setBackground(COLOR_LIGHT_RED);\r
}\r
}\r