本文整理汇总了Java中com.intellij.ide.wizard.Step类的典型用法代码示例。如果您正苦于以下问题:Java Step类的具体用法?Java Step怎么用?Java Step使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Step类属于com.intellij.ide.wizard包,在下文中一共展示了Step类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createProjectFromTemplate
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
protected Project createProjectFromTemplate(@NotNull String group, @Nullable String name, @Nullable Consumer<Step> adjuster) throws IOException {
runWizard(group, name, null, adjuster);
try {
myCreatedProject = NewProjectUtil.createFromWizard(myWizard, null);
}
catch (Throwable e) {
myCreatedProject = ContainerUtil.find(myProjectManager.getOpenProjects(), new Condition<Project>() {
@Override
public boolean value(Project project) {
return myWizard.getProjectName().equals(project.getName());
}
});
throw new RuntimeException(e);
}
assertNotNull(myCreatedProject);
UIUtil.dispatchAllInvocationEvents();
Project[] projects = myProjectManager.getOpenProjects();
assertEquals(Arrays.asList(projects).toString(), 2, projects.length);
return myCreatedProject;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ProjectWizardTestCase.java
示例2: runWizard
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
protected void runWizard(@Nullable Consumer<Step> adjuster) {
while (true) {
ModuleWizardStep currentStep = myWizard.getCurrentStepObject();
if (adjuster != null) {
adjuster.consume(currentStep);
}
if (myWizard.isLast()) {
break;
}
myWizard.doNextAction();
if (currentStep == myWizard.getCurrentStepObject()) {
throw new RuntimeException(currentStep + " is not validated");
}
}
myWizard.doFinishAction();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ProjectWizardTestCase.java
示例3: showNextStep
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
@Nullable
private Step showNextStep(@Nullable AndroidStudioWizardPath path) {
Step newStep;
if (path != null && path.hasNext()) {
newStep = path.next();
}
else {
newStep = null;
while (myPathListIterator.hasNext() && newStep == null) {
myCurrentPath = myPathListIterator.next();
assert myCurrentPath != null;
myCurrentPath.onPathStarted(true /* fromBeginning */);
newStep = myCurrentPath.getCurrentStep();
}
}
if (newStep != null) {
showStep(newStep);
}
return newStep;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:DynamicWizard.java
示例4: doQuickImport
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
@Override
protected boolean doQuickImport(VirtualFile file, WizardContext wizardContext) {
AddModuleWizard dialog = new AddModuleWizard(null, file.getPath(), new GradleProjectImportProvider(getBuilder()));
getBuilder().prepare(wizardContext);
getBuilder().getControl(null).setLinkedProjectPath(file.getPath());
dialog.getWizardContext().setProjectBuilder(getBuilder());
dialog.navigateToStep(new Function<Step, Boolean>() {
@Override
public Boolean fun(Step step) {
return step instanceof SelectExternalProjectStep;
}
});
if (StringUtil.isEmpty(wizardContext.getProjectName())) {
final String projectName = dialog.getWizardContext().getProjectName();
if (!StringUtil.isEmpty(projectName)) {
wizardContext.setProjectName(projectName);
}
}
dialog.show();
return dialog.isOK();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:GradleProjectOpenProcessor.java
示例5: importProjectFrom
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
protected Module importProjectFrom(String path, Consumer<Step> adjuster, ProjectImportProvider... providers) {
Module module = importFrom(path, null, adjuster, providers);
if (module != null) {
myCreatedProject = module.getProject();
}
return module;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ProjectWizardTestCase.java
示例6: importFrom
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
private Module importFrom(String path,
@Nullable Project project, Consumer<Step> adjuster,
final ProjectImportProvider... providers) {
VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByPath(path);
assertNotNull("Can't find " + path, file);
assertTrue(providers[0].canImport(file, project));
//noinspection unchecked
myWizard = (T)ImportModuleAction.createImportWizard(project, null, file, providers);
assertNotNull(myWizard);
if (myWizard.getStepCount() > 0) {
runWizard(adjuster);
}
return ContainerUtil.getFirstItem(ImportModuleAction.createFromWizard(project, myWizard));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ProjectWizardTestCase.java
示例7: navigateToStep
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
/**
* Allows to ask current wizard to move to the desired step.
*
* @param filter closure that allows to indicate target step - is called with each of registered steps and is expected
* to return <code>true</code> for the step to go to
* @return <code>true</code> if current wizard is navigated to the target step; <code>false</code> otherwise
*/
public boolean navigateToStep(@NotNull Function<Step, Boolean> filter) {
for (int i = 0, myStepsSize = mySteps.size(); i < myStepsSize; i++) {
ModuleWizardStep step = mySteps.get(i);
if (filter.fun(step) != Boolean.TRUE) {
continue;
}
// Update current step.
myCurrentStep = i;
updateStep();
return true;
}
return false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:AddModuleWizard.java
示例8: showStep
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
private void showStep(@NotNull Step step) {
JComponent component = step.getComponent();
addStepIfNecessary(step);
Icon icon = step.getIcon();
myHost.setIcon(icon);
((CardLayout)myContentPanel.getLayout()).show(myContentPanel, myComponentToIdMap.get(component));
JComponent focusedComponent = step.getPreferredFocusedComponent();
if (focusedComponent != null) {
IdeFocusManager.findInstanceByComponent(focusedComponent).requestFocus(focusedComponent, false);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:DynamicWizard.java
示例9: doNextAction
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
/**
* Commit the current step and move to the next step. Subclasses should rarely need to override
* this method.
*/
public final void doNextAction() {
if (!canAdvance()) {
myHost.shakeWindow();
return;
}
Step newStep = showNextStep(myCurrentPath);
if (newStep == null) {
doFinishAction();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:DynamicWizard.java
示例10: getPreferredFocusedComponent
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
@Nullable
public final JComponent getPreferredFocusedComponent() {
Step currentStep = myCurrentPath.getCurrentStep();
if (currentStep != null) {
return currentStep.getPreferredFocusedComponent();
}
else {
return null;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DynamicWizard.java
示例11: prepareForShow
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
private void prepareForShow() {
// All steps must be included so the window can be sized correctly
for (AndroidStudioWizardPath path : myPaths) {
for (Step step : path.getAllSteps()) {
addStepIfNecessary(step);
}
}
SwingUtilities.getWindowAncestor(myContentPanel).pack();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DynamicWizard.java
示例12: addStepIfNecessary
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
private void addStepIfNecessary(Step step) {
JComponent component = step.getComponent();
String id = myComponentToIdMap.get(component);
if (id == null) {
id = String.valueOf(myComponentToIdMap.size());
myComponentToIdMap.put(component, id);
myContentPanel.add(component, id);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:DynamicWizard.java
示例13: doQuickImport
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
@Override
protected boolean doQuickImport(VirtualFile file, WizardContext wizardContext) {
final GradleProjectImportProvider projectImportProvider = new GradleProjectImportProvider(getBuilder());
getBuilder().setFileToImport(file.getPath());
getBuilder().prepare(wizardContext);
getBuilder().getControl(null).setLinkedProjectPath(file.getPath());
final boolean result;
if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
result = setupGradleProjectSettingsInHeadlessMode(file, projectImportProvider, wizardContext);
}
else {
AddModuleWizard dialog = new AddModuleWizard(null, file.getPath(), projectImportProvider);
dialog.getWizardContext().setProjectBuilder(getBuilder());
dialog.navigateToStep(new Function<Step, Boolean>() {
@Override
public Boolean fun(Step step) {
return step instanceof SelectExternalProjectStep;
}
});
result = dialog.showAndGet();
}
if (result && getBuilder().getExternalProjectNode() != null) {
wizardContext.setProjectName(getBuilder().getExternalProjectNode().getData().getInternalName());
}
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:GradleProjectOpenProcessor.java
示例14: navigateToStep
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
/**
* Allows to ask current wizard to move to the desired step.
*
* @param filter closure that allows to indicate target step - is called with each of registered steps and is expected
* to return <code>true</code> for the step to go to
* @return <code>true</code> if current wizard is navigated to the target step; <code>false</code> otherwise
*/
public boolean navigateToStep(@Nonnull Function<Step, Boolean> filter) {
for (int i = 0, myStepsSize = mySteps.size(); i < myStepsSize; i++) {
ModuleWizardStep step = mySteps.get(i);
if (filter.fun(step) != Boolean.TRUE) {
continue;
}
// Update current step.
myCurrentStep = i;
updateStep();
return true;
}
return false;
}
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:AddModuleWizard.java
示例15: createModuleFromTemplate
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
@Nullable
protected Module createModuleFromTemplate(String group, String name, @Nullable Consumer<Step> adjuster) throws IOException {
runWizard(group, name, getProject(), adjuster);
return createModuleFromWizard();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ProjectWizardTestCase.java
示例16: createProject
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
protected Project createProject(Consumer<Step> adjuster) throws IOException {
createWizard(null);
runWizard(adjuster);
myCreatedProject = NewProjectUtil.createFromWizard(myWizard, null);
return myCreatedProject;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ProjectWizardTestCase.java
示例17: next
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
@Nullable
@Override
public Step next() {
return navigate(1);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:LegacyPathWrapper.java
示例18: navigate
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
private Step navigate(int direction) {
myCurrentStep = findNext(myCurrentStep, direction);
assert myCurrentStep >= 0;
updateWizard();
return mySteps.get(myCurrentStep);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:LegacyPathWrapper.java
示例19: previous
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
@Nullable
@Override
public Step previous() {
return navigate(-1);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:LegacyPathWrapper.java
示例20: testGradleProject
import com.intellij.ide.wizard.Step; //导入依赖的package包/类
public void testGradleProject() throws Exception {
final String projectName = "testProject";
Project project = createProject(new Consumer<Step>() {
@Override
public void consume(Step step) {
if (step instanceof ProjectTypeStep) {
assertTrue(((ProjectTypeStep)step).setSelectedTemplate("Gradle", null));
List<ModuleWizardStep> steps = myWizard.getSequence().getSelectedSteps();
assertEquals(5, steps.size());
final ProjectBuilder projectBuilder = myWizard.getProjectBuilder();
assertInstanceOf(projectBuilder, GradleModuleBuilder.class);
((GradleModuleBuilder)projectBuilder).setName(projectName);
}
}
});
assertEquals(projectName, project.getName());
Module[] modules = ModuleManager.getInstance(project).getModules();
assertEquals(1, modules.length);
final Module module = modules[0];
assertTrue(ModuleRootManager.getInstance(module).isSdkInherited());
assertEquals(projectName, module.getName());
VirtualFile root = ProjectRootManager.getInstance(project).getContentRoots()[0];
VirtualFile settingsScript = VfsUtilCore.findRelativeFile("settings.gradle", root);
assertNotNull(settingsScript);
assertEquals(String.format("rootProject.name = '%s'\n\n", projectName),
StringUtil.convertLineSeparators(VfsUtilCore.loadText(settingsScript)));
VirtualFile buildScript = VfsUtilCore.findRelativeFile("build.gradle", root);
assertNotNull(buildScript);
assertEquals("group '" + projectName + "'\n" +
"version '1.0-SNAPSHOT'\n" +
"\n" +
"apply plugin: 'java'\n" +
"\n" +
"sourceCompatibility = 1.5\n" +
"\n" +
"repositories {\n" +
" mavenCentral()\n" +
"}\n" +
"\n" +
"dependencies {\n" +
" testCompile group: 'junit', name: 'junit', version: '4.11'\n" +
"}\n",
StringUtil.convertLineSeparators(VfsUtilCore.loadText(buildScript)));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:GradleProjectWizardTest.java
注:本文中的com.intellij.ide.wizard.Step类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论