本文整理汇总了Java中com.intellij.util.PathUtil.toPresentableUrl方法的典型用法代码示例。如果您正苦于以下问题:Java PathUtil.toPresentableUrl方法的具体用法?Java PathUtil.toPresentableUrl怎么用?Java PathUtil.toPresentableUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.PathUtil
的用法示例。
在下文中一共展示了PathUtil.toPresentableUrl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPresentableName
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@NotNull
@Override
public String getPresentableName() {
final String name = myLibrary.getName();
if (name != null) {
return name;
}
else {
if (myLibrary instanceof LibraryEx && ((LibraryEx)myLibrary).isDisposed()) {
return "<unknown>";
}
final String[] urls = myLibrary.getUrls(OrderRootType.CLASSES);
if (urls.length > 0) {
String url = urls[0];
return PathUtil.toPresentableUrl(url);
}
else {
return ProjectBundle.message("library.empty.library.item");
}
}
}
示例2: getAppearance
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public CellAppearanceEx getAppearance(boolean selected, final boolean isBold) {
return new CellAppearanceEx() {
@Override
public void customize(@NotNull SimpleColoredComponent component) {
component.setIcon(getIcon());
final Font font = UIUtil.getTreeFont();
if (isBold) {
component.setFont(font.deriveFont(Font.BOLD));
}
else {
component.setFont(font.deriveFont(Font.PLAIN));
}
final String p = PathUtil.toPresentableUrl(getEditableObject().url());
component.append(PathUtil.getFileName(p),
isBold ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES);
component.append(" (" + PathUtil.getParentPath(p) + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
}
@Override
public void customize(@NotNull final HtmlListCellRenderer renderer) {
throw new UnsupportedOperationException("Rendering in combo box not supported yet.");
}
@NotNull
@Override
public String getText() {
return getDisplayName();
}
};
}
示例3: readValue
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Override
public AntClasspathEntry readValue(Element dataElement) {
String pathUrl = dataElement.getAttributeValue(SinglePathEntry.PATH);
if (pathUrl != null) {
return new SinglePathEntry(PathUtil.toPresentableUrl(pathUrl));
}
String dirUrl = dataElement.getAttributeValue(AllJarsUnderDirEntry.DIR);
if (dirUrl != null) {
return new AllJarsUnderDirEntry(PathUtil.toPresentableUrl(dirUrl));
}
throw new IllegalStateException();
}
示例4: virtualToIoFile
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@NotNull
public static File virtualToIoFile(@NotNull VirtualFile file) {
return new File(PathUtil.toPresentableUrl(file.getUrl()));
}
示例5: getPresentableUrl
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Override
@NotNull
public String getPresentableUrl() {
if (!checkDisposed()) return "";
return PathUtil.toPresentableUrl(getUrl());
}
示例6: readExternal
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
public void readExternal(final Element element) {
String value = element.getAttributeValue(PATH);
myFile = new File(PathUtil.toPresentableUrl(value));
}