本文整理汇总了Java中org.eclipse.jdt.core.ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY属性的典型用法代码示例。如果您正苦于以下问题:Java ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY属性的具体用法?Java ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY怎么用?Java ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.ClasspathContainerInitializer
的用法示例。
在下文中一共展示了ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleContainerEntry
private IClasspathEntry handleContainerEntry(IPath containerPath, IJavaProject jproject, IPath jarPath) throws JavaModelException {
ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, jproject);
if (initializer == null || container == null) {
setDescription(Messages.format(PreferencesMessages.JavadocConfigurationPropertyPage_invalid_container, BasicElementLabels.getPathLabel(containerPath, false)));
return null;
}
String containerName= container.getDescription();
IStatus status= initializer.getAttributeStatus(containerPath, jproject, IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME);
if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_NOT_SUPPORTED) {
setDescription(Messages.format(PreferencesMessages.JavadocConfigurationPropertyPage_not_supported, containerName));
return null;
}
IClasspathEntry entry= JavaModelUtil.findEntryInContainer(container, jarPath);
if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY) {
setDescription(Messages.format(PreferencesMessages.JavadocConfigurationPropertyPage_read_only, containerName));
fIsReadOnly= true;
return entry;
}
Assert.isNotNull(entry);
setDescription(PreferencesMessages.JavadocConfigurationPropertyPage_IsPackageFragmentRoot_description);
return entry;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:JavadocConfigurationPropertyPage.java
示例2: handleContainerEntry
private IClasspathEntry handleContainerEntry(IPath containerPath, IJavaProject jproject, IPath jarPath) throws JavaModelException {
ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, jproject);
if (initializer == null || container == null) {
setDescription(Messages.format(PreferencesMessages.NativeLibrariesPropertyPage_invalid_container, BasicElementLabels.getPathLabel(containerPath, false)));
return null;
}
String containerName= container.getDescription();
IStatus status= initializer.getAttributeStatus(containerPath, jproject, JavaRuntime.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY);
if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_NOT_SUPPORTED) {
setDescription(Messages.format(PreferencesMessages.NativeLibrariesPropertyPage_not_supported, containerName));
return null;
}
IClasspathEntry entry= JavaModelUtil.findEntryInContainer(container, jarPath);
if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY) {
setDescription(Messages.format(PreferencesMessages.NativeLibrariesPropertyPage_read_only, containerName));
fIsReadOnly= true;
return entry;
}
Assert.isNotNull(entry);
return entry;
}
示例3: evaluateContainerChildStatus
private IStatus evaluateContainerChildStatus(CPListElementAttribute attrib) {
if (fProject != null) {
ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(fPath.segment(0));
if (initializer != null && initializer.canUpdateClasspathContainer(fPath, fProject)) {
if (attrib.isBuiltIn()) {
if (CPListElement.SOURCEATTACHMENT.equals(attrib.getKey())) {
return initializer.getSourceAttachmentStatus(fPath, fProject);
} else if (CPListElement.ACCESSRULES.equals(attrib.getKey())) {
return initializer.getAccessRulesStatus(fPath, fProject);
}
} else {
return initializer.getAttributeStatus(fPath, fProject, attrib.getKey());
}
}
return new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY, "", null); //$NON-NLS-1$
}
return null;
}
示例4: createSourceAttachmentControls
private void createSourceAttachmentControls(Composite composite, IPackageFragmentRoot root) throws JavaModelException {
IClasspathEntry entry;
try {
entry= JavaModelUtil.getClasspathEntry(root);
} catch (JavaModelException ex) {
if (ex.isDoesNotExist())
entry= null;
else
throw ex;
}
IPath containerPath= null;
if (entry == null || root.getKind() != IPackageFragmentRoot.K_BINARY) {
createLabel(composite, Messages.format(JavaEditorMessages.SourceAttachmentForm_message_noSource, BasicElementLabels.getFileName( fFile)));
return;
}
IJavaProject jproject= root.getJavaProject();
boolean canEditEncoding= true;
if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
containerPath= entry.getPath();
ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, jproject);
if (initializer == null || container == null) {
createLabel(composite, Messages.format(JavaEditorMessages.ClassFileEditor_SourceAttachmentForm_cannotconfigure, BasicElementLabels.getPathLabel(containerPath, false)));
return;
}
String containerName= container.getDescription();
IStatus status= initializer.getSourceAttachmentStatus(containerPath, jproject);
if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_NOT_SUPPORTED) {
createLabel(composite, Messages.format(JavaEditorMessages.ClassFileEditor_SourceAttachmentForm_notsupported, containerName));
return;
}
if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY) {
createLabel(composite, Messages.format(JavaEditorMessages.ClassFileEditor_SourceAttachmentForm_readonly, containerName));
return;
}
IStatus attributeStatus= initializer.getAttributeStatus(containerPath, jproject, IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING);
canEditEncoding= !(attributeStatus.getCode() == ClasspathContainerInitializer.ATTRIBUTE_NOT_SUPPORTED || attributeStatus.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY);
entry= JavaModelUtil.findEntryInContainer(container, root.getPath());
Assert.isNotNull(entry);
}
Button button;
IPath path= entry.getSourceAttachmentPath();
if (path == null || path.isEmpty()) {
String rootLabel= JavaElementLabels.getElementLabel(root, JavaElementLabels.ALL_DEFAULT);
createLabel(composite, Messages.format(JavaEditorMessages.SourceAttachmentForm_message_noSourceAttachment, rootLabel));
createLabel(composite, JavaEditorMessages.SourceAttachmentForm_message_pressButtonToAttach);
createLabel(composite, null);
button= createButton(composite, JavaEditorMessages.SourceAttachmentForm_button_attachSource);
} else {
createLabel(composite, Messages.format(JavaEditorMessages.SourceAttachmentForm_message_noSourceInAttachment, BasicElementLabels.getFileName(fFile)));
createLabel(composite, JavaEditorMessages.SourceAttachmentForm_message_pressButtonToChange);
createLabel(composite, null);
button= createButton(composite, JavaEditorMessages.SourceAttachmentForm_button_changeAttachedSource);
}
button.addSelectionListener(getButtonListener(entry, containerPath, jproject, canEditEncoding));
}
示例5: createPageContent
private Control createPageContent(Composite composite) {
try {
fContainerPath= null;
fEntry= null;
fRoot= getJARPackageFragmentRoot();
if (fRoot == null || fRoot.getKind() != IPackageFragmentRoot.K_BINARY) {
return createMessageContent(composite, PreferencesMessages.SourceAttachmentPropertyPage_noarchive_message, null);
}
IPath containerPath= null;
IJavaProject jproject= fRoot.getJavaProject();
IClasspathEntry entry= JavaModelUtil.getClasspathEntry(fRoot);
boolean canEditEncoding= true;
if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
containerPath= entry.getPath();
ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, jproject);
if (initializer == null || container == null) {
return createMessageContent(composite, Messages.format(PreferencesMessages.SourceAttachmentPropertyPage_invalid_container, BasicElementLabels.getPathLabel(containerPath, false)), fRoot);
}
String containerName= container.getDescription();
IStatus status= initializer.getSourceAttachmentStatus(containerPath, jproject);
if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_NOT_SUPPORTED) {
return createMessageContent(composite, Messages.format(PreferencesMessages.SourceAttachmentPropertyPage_not_supported, containerName), null);
}
if (status.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY) {
return createMessageContent(composite, Messages.format(PreferencesMessages.SourceAttachmentPropertyPage_read_only, containerName), fRoot);
}
IStatus attributeStatus= initializer.getAttributeStatus(containerPath, jproject, IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING);
canEditEncoding= !(attributeStatus.getCode() == ClasspathContainerInitializer.ATTRIBUTE_NOT_SUPPORTED || attributeStatus.getCode() == ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY);
entry= JavaModelUtil.findEntryInContainer(container, fRoot.getPath());
}
fContainerPath= containerPath;
fEntry= entry;
fSourceAttachmentBlock= new SourceAttachmentBlock(this, entry, canEditEncoding);
return fSourceAttachmentBlock.createControl(composite);
} catch (CoreException e) {
JavaPlugin.log(e);
return createMessageContent(composite, PreferencesMessages.SourceAttachmentPropertyPage_noarchive_message, null);
}
}