package org.eclipse.linuxtools.lttng.ui.views.project.dialogs;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.linuxtools.lttng.exceptions.LttngException;
import org.eclipse.linuxtools.lttng.trace.LTTngTraceVersion;
public ImportTraceWizardPage(IWorkbench workbench, IStructuredSelection selection) {
super(workbench, selection);
- LTTngProjectNode folder = (LTTngProjectNode) selection.getFirstElement();
- project = folder.getProject();
- String path = folder.getTracesFolder().getFolder().getFullPath().toOSString();
+ project = (IProject) selection.getFirstElement();
+ IFolder folder = project.getFolder(LTTngProjectNode.TRACE_FOLDER_NAME);
+ if (folder == null) {
+ MessageDialog.openError(getShell(), Messages.ImportTrace_ErrorTitle, Messages.ImportTrace_InvalidProject);
+ }
+ String path = folder.getFullPath().toOSString();
initialContainerString = path;
setContainerFieldValue(path);
public static String AddTraceWizardPage_columnHeader;
public static String AddTraceWizardPage_description;
public static String AddTraceWizardPage_windowTitle;
+ public static String ImportTrace_ErrorTitle;
+ public static String ImportTrace_InvalidProject;
public static String ImportTraceWizardPage_BadTraceVersion;
public static String ImportTraceWizardPage_BadTraceVersionMsg1;
public static String ImportTraceWizardPage_BadTraceVersionMsg2;
public static String TraceLibraryPathWizardPage_TraceLoaderLibrary_notExists;
public static String TraceLibraryPathWizardPage_Title;
public static String TraceLibraryPathWizardPage_Description;
+ public static String TraceLibraryPathWizard_Message;
+ public static String TraceLibraryPathProperty_Message;
public static String SelectTrace_ErrorTitle;
public static String TraceLibraryPath_Note;
public static String TraceLibraryPath_Message;
}
});
+
+ Label noLabel = new Label(client, SWT.NONE);
+ noLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
+
+ Label descTextLabel = new Label(client, SWT.WRAP);
+ descTextLabel.setText(Messages.TraceLibraryPathProperty_Message);
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd.widthHint = 400;
+ gd.horizontalSpan = 2;
+ descTextLabel.setLayoutData(gd);
+
Label noteBoldLabel = new Label(client, SWT.BOLD);
noteBoldLabel.setText(Messages.TraceLibraryPath_Note);
noteBoldLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false,
Label noteTextLabel = new Label(client, SWT.WRAP);
noteTextLabel.setText(Messages.TraceLibraryPath_Message);
- GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
gd.widthHint = 400;
gd.horizontalSpan = 2;
noteTextLabel.setLayoutData(gd);
Label label = new Label(client, SWT.NONE);
label.setText(Messages.TraceLibraryPath_label);
traceLibraryPath = new Text(client, SWT.BORDER);
- traceLibraryPath.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
- false));
+ traceLibraryPath.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
traceLibraryPath.addModifyListener(new ModifyListener() {
@Override
});
browsePathButton = new Button(client, SWT.PUSH);
- browsePathButton.setLayoutData(new GridData(SWT.END, SWT.CENTER, false,
- false));
+ browsePathButton.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
browsePathButton.setText(Messages.TraceLibraryPath_browseBtn);
browsePathButton.addSelectionListener(new SelectionAdapter() {
});
+ Label noLabel = new Label(client, SWT.NONE);
+ noLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
+
+ Label descTextLabel = new Label(client, SWT.WRAP);
+ descTextLabel.setText(Messages.TraceLibraryPathWizard_Message);
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd.widthHint = 400;
+ gd.horizontalSpan = 2;
+ descTextLabel.setLayoutData(gd);
+
Label noteBoldLabel = new Label(client, SWT.BOLD);
noteBoldLabel.setText(Messages.TraceLibraryPath_Note);
- noteBoldLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false,
- false));
+ noteBoldLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
Font font = noteBoldLabel.getFont();
if (font.getFontData().length > 0)
noteBoldLabel.setFont(new Font(client.getDisplay(), font
Label noteTextLabel = new Label(client, SWT.WRAP);
noteTextLabel.setText(Messages.TraceLibraryPath_Message);
- GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
gd.widthHint = 400;
gd.horizontalSpan = 2;
noteTextLabel.setLayoutData(gd);
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.
+
+ImportTrace_ErrorTitle=Import Trace
+ImportTrace_InvalidProject=Invalid project type
+
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
TraceErrorDialog_DialogMsgLabel=Error while opening the trace\! Error message:
+
TraceLibraryPath_label = Trace Library Path:
TraceLibraryPath_browseBtn = Browse...
+
TraceLibraryPathWizardPage_SpecifiedTraceLibraryLocation_notExists = Specified trace library directory does not exist!
TraceLibraryPathWizardPage_TraceLoaderLibrary_notExists = Trace loader library not found at the specified path!
TraceLibraryPathWizardPage_Title = LTTng Parsing Library
TraceLibraryPathWizardPage_Description = Specify the directory which contains the LTTng parsing libraries
+TraceLibraryPathWizard_Message = Set this field if you want to dynamically change the parsing libraries your LTTng projects use or if you do not want to set LD_LIBRARY_PATH.\n\n\
+ The field is project specific and can be modified at any time from the LTTng project Properties page.\n\
+
+TraceLibraryPathProperty_Message = Set this field if you want to dynamically change the parsing libraries your LTTng projects use or if you do not want to set LD_LIBRARY_PATH.\n\
+
TraceLibraryPath_Note = Note:
-#TraceLibraryPath_Message = The path specified needs to contain the required parser library 'liblttvtraceread_loader.so' or a link to it.\nParser library 'liblttvtraceread_loader.so' also needs to have 'RUNPATH' set with ${ORIGIN} so it can find the dependent libraries. 'RUNPATH' can be set by using patchelf utility or in the makefile.
-TraceLibraryPath_Message = The parser library 'liblttvtraceread_loader.so' needs to be accessible from the path provided.\n\n\
-You only need to set this field if you don't want to set your LD_LIBRARY_PATH or if you want to have the liberty to dynamically change the parsing libraries used by your LTTng projects.\n\n\
-This field is project specific and can be modified at any time from the LTTng project's properties.\n\n\
-Also note that if you are setting this field, the library 'liblttvtraceread_loader.so' needs to have 'RUNPATH' set with ${ORIGIN} so it can find the dependent libraries. 'RUNPATH' can be set by using patchelf utility or in the makefile.\n\n\
-Refer to the LTTng User Guide for more information.
+TraceLibraryPath_Message = If you set this field, the parser library 'liblttvtraceread_loader.so' must be accessible from the path provided.\n\n\
+ In addition, the library 'liblttvtraceread_loader.so' must have 'RUNPATH' set with ${ORIGIN} so it can find the dependent libraries. \
+ 'RUNPATH' can be set in the makefile or by using the patchelf utility.
+
SelectTrace_ErrorTitle = Select Trace
/*******************************************************************************
- * Copyright (c) 2009, 2010 Ericsson
+ * Copyright (c) 2009, 2010, 2011 Ericsson, MontaVista Software
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Francois Chouinard - Initial API and implementation
+ * Yufen Kuo (ykuo@mvista.com) - bug 354541: implement IAdaptable Project->Properties action is enabled when project is selected.
*******************************************************************************/
package org.eclipse.linuxtools.lttng.ui.views.project.model;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.linuxtools.lttng.ui.views.project.LTTngProjectNature;
/**
* <p>
* TODO: Implement me. Please.
*/
-public class LTTngProjectNode extends LTTngProjectTreeNode {
+public class LTTngProjectNode extends LTTngProjectTreeNode implements IAdaptable {
public static final String TRACE_FOLDER_NAME = "Traces"; //$NON-NLS-1$
public static final String EXPER_FOLDER_NAME = "Experiments"; //$NON-NLS-1$
return fExperimentsFolder;
}
+ /**
+ * Returns the adapter
+ */
+ @SuppressWarnings("rawtypes")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IResource.class) {
+ return getProject();
+ }
+ // Defer to the platform
+ return Platform.getAdapterManager().getAdapter(this, adapter);
+ }
+
}