本文整理匯總了Java中org.eclipse.core.runtime.QualifiedName類的典型用法代碼示例。如果您正苦於以下問題:Java QualifiedName類的具體用法?Java QualifiedName怎麽用?Java QualifiedName使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
QualifiedName類屬於org.eclipse.core.runtime包,在下文中一共展示了QualifiedName類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configure
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
/**
* Configures a {@link Job} instance using the configuration data held in
* this {@link JobOptions}.
*
* @param job
* a {@link Job} to configure (must not be <code>null</code>)
*/
public void configure(final Job job) {
Check.notNull(job, "job"); //$NON-NLS-1$
job.setPriority(priority);
job.setSystem(system);
job.setUser(user);
job.setRule(schedulingRule);
for (final Iterator it = properties.keySet().iterator(); it.hasNext();) {
final QualifiedName key = (QualifiedName) it.next();
final Object value = properties.get(key);
job.setProperty(key, value);
}
}
示例2: restoreOldSettings
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
private void restoreOldSettings() {
if (isPropertyPage()) {
QualifiedName oldKey = new QualifiedName(preferencesId(), useProjectSettingsPreferenceName());
try {
String oldValue = project.getPersistentProperty(oldKey);
if (oldValue != null) {
// remove old entry
project.setPersistentProperty(oldKey, null);
// if were true - save copy into project settings
if (Boolean.valueOf(oldValue)) {
saveUseProjectSettings(true);
}
}
} catch (Exception e) {
}
}
}
示例3: getString
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
public String getString(String name)
{
String value = null;
try
{
value = resource.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, name));
if (value == null)
{
value = "";
}
} catch (CoreException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
return value;
}
示例4: addSecondSection
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
private void addSecondSection(Composite parent) {
Composite composite = createDefaultComposite(parent);
// Label for owner field
Label ownerLabel = new Label(composite, SWT.NONE);
ownerLabel.setText(OWNER_TITLE);
// Owner text field
ownerText = new Text(composite, SWT.SINGLE | SWT.BORDER);
GridData gd = new GridData();
gd.widthHint = convertWidthInCharsToPixels(TEXT_FIELD_WIDTH);
ownerText.setLayoutData(gd);
// Populate owner text field
try {
String owner =
((IResource) getElement()).getPersistentProperty(
new QualifiedName("", OWNER_PROPERTY));
ownerText.setText((owner != null) ? owner : DEFAULT_OWNER);
} catch (CoreException e) {
ownerText.setText(DEFAULT_OWNER);
}
}
示例5: performOk
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
@Override
public boolean performOk() {
boolean retVal = super.performOk();
if (retVal && isPropertyPage()) {
try {
currentProject().setPersistentProperty(new QualifiedName(qualifiedName(), USE_PROJECT_SETTINGS),
String.valueOf(useProjectSettingsButton.getSelection()));
((IPersistentPreferenceStore) getPreferenceStore()).save();
}
catch (Exception e) {
log.error("Error", e); //$NON-NLS-1$
retVal = false;
}
}
return retVal;
}
示例6: createEDK2ProjectFromExistingModule
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
public static void createEDK2ProjectFromExistingModule(Edk2Module module, IProgressMonitor monitor) throws CoreException {
IProject newProjectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(module.getName());
IProjectDescription projDesc;
newProjectHandle.create(monitor);
newProjectHandle.open(monitor);
projDesc = ResourcesPlugin.getWorkspace().newProjectDescription(newProjectHandle.getName());
IPath newProjectPath = newProjectHandle.getLocation();
projDesc.setLocation(newProjectPath);
newProjectHandle.setPersistentProperty(new QualifiedName("Uefi_EDK2_Wizards", "EDK2_WORKSPACE"), module.getWorkspacePath());
newProjectHandle.setPersistentProperty(new QualifiedName("Uefi_EDK2_Wizards", "MODULE_ROOT_PATH"), new Path(module.getElementPath()).removeLastSegments(1).toString());
monitor.beginTask("Adding C nature to project", 25);
CCorePlugin.getDefault().createCDTProject(projDesc, newProjectHandle, null);
ExistingEdk2ModuleProjectCreator.ConfigureProjectNature(newProjectHandle);
monitor.beginTask("Creating project structure", 45);
ProjectStructureUpdater.UpdateProjectStructureFromModule(newProjectHandle, module);
monitor.beginTask("Parsing include paths", 65);
ProjectStructureUpdater.updateIncludePaths(newProjectHandle, module);
monitor.beginTask("Saving EDK2 project properties", 95);
ProjectStructureUpdater.setResourceChangeListeners(newProjectHandle);
}
示例7: setSyncTimestamp
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
public static void setSyncTimestamp(IResource paramIResource) {
if ((paramIResource == null) || (!paramIResource.exists())) {
return;
}
try {
if (paramIResource.getType() == 1) {
paramIResource.refreshLocal(1, new NullProgressMonitor());
}
if (paramIResource.exists()) {
long l = paramIResource.getLocalTimeStamp();
QualifiedName localQualifiedName = getSyncModifiedQualifiedName(paramIResource);
paramIResource.getProject().setPersistentProperty(localQualifiedName, String.valueOf(l));
}
} catch (CoreException localCoreException) {
localCoreException.printStackTrace();
}
}
示例8: performOk
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
/**
* We override the performOk method. In case of property pages we copy the values in the
* overlay store into the property values of the selected project.
* We also save the state of the radio buttons.
*
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
public boolean performOk() {
boolean result = super.performOk();
if (result && isPropertyPage()) {
// Save state of radiobuttons in project properties
IResource resource = (IResource) getElement();
try {
String value =
(useProjectSettingsButton.getSelection()) ? TRUE : FALSE;
resource.setPersistentProperty(
new QualifiedName(pageId, USEPROJECTSETTINGS),
value);
} catch (CoreException e) {
}
}
return result;
}
示例9: performOk
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
/**
* We override the performOk method. In case of property pages
* we save the state of the radio buttons.
*
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
public boolean performOk() {
boolean result = super.performOk();
if (result && isPropertyPage()) {
// Save state of radiobuttons in project properties
IResource resource = (IResource) getElement();
try {
String value =
(useProjectSettingsButton.getSelection()) ? TRUE : FALSE;
resource.setPersistentProperty(
new QualifiedName(pageId, USEPROJECTSETTINGS),
value);
} catch (CoreException e) {
}
}
return result;
}
示例10: savePreferences
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
public static void savePreferences(IFile ifile, List<MResource> files) throws CoreException {
Map<QualifiedName, String> pmap = ifile.getPersistentProperties();
for (QualifiedName key : pmap.keySet()) {
if (key.equals(JrxmlExporter.KEY_REPORT_ISMAIN))
continue;
ifile.setPersistentProperty(key, null);
}
for (MResource f : files) {
PublishOptions popt = f.getPublishOptions();
String prefix = f.getValue().getName();
ifile.setPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".overwrite"), Boolean.toString(popt.isOverwrite()));
ifile.setPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".reference"), popt.getPublishMethod().toString());
if (popt.getReferencedResource() != null)
ifile.setPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".refPATH"), popt.getReferencedResource().getUriString());
else
ifile.setPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".refPATH"), null);
}
}
示例11: loadPreferences
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
public static void loadPreferences(IProgressMonitor monitor, IFile ifile, MResource f) {
PublishOptions popt = f.getPublishOptions();
String prefix = f.getValue().getName();
try {
String ovw = ifile.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".overwrite"));
if (ovw != null)
popt.setOverwrite(Boolean.parseBoolean(ovw));
String ref = ifile.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".reference"));
if (ref != null) {
popt.setPublishMethod(ResourcePublishMethod.valueOf(ref));
String path = ifile.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, prefix + ".refPATH"));
if (path != null) {
ResourceDescriptor rd = new ResourceDescriptor();
rd.setParentFolder(RDUtil.getParentFolder(path));
rd.setUriString(path);
rd.setWsType(f.getValue().getWsType());
popt.setReferencedResource(WSClientHelper.getResource(monitor, f, rd, FileUtils.createTempFile("tmp", "")));
} else
popt.setPublishMethod(ResourcePublishMethod.LOCAL);
}
} catch (Exception e) {
popt.setPublishMethod(ResourcePublishMethod.LOCAL);
e.printStackTrace();
}
}
示例12: loadPreferences
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
public static Properties loadPreferences(IFile f) throws CoreException {
int PLENGHT = PREFIX.length();
Properties props = new Properties();
String p = "";
Map<QualifiedName, String> map = f.getPersistentProperties();
for (QualifiedName qn : map.keySet()) {
String key = qn.getLocalName();
String value = map.get(qn);
if (key.startsWith(PREFIX))
p += key.substring(PLENGHT) + "=" + value + "\n";
else
props.put(key, value);
}
if (!p.isEmpty())
props.put(NET_SF_JASPERREPORTS_JRPROPERTIES, p);
return props;
}
示例13: addFirstSection
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
private void addFirstSection(Composite parent) {
Composite composite = createDefaultComposite(parent);
//Label for path field
Label pathLabel = new Label(composite, SWT.NONE);
pathLabel.setText(PATH_TITLE);
// Path text field
pathValueText = new FileChooser(composite, true);
GridData gd = new GridData();
gd.widthHint = convertWidthInCharsToPixels(TEXT_FIELD_WIDTH);
pathValueText.setLayoutData(gd);
try {
pathValueText.setText(((IResource) getElement()).getPersistentProperty(new QualifiedName("", "OF_ROOT")).toString());
} catch (Exception e) {
pathValueText.setText(Activator.getDefault().getPreferenceStore().getString("OF_ROOT"));
}
}
示例14: writeProp
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
private static void writeProp(final IResource resource, final String key, final Option<String> optValue) throws CoreException {
final IFile propFile = propFile(resource, key);
final QualifiedName qnKey = new QualifiedName(QUALIFIER, key);
if (optValue.isSome()) {
final String value = optValue.some();
final InputStream in = IOUtils.toInputStream(value);
if (!propFile.exists()) {
mkdirs(propFile);
propFile.create(in, true, null);
} else
propFile.setContents(in, true, true, null);
resource.setPersistentProperty(qnKey, value);
} else if (propFile.exists()) {
propFile.delete(true, null);
resource.setPersistentProperty(qnKey, null);
}
resource.touch(null);
}
示例15: createKarafPlatformResources
import org.eclipse.core.runtime.QualifiedName; //導入依賴的package包/類
private void createKarafPlatformResources(final IProgressMonitor monitor) throws CoreException {
newKarafProject.getProjectHandle().getFolder(".bin").create(true, true, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform").create(true, true, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/etc").createLink(workingPlatformModel.getParentKarafModel().getConfigurationDirectory(), 0, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/deploy").createLink(workingPlatformModel.getParentKarafModel().getUserDeployedDirectory(), 0, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/lib").createLink(workingPlatformModel.getParentKarafModel().getRootDirectory().append("lib"), 0, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/system").createLink(workingPlatformModel.getParentKarafModel().getPluginRootDirectory(), 0, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/runtime").create(true, true, monitor);
// TODO: Is this the right way to add the current installation?
final IDynamicVariable eclipseHomeVariable = VariablesPlugin.getDefault().getStringVariableManager().getDynamicVariable("eclipse_home");
final String eclipseHome = eclipseHomeVariable.getValue("");
newKarafProject.getProjectHandle().getFolder(".bin/platform/eclipse").create(true, true, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/eclipse/dropins").createLink(new Path(eclipseHome).append("dropins"), 0, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/eclipse/plugins").createLink(new Path(eclipseHome).append("plugins"), 0, monitor);
newKarafProject.getProjectHandle().setPersistentProperty(
new QualifiedName(KarafUIPluginActivator.PLUGIN_ID, "karafProject"),
"true");
newKarafProject.getProjectHandle().setPersistentProperty(
new QualifiedName(KarafUIPluginActivator.PLUGIN_ID, "karafModel"),
karafPlatformModel.getRootDirectory().toString());
}