diff options
author | Francois Chouinard | 2011-07-28 19:42:04 +0000 |
---|---|---|
committer | Francois Chouinard | 2011-07-28 19:43:34 +0000 |
commit | 40701c02f19b1b155a9fc3d7111a413007e8af7d (patch) | |
tree | ce9bb2dad181e58cf1d8cbf43ec58b23a0b6a8fe /lttng/org.eclipse.linuxtools.lttng.ui/src | |
parent | 8de4acfaaec89e71b1e92806533718473b2ad87f (diff) | |
download | org.eclipse.linuxtools-40701c02f19b1b155a9fc3d7111a413007e8af7d.tar.gz org.eclipse.linuxtools-40701c02f19b1b155a9fc3d7111a413007e8af7d.tar.xz org.eclipse.linuxtools-40701c02f19b1b155a9fc3d7111a413007e8af7d.zip |
Add missing dialog strings
Diffstat (limited to 'lttng/org.eclipse.linuxtools.lttng.ui/src')
4 files changed, 184 insertions, 196 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/IDEWorkbenchMessages.java b/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/IDEWorkbenchMessages.java deleted file mode 100644 index de49374e1f..0000000000 --- a/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/IDEWorkbenchMessages.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.eclipse.linuxtools.lttng.ui.views.project.dialogs; - -import org.eclipse.osgi.util.NLS; - -public class IDEWorkbenchMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng.ui.views.project.dialogs.messages"; //$NON-NLS-1$ - public static String NewExperimentDialog_DialogTitle; - public static String NewExperimentDialog_ExperimentLabel; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, IDEWorkbenchMessages.class); - } - - private IDEWorkbenchMessages() { - } -} diff --git a/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/Messages.java b/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/Messages.java index aa0dd62c27..090738f507 100644 --- a/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/Messages.java +++ b/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/Messages.java @@ -3,24 +3,26 @@ package org.eclipse.linuxtools.lttng.ui.views.project.dialogs; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng.ui.views.project.dialogs.messages"; //$NON-NLS-1$ - public static String AddTraceWizard_invalidTraceLocation; - public static String AddTraceWizard_windowTitle; - public static String AddTraceWizardPage_columnHeader; - public static String AddTraceWizardPage_description; - public static String AddTraceWizardPage_windowTitle; - public static String ImportTraceWizardPage_BadTraceVersion; - public static String ImportTraceWizardPage_BadTraceVersionMsg1; - public static String ImportTraceWizardPage_BadTraceVersionMsg2; - public static String NewProjectWizard_Description; - public static String NewProjectWizard_Title; - public static String TraceErrorDialog_DalogTitle; - public static String TraceErrorDialog_DialogMsgLabel; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } + private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng.ui.views.project.dialogs.messages"; //$NON-NLS-1$ + public static String AddTraceWizard_invalidTraceLocation; + public static String AddTraceWizard_windowTitle; + public static String AddTraceWizardPage_columnHeader; + public static String AddTraceWizardPage_description; + public static String AddTraceWizardPage_windowTitle; + public static String ImportTraceWizardPage_BadTraceVersion; + public static String ImportTraceWizardPage_BadTraceVersionMsg1; + public static String ImportTraceWizardPage_BadTraceVersionMsg2; + public static String NewExperimentDialog_DialogTitle; + public static String NewExperimentDialog_ExperimentLabel; + public static String NewProjectWizard_Description; + public static String NewProjectWizard_Title; + public static String TraceErrorDialog_DalogTitle; + public static String TraceErrorDialog_DialogMsgLabel; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } - private Messages() { - } + private Messages() { + } } diff --git a/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/NewExperimentDialog.java b/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/NewExperimentDialog.java index c5a4f999f9..aef21e26ce 100644 --- a/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/NewExperimentDialog.java +++ b/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/NewExperimentDialog.java @@ -59,23 +59,21 @@ import org.eclipse.ui.internal.ide.dialogs.CreateLinkedResourceGroup; public class NewExperimentDialog extends SelectionStatusDialog { private Text folderNameField; - private IContainer container; + private final IContainer container; private boolean firstLinkCheck = true; private CreateLinkedResourceGroup linkedResourceGroup; /** * Creates a NewFolderDialog * - * @param parentShell - * parent of the new dialog - * @param container - * parent of the new folder + * @param parentShell parent of the new dialog + * @param container parent of the new folder */ public NewExperimentDialog(Shell parentShell, LTTngExperimentFolderNode experimentFolder) { - super(parentShell); - this.container = experimentFolder.getFolder(); - setTitle(org.eclipse.linuxtools.lttng.ui.views.project.dialogs.IDEWorkbenchMessages.NewExperimentDialog_DialogTitle); - setStatusLineAboveButtons(true); + super(parentShell); + this.container = experimentFolder.getFolder(); + setTitle(Messages.NewExperimentDialog_DialogTitle); + setStatusLineAboveButtons(true); } /** @@ -91,40 +89,39 @@ public class NewExperimentDialog extends SelectionStatusDialog { */ @Override public void create() { - super.create(); - getButton(IDialogConstants.OK_ID).setEnabled(false); + super.create(); + getButton(IDialogConstants.OK_ID).setEnabled(false); } /** * Creates the widget for advanced options. * - * @param parent - * the parent composite + * @param parent the parent composite */ protected void createLinkResourceGroup(Composite parent) { - linkedResourceGroup = new CreateLinkedResourceGroup(IResource.FOLDER, new Listener() { - @Override - public void handleEvent(Event e) { - validateLinkedResource(); - firstLinkCheck = false; - } - }, new CreateLinkedResourceGroup.IStringValue() { - @Override - public void setValue(String string) { - folderNameField.setText(string); - } + linkedResourceGroup = new CreateLinkedResourceGroup(IResource.FOLDER, new Listener() { + @Override + public void handleEvent(Event e) { + validateLinkedResource(); + firstLinkCheck = false; + } + }, new CreateLinkedResourceGroup.IStringValue() { + @Override + public void setValue(String string) { + folderNameField.setText(string); + } - @Override - public String getValue() { - return folderNameField.getText(); - } + @Override + public String getValue() { + return folderNameField.getText(); + } - @Override - public IResource getResource() { - // TODO Auto-generated method stub - return null; - } - }); + @Override + public IResource getResource() { + // TODO Auto-generated method stub + return null; + } + }); } /* @@ -132,46 +129,45 @@ public class NewExperimentDialog extends SelectionStatusDialog { */ @Override protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - composite.setLayout(new GridLayout()); - composite.setLayoutData(new GridData(GridData.FILL_BOTH)); + Composite composite = (Composite) super.createDialogArea(parent); + composite.setLayout(new GridLayout()); + composite.setLayoutData(new GridData(GridData.FILL_BOTH)); - createFolderNameGroup(composite); - createLinkResourceGroup(composite); - return composite; + createFolderNameGroup(composite); + createLinkResourceGroup(composite); + return composite; } /** * Creates the folder name specification controls. * - * @param parent - * the parent composite + * @param parent the parent composite */ private void createFolderNameGroup(Composite parent) { - Font font = parent.getFont(); - Composite folderGroup = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - folderGroup.setLayout(layout); - folderGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + Font font = parent.getFont(); + Composite folderGroup = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + folderGroup.setLayout(layout); + folderGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - // new folder label - Label folderLabel = new Label(folderGroup, SWT.NONE); - folderLabel.setFont(font); - folderLabel.setText(org.eclipse.linuxtools.lttng.ui.views.project.dialogs.IDEWorkbenchMessages.NewExperimentDialog_ExperimentLabel); + // new folder label + Label folderLabel = new Label(folderGroup, SWT.NONE); + folderLabel.setFont(font); + folderLabel.setText(Messages.NewExperimentDialog_ExperimentLabel); - // new folder name entry field - folderNameField = new Text(folderGroup, SWT.BORDER); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; - folderNameField.setLayoutData(data); - folderNameField.setFont(font); - folderNameField.addListener(SWT.Modify, new Listener() { - @Override - public void handleEvent(Event event) { - validateLinkedResource(); - } - }); + // new folder name entry field + folderNameField = new Text(folderGroup, SWT.BORDER); + GridData data = new GridData(GridData.FILL_HORIZONTAL); + data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; + folderNameField.setLayoutData(data); + folderNameField.setFont(font); + folderNameField.addListener(SWT.Modify, new Listener() { + @Override + public void handleEvent(Event event) { + validateLinkedResource(); + } + }); } /** @@ -179,70 +175,67 @@ public class NewExperimentDialog extends SelectionStatusDialog { * folder handle is created relative to the container specified during * object creation. * - * @param folderName - * the name of the folder resource to create a handle for + * @param folderName the name of the folder resource to create a handle for * @return the new folder resource handle */ private IFolder createFolderHandle(String folderName) { - IWorkspaceRoot workspaceRoot = container.getWorkspace().getRoot(); - IPath folderPath = container.getFullPath().append(folderName); - IFolder folderHandle = workspaceRoot.getFolder(folderPath); + IWorkspaceRoot workspaceRoot = container.getWorkspace().getRoot(); + IPath folderPath = container.getFullPath().append(folderName); + IFolder folderHandle = workspaceRoot.getFolder(folderPath); - return folderHandle; + return folderHandle; } /** * Creates a new folder with the given name and optionally linking to the * specified link target. * - * @param folderName - * name of the new folder - * @param linkTarget - * name of the link target folder. may be null. + * @param folderName name of the new folder + * @param linkTarget name of the link target folder. may be null. * @return IFolder the new folder */ private IFolder createNewFolder(String folderName, final URI linkTarget) { - final IFolder folderHandle = createFolderHandle(folderName); + final IFolder folderHandle = createFolderHandle(folderName); - WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { - @Override - public void execute(IProgressMonitor monitor) throws CoreException { - try { - monitor.beginTask(IDEWorkbenchMessages.NewFolderDialog_progress, 2000); - if (monitor.isCanceled()) { - throw new OperationCanceledException(); - } - if (linkTarget == null) { - folderHandle.create(false, true, monitor); - } else { - folderHandle.createLink(linkTarget, IResource.ALLOW_MISSING_LOCAL, monitor); - } - if (monitor.isCanceled()) { - throw new OperationCanceledException(); - } - } finally { - monitor.done(); - } - } - }; - try { - PlatformUI.getWorkbench().getProgressService().busyCursorWhile(operation); - } catch (InterruptedException exception) { - return null; - } catch (InvocationTargetException exception) { - if (exception.getTargetException() instanceof CoreException) { - ErrorDialog.openError(getShell(), IDEWorkbenchMessages.NewFolderDialog_errorTitle, null, - ((CoreException) exception.getTargetException()).getStatus()); - } else { - // CoreExceptions are handled above, but unexpected runtime - // exceptions and errors may still occur. - IDEWorkbenchPlugin.log(getClass(), "createNewExperiment", exception.getTargetException()); //$NON-NLS-1$ - MessageDialog.openError(getShell(), IDEWorkbenchMessages.NewFolderDialog_errorTitle, - NLS.bind(IDEWorkbenchMessages.NewFolderDialog_internalError, exception.getTargetException().getMessage())); - } - return null; - } - return folderHandle; + WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { + @Override + public void execute(IProgressMonitor monitor) throws CoreException { + try { + monitor.beginTask(IDEWorkbenchMessages.NewFolderDialog_progress, 2000); + if (monitor.isCanceled()) { + throw new OperationCanceledException(); + } + if (linkTarget == null) { + folderHandle.create(false, true, monitor); + } else { + folderHandle.createLink(linkTarget, IResource.ALLOW_MISSING_LOCAL, monitor); + } + if (monitor.isCanceled()) { + throw new OperationCanceledException(); + } + } finally { + monitor.done(); + } + } + }; + try { + PlatformUI.getWorkbench().getProgressService().busyCursorWhile(operation); + } catch (InterruptedException exception) { + return null; + } catch (InvocationTargetException exception) { + if (exception.getTargetException() instanceof CoreException) { + ErrorDialog.openError(getShell(), IDEWorkbenchMessages.NewFolderDialog_errorTitle, null, + ((CoreException) exception.getTargetException()).getStatus()); + } else { + // CoreExceptions are handled above, but unexpected runtime + // exceptions and errors may still occur. + IDEWorkbenchPlugin.log(getClass(), "createNewExperiment", exception.getTargetException()); //$NON-NLS-1$ + MessageDialog.openError(getShell(), IDEWorkbenchMessages.NewFolderDialog_errorTitle, + NLS.bind(IDEWorkbenchMessages.NewFolderDialog_internalError, exception.getTargetException().getMessage())); + } + return null; + } + return folderHandle; } /** @@ -251,12 +244,12 @@ public class NewExperimentDialog extends SelectionStatusDialog { */ @Override protected void updateStatus(IStatus status) { - if (firstLinkCheck && status != null) { - Status newStatus = new Status(IStatus.OK, status.getPlugin(), status.getCode(), status.getMessage(), status.getException()); - super.updateStatus(newStatus); - } else { - super.updateStatus(status); - } + if (firstLinkCheck && status != null) { + Status newStatus = new Status(IStatus.OK, status.getPlugin(), status.getCode(), status.getMessage(), status.getException()); + super.updateStatus(newStatus); + } else { + super.updateStatus(status); + } } /** @@ -267,7 +260,7 @@ public class NewExperimentDialog extends SelectionStatusDialog { * @param message */ private void updateStatus(int severity, String message) { - updateStatus(new Status(severity, IDEWorkbenchPlugin.IDE_WORKBENCH, severity, message, null)); + updateStatus(new Status(severity, IDEWorkbenchPlugin.IDE_WORKBENCH, severity, message, null)); } /** @@ -276,24 +269,24 @@ public class NewExperimentDialog extends SelectionStatusDialog { * indicates the problem otherwise. */ private void validateLinkedResource() { - boolean valid = validateFolderName(); + boolean valid = validateFolderName(); - if (valid) { - IFolder linkHandle = createFolderHandle(folderNameField.getText()); - IStatus status = linkedResourceGroup.validateLinkLocation(linkHandle); + if (valid) { + IFolder linkHandle = createFolderHandle(folderNameField.getText()); + IStatus status = linkedResourceGroup.validateLinkLocation(linkHandle); - if (status.getSeverity() != IStatus.ERROR) { - getOkButton().setEnabled(true); - } else { - getOkButton().setEnabled(false); - } + if (status.getSeverity() != IStatus.ERROR) { + getOkButton().setEnabled(true); + } else { + getOkButton().setEnabled(false); + } - if (status.isOK() == false) { - updateStatus(status); - } - } else { - getOkButton().setEnabled(false); - } + if (status.isOK() == false) { + updateStatus(status); + } + } else { + getOkButton().setEnabled(false); + } } /** @@ -303,25 +296,25 @@ public class NewExperimentDialog extends SelectionStatusDialog { * the problem otherwise. */ private boolean validateFolderName() { - String name = folderNameField.getText(); - IWorkspace workspace = container.getWorkspace(); - IStatus nameStatus = workspace.validateName(name, IResource.FOLDER); + String name = folderNameField.getText(); + IWorkspace workspace = container.getWorkspace(); + IStatus nameStatus = workspace.validateName(name, IResource.FOLDER); - if ("".equals(name)) { //$NON-NLS-1$ - updateStatus(IStatus.ERROR, "Experiment name is empty"); //$NON-NLS-1$ - return false; - } - if (nameStatus.isOK() == false) { - updateStatus(nameStatus); - return false; - } - IPath path = new Path(name); - if (container.getFolder(path).exists() || container.getFile(path).exists()) { - updateStatus(IStatus.ERROR, NLS.bind("Experiment already exists", name)); //$NON-NLS-1$ - return false; - } - updateStatus(IStatus.OK, ""); //$NON-NLS-1$ - return true; + if ("".equals(name)) { //$NON-NLS-1$ + updateStatus(IStatus.ERROR, "Experiment name is empty"); //$NON-NLS-1$ + return false; + } + if (nameStatus.isOK() == false) { + updateStatus(nameStatus); + return false; + } + IPath path = new Path(name); + if (container.getFolder(path).exists() || container.getFile(path).exists()) { + updateStatus(IStatus.ERROR, NLS.bind("Experiment already exists", name)); //$NON-NLS-1$ + return false; + } + updateStatus(IStatus.OK, ""); //$NON-NLS-1$ + return true; } /* @@ -331,14 +324,14 @@ public class NewExperimentDialog extends SelectionStatusDialog { */ @Override protected void okPressed() { - URI linkTarget = linkedResourceGroup.getLinkTargetURI(); - IFolder folder = createNewFolder(folderNameField.getText(), linkTarget); - if (folder == null) { - return; - } + URI linkTarget = linkedResourceGroup.getLinkTargetURI(); + IFolder folder = createNewFolder(folderNameField.getText(), linkTarget); + if (folder == null) { + return; + } - setSelectionResult(new IFolder[] { folder }); + setSelectionResult(new IFolder[] { folder }); - super.okPressed(); + super.okPressed(); } }
\ No newline at end of file diff --git a/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/messages.properties b/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/messages.properties index 0511b2d7b3..717b96b99f 100644 --- a/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/messages.properties +++ b/lttng/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/project/dialogs/messages.properties @@ -3,9 +3,18 @@ AddTraceWizard_windowTitle=Adding traces to experiment AddTraceWizardPage_columnHeader=Trace AddTraceWizardPage_description=Select the traces to add to the experiment AddTraceWizardPage_windowTitle=Select traces +ImportTraceWizard_LocationError=Error: Trace location is wrong. +ImportTraceWizard_LocationErrorMsg1=You cannot import your trace directly into " +ImportTraceWizard_LocationErrorMsg2=The trace has to be into a directory, like " +ImportTraceWizard_LocationErrorMsg3=Please adjust the location of the LTTng trace. ImportTraceWizardPage_BadTraceVersion=Error: Unrecognized trace version for ImportTraceWizardPage_BadTraceVersionMsg1=Verify that the directory is a valid LTTng trace directory. ImportTraceWizardPage_BadTraceVersionMsg2=Make sure the top directory is the trace itself and not any of its parent. +NewExperimentDialog_DialogTitle=LTTng Experiment +NewExperimentDialog_ExperimentLabel=Experiment name: +NewFolderDialog_errorTitle= +NewFolderDialog_internalError= +NewFolderDialog_progress= NewProjectWizard_Description=Create an LTTng Project NewProjectWizard_Title=LTTng Project TraceErrorDialog_DalogTitle=Trace Selection |