org.eclipse.jdt.internal.core.util.Util.isReadOnlySupported()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中org.eclipse.jdt.internal.core.util.Util.isReadOnlySupported()方法的一些代码示例,展示了Util.isReadOnlySupported()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.isReadOnlySupported()方法的具体详情如下:
包路径:org.eclipse.jdt.internal.core.util.Util
类名称:Util
方法名:isReadOnlySupported

Util.isReadOnlySupported介绍

[英]Returns whether the local file system supports accessing and modifying the read only flag.
[中]返回本地文件系统是否支持访问和修改只读标志。

代码示例

代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps

/**
 * Returns whether the given resource is read-only or not.
 * @param resource
 * @return <code>true</code> if the resource is read-only, <code>false</code> if it is not or
 *     if the file system does not support the read-only attribute.
 */
public static boolean isReadOnly(IResource resource) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return false; // not supported on this platform for this resource
    return resourceAttributes.isReadOnly();
  }
  return false;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

/**
 * Returns whether the given resource is read-only or not.
 * @param resource
 * @return <code>true</code> if the resource is read-only, <code>false</code> if it is not or
 *     if the file system does not support the read-only attribute.
 */
public static boolean isReadOnly(IResource resource) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return false; // not supported on this platform for this resource
    return resourceAttributes.isReadOnly();
  }
  return false;
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

/**
 * Returns whether the given resource is read-only or not.
 * @param resource
 * @return <code>true</code> if the resource is read-only, <code>false</code> if it is not or
 *     if the file system does not support the read-only attribute.
 */
public static boolean isReadOnly(IResource resource) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return false; // not supported on this platform for this resource
    return resourceAttributes.isReadOnly();
  }
  return false;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

/**
 * Returns whether the given resource is read-only or not.
 * @param resource
 * @return <code>true</code> if the resource is read-only, <code>false</code> if it is not or
 *     if the file system does not support the read-only attribute.
 */
public static boolean isReadOnly(IResource resource) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return false; // not supported on this platform for this resource
    return resourceAttributes.isReadOnly();
  }
  return false;
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

/**
 * Returns whether the given resource is read-only or not.
 * @param resource
 * @return <code>true</code> if the resource is read-only, <code>false</code> if it is not or
 *     if the file system does not support the read-only attribute.
 */
public static boolean isReadOnly(IResource resource) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return false; // not supported on this platform for this resource
    return resourceAttributes.isReadOnly();
  }
  return false;
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

/**
 * Returns whether the given resource is read-only or not.
 * @param resource
 * @return <code>true</code> if the resource is read-only, <code>false</code> if it is not or
 *     if the file system does not support the read-only attribute.
 */
public static boolean isReadOnly(IResource resource) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return false; // not supported on this platform for this resource
    return resourceAttributes.isReadOnly();
  }
  return false;
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

/**
 * Returns whether the given resource is read-only or not.
 * @param resource
 * @return <code>true</code> if the resource is read-only, <code>false</code> if it is not or
 *     if the file system does not support the read-only attribute.
 */
public static boolean isReadOnly(IResource resource) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return false; // not supported on this platform for this resource
    return resourceAttributes.isReadOnly();
  }
  return false;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

/**
 * Sets or unsets the given resource as read-only in the file system.
 * It's a no-op if the file system does not support the read-only attribute.
 *
 * @param resource The resource to set as read-only
 * @param readOnly <code>true</code> to set it to read-only,
 *        <code>false</code> to unset
 */
public static void setReadOnly(IResource resource, boolean readOnly) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return; // not supported on this platform for this resource
    resourceAttributes.setReadOnly(readOnly);
    try {
      resource.setResourceAttributes(resourceAttributes);
    } catch (CoreException e) {
      // ignore
    }
  }
}
public static void sort(char[][] list) {

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

/**
 * Sets or unsets the given resource as read-only in the file system.
 * It's a no-op if the file system does not support the read-only attribute.
 *
 * @param resource The resource to set as read-only
 * @param readOnly <code>true</code> to set it to read-only,
 *        <code>false</code> to unset
 */
public static void setReadOnly(IResource resource, boolean readOnly) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return; // not supported on this platform for this resource
    resourceAttributes.setReadOnly(readOnly);
    try {
      resource.setResourceAttributes(resourceAttributes);
    } catch (CoreException e) {
      // ignore
    }
  }
}
public static void sort(char[][] list) {

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

/**
 * Sets or unsets the given resource as read-only in the file system.
 * It's a no-op if the file system does not support the read-only attribute.
 *
 * @param resource The resource to set as read-only
 * @param readOnly <code>true</code> to set it to read-only,
 *        <code>false</code> to unset
 */
public static void setReadOnly(IResource resource, boolean readOnly) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return; // not supported on this platform for this resource
    resourceAttributes.setReadOnly(readOnly);
    try {
      resource.setResourceAttributes(resourceAttributes);
    } catch (CoreException e) {
      // ignore
    }
  }
}
public static void sort(char[][] list) {

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

/**
 * Sets or unsets the given resource as read-only in the file system.
 * It's a no-op if the file system does not support the read-only attribute.
 *
 * @param resource The resource to set as read-only
 * @param readOnly <code>true</code> to set it to read-only,
 *        <code>false</code> to unset
 */
public static void setReadOnly(IResource resource, boolean readOnly) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return; // not supported on this platform for this resource
    resourceAttributes.setReadOnly(readOnly);
    try {
      resource.setResourceAttributes(resourceAttributes);
    } catch (CoreException e) {
      // ignore
    }
  }
}
public static void sort(char[][] list) {

代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps

/**
 * Sets or unsets the given resource as read-only in the file system.
 * It's a no-op if the file system does not support the read-only attribute.
 *
 * @param resource The resource to set as read-only
 * @param readOnly <code>true</code> to set it to read-only,
 *        <code>false</code> to unset
 */
public static void setReadOnly(IResource resource, boolean readOnly) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return; // not supported on this platform for this resource
    resourceAttributes.setReadOnly(readOnly);
    try {
      resource.setResourceAttributes(resourceAttributes);
    } catch (CoreException e) {
      // ignore
    }
  }
}
public static void sort(char[][] list) {

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

/**
 * Sets or unsets the given resource as read-only in the file system.
 * It's a no-op if the file system does not support the read-only attribute.
 *
 * @param resource The resource to set as read-only
 * @param readOnly <code>true</code> to set it to read-only,
 *        <code>false</code> to unset
 */
public static void setReadOnly(IResource resource, boolean readOnly) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return; // not supported on this platform for this resource
    resourceAttributes.setReadOnly(readOnly);
    try {
      resource.setResourceAttributes(resourceAttributes);
    } catch (CoreException e) {
      // ignore
    }
  }
}
public static void sort(char[][] list) {

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

/**
 * Sets or unsets the given resource as read-only in the file system.
 * It's a no-op if the file system does not support the read-only attribute.
 *
 * @param resource The resource to set as read-only
 * @param readOnly <code>true</code> to set it to read-only,
 *        <code>false</code> to unset
 */
public static void setReadOnly(IResource resource, boolean readOnly) {
  if (isReadOnlySupported()) {
    ResourceAttributes resourceAttributes = resource.getResourceAttributes();
    if (resourceAttributes == null) return; // not supported on this platform for this resource
    resourceAttributes.setReadOnly(readOnly);
    try {
      resource.setResourceAttributes(resourceAttributes);
    } catch (CoreException e) {
      // ignore
    }
  }
}
public static void sort(char[][] list) {

相关文章

Util类方法