本文整理汇总了Java中com.intellij.ide.util.projectWizard.WizardContext.getProjectFileDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java WizardContext.getProjectFileDirectory方法的具体用法?Java WizardContext.getProjectFileDirectory怎么用?Java WizardContext.getProjectFileDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.util.projectWizard.WizardContext
的用法示例。
在下文中一共展示了WizardContext.getProjectFileDirectory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AdtImportLocationStep
import com.intellij.ide.util.projectWizard.WizardContext; //导入方法依赖的package包/类
public AdtImportLocationStep(WizardContext context) {
super(context);
myDestinationLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
String prev = context.getProjectFileDirectory();
mySourceProject = new File(FileUtil.toSystemDependentName(prev));
String name = new File(prev).getName();
//noinspection ConstantConditions
context.setProjectFileDirectory(null);
String defaultDir = context.getProjectFileDirectory();
int index = 0;
File file;
do {
String suffix = index == 0 ? "" : Integer.toString(index);
index++;
file = new File(defaultDir, name + suffix);
} while (file.exists());
myDestDirText.setText(file.getPath());
context.setProjectFileDirectory(prev);
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
descriptor.setTitle("Choose Destination Directory");
descriptor.setDescription("Pick a directory to import the given Eclipse Android project into");
myDestDirText.addBrowseFolderListener(new TextBrowseFolderListener(descriptor) {
@Override
protected void onFileChosen(@NotNull VirtualFile chosenFile) {
super.onFileChosen(chosenFile);
myIsPathChangedByUser = true;
}
@Override
public void actionPerformed(ActionEvent e) {
super.actionPerformed(e);
myIsPathChangedByUser = true;
}
});
}