當前位置: 首頁>>代碼示例>>Java>>正文


Java VfsBundle類代碼示例

本文整理匯總了Java中com.intellij.openapi.vfs.VfsBundle的典型用法代碼示例。如果您正苦於以下問題:Java VfsBundle類的具體用法?Java VfsBundle怎麽用?Java VfsBundle使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


VfsBundle類屬於com.intellij.openapi.vfs包,在下文中一共展示了VfsBundle類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: copy

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
@Override
public VirtualFile copy(final Object requestor, @NotNull final VirtualFile newParent, @NotNull final String copyName) throws IOException {
  if (getFileSystem() != newParent.getFileSystem()) {
    throw new IOException(VfsBundle.message("file.copy.error", newParent.getPresentableUrl()));
  }

  if (!newParent.isDirectory()) {
    throw new IOException(VfsBundle.message("file.copy.target.must.be.directory"));
  }

  return EncodingRegistry.doActionAndRestoreEncoding(this, new ThrowableComputable<VirtualFile, IOException>() {
    @Override
    public VirtualFile compute() throws IOException {
      return ourPersistence.copyFile(requestor, VirtualFileSystemEntry.this, newParent, copyName);
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:VirtualFileSystemEntry.java

示例2: copyToMirror

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
@NotNull
private File copyToMirror(@NotNull File original, @NotNull File mirror) {
  ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
  if (progress != null) {
    progress.pushState();
    progress.setText(VfsBundle.message("jar.copy.progress", original.getPath()));
    progress.setFraction(0);
  }

  try {
    FileUtil.copy(original, mirror);
  }
  catch (final IOException e) {
    reportIOErrorWithJars(original, mirror, e);
    return original;
  }

  if (progress != null) {
    progress.popState();
  }

  return mirror;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:24,代碼來源:JarHandler.java

示例3: copyToMirror

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
@Nonnull
private File copyToMirror(@Nonnull File original, @Nonnull File mirror) {
  ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
  if (progress != null) {
    progress.pushState();
    progress.setText(VfsBundle.message("jar.copy.progress", original.getPath()));
    progress.setFraction(0);
  }

  try {
    FileUtil.copy(original, mirror);
  }
  catch (final IOException e) {
    reportIOErrorWithJars(original, mirror, e);
    return original;
  }
  finally {
    if (progress != null) {
      progress.popState();
    }
  }


  return mirror;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:26,代碼來源:JarHandler.java

示例4: rename

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
@Override
public void rename(final Object requestor, @NotNull @NonNls final String newName) throws IOException {
  if (getName().equals(newName)) return;
  if (!isValidName(newName)) {
    throw new IOException(VfsBundle.message("file.invalid.name.error", newName));
  }

  ourPersistence.renameFile(requestor, this, newName);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:VirtualFileSystemEntry.java

示例5: move

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
@Override
public void move(final Object requestor, @NotNull final VirtualFile newParent) throws IOException {
  if (getFileSystem() != newParent.getFileSystem()) {
    throw new IOException(VfsBundle.message("file.move.error", newParent.getPresentableUrl()));
  }

  EncodingRegistry.doActionAndRestoreEncoding(this, new ThrowableComputable<VirtualFile, IOException>() {
    @Override
    public VirtualFile compute() throws IOException {
      ourPersistence.moveFile(requestor, VirtualFileSystemEntry.this, newParent);
      return VirtualFileSystemEntry.this;
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:VirtualFileSystemEntry.java

示例6: setNewName

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
public void setNewName(@NotNull String newName) {
  if (!isValidName(newName)) {
    throw new IllegalArgumentException(VfsBundle.message("file.invalid.name.error", newName));
  }

  VirtualDirectoryImpl parent = getParent();
  parent.removeChild(this);
  mySegment.setNameId(myId, FileNameCache.storeName(newName));
  ((PersistentFSImpl)PersistentFS.getInstance()).incStructuralModificationCount();
  parent.addChild(this);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:VirtualFileSystemEntry.java

示例7: reportIOErrorWithJars

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
private void reportIOErrorWithJars(File original, File target, IOException e) {
  LOG.warn(e);

  String path = original.getPath();
  myFileSystem.setNoCopyJarForPath(path);

  String message = VfsBundle.message("jar.copy.error.message", path, target.getPath(), e.getMessage());
  ERROR_COPY_NOTIFICATION.getValue().createNotification(message, NotificationType.ERROR).notify(null);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:JarHandler.java

示例8: startDownloading

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
@Override
public void startDownloading() {
  LOG.debug("Downloading requested");

  File localFile;
  synchronized (myLock) {
    if (myState != RemoteFileState.DOWNLOADING_NOT_STARTED) {
      LOG.debug("File already downloaded: file = " + myLocalVirtualFile + ", state = " + myState);
      return;
    }
    myState = RemoteFileState.DOWNLOADING_IN_PROGRESS;

    try {
      myLocalFile = myManager.getStorage().createLocalFile(myUrl);
      LOG.debug("Local file created: " + myLocalFile.getAbsolutePath());
    }
    catch (IOException e) {
      LOG.info(e);
      errorOccurred(VfsBundle.message("cannot.create.local.file", e.getMessage()), false);
      return;
    }
    myCancelled.set(false);
    localFile = myLocalFile;
  }
  for (FileDownloadingListener listener : myListeners) {
    listener.downloadingStarted();
  }

  if (myContentProvider == null) {
    myContentProvider = myManager.findContentProvider(myUrl);
  }
  myContentProvider.saveContent(myUrl, localFile, this);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:34,代碼來源:RemoteFileInfoImpl.java

示例9: reportIOErrorWithJars

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
private void reportIOErrorWithJars(File original, File mirror, IOException e) {
  LOG.warn(e);
  final String path = original.getPath();
  final String message = VfsBundle.message("jar.copy.error.message", path, mirror.getPath(), e.getMessage());

  ERROR_COPY_NOTIFICATION.getValue().createNotification(message, NotificationType.ERROR).notify(null);

  myFileSystem.setNoCopyJarForPath(path);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:10,代碼來源:JarHandler.java

示例10: checkSetName

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
@Override
public void checkSetName(String name) throws IncorrectOperationException {
  //CheckUtil.checkIsIdentifier(name);
  CheckUtil.checkWritable(this);
  VirtualFile parentFile = myFile.getParent();
  if (parentFile == null) {
    throw new IncorrectOperationException(VfsBundle.message("cannot.rename.root.directory"));
  }
  VirtualFile child = parentFile.findChild(name);
  if (child != null && !child.equals(myFile)) {
    throw new IncorrectOperationException(VfsBundle.message("file.already.exists.error", child.getPresentableUrl()));
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:14,代碼來源:PsiDirectoryImpl.java

示例11: checkCreateSubdirectory

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
@Override
public void checkCreateSubdirectory(@NotNull String name) throws IncorrectOperationException {
  // TODO : another check?
  //CheckUtil.checkIsIdentifier(name);
  VirtualFile existingFile = getVirtualFile().findChild(name);
  if (existingFile != null) {
    throw new IncorrectOperationException(VfsBundle.message("file.already.exists.error", existingFile.getPresentableUrl()));
  }
  CheckUtil.checkWritable(this);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:11,代碼來源:PsiDirectoryImpl.java

示例12: checkCreateFile

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
@Override
public void checkCreateFile(@NotNull String name) throws IncorrectOperationException {
  VirtualFile existingFile = getVirtualFile().findChild(name);
  if (existingFile != null) {
    throw new IncorrectOperationException(VfsBundle.message("file.already.exists.error", existingFile.getPresentableUrl()));
  }
  CheckUtil.checkWritable(this);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:9,代碼來源:PsiDirectoryImpl.java

示例13: copy

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
@Override
public VirtualFile copy(final Object requestor, @Nonnull final VirtualFile newParent, @Nonnull final String copyName) throws IOException {
  if (getFileSystem() != newParent.getFileSystem()) {
    throw new IOException(VfsBundle.message("file.copy.error", newParent.getPresentableUrl()));
  }

  if (!newParent.isDirectory()) {
    throw new IOException(VfsBundle.message("file.copy.target.must.be.directory"));
  }

  return EncodingRegistry.doActionAndRestoreEncoding(this, () -> ourPersistence.copyFile(requestor, this, newParent, copyName));
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:13,代碼來源:VirtualFileSystemEntry.java

示例14: move

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
@Override
public void move(final Object requestor, @Nonnull final VirtualFile newParent) throws IOException {
  if (getFileSystem() != newParent.getFileSystem()) {
    throw new IOException(VfsBundle.message("file.move.error", newParent.getPresentableUrl()));
  }

  EncodingRegistry.doActionAndRestoreEncoding(this, () -> {
    ourPersistence.moveFile(requestor, this, newParent);
    return this;
  });
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:12,代碼來源:VirtualFileSystemEntry.java

示例15: setNewName

import com.intellij.openapi.vfs.VfsBundle; //導入依賴的package包/類
public void setNewName(@Nonnull String newName) {
  if (!getFileSystem().isValidName(newName)) {
    throw new IllegalArgumentException(VfsBundle.message("file.invalid.name.error", newName));
  }

  VirtualDirectoryImpl parent = getParent();
  parent.removeChild(this);
  mySegment.setNameId(myId, FileNameCache.storeName(newName));
  ((PersistentFSImpl)PersistentFS.getInstance()).incStructuralModificationCount();
  parent.addChild(this);
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:12,代碼來源:VirtualFileSystemEntry.java


注:本文中的com.intellij.openapi.vfs.VfsBundle類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。