private void initAirRuntimeChooser() { final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, true, false, false, false) { public boolean isFileVisible(final VirtualFile file, final boolean showHiddenFiles) { return super.isFileVisible(file, showHiddenFiles) && (file.isDirectory() || ("zip".equalsIgnoreCase(file.getExtension()))); } }; myAirRuntimeComponent .getComponent() .addBrowseFolderListener( "Select AIR Runtime", "Select AIR Runtime as a directory like <Flex SDK>/runtimes/AIR/win/ or as a .zip file", null, descriptor); }
private void initAdlChooser() { final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, false, false, false, false) { public boolean isFileVisible(final VirtualFile file, final boolean showHiddenFiles) { return super.isFileVisible(file, showHiddenFiles) && (file.isDirectory() || (file.getName().startsWith("adl") && isExecutableExtension(file.getExtension()))); } private boolean isExecutableExtension(final String extension) { return SystemInfo.isWindows ? "exe".equalsIgnoreCase(extension) : extension == null || "uexe".equalsIgnoreCase(extension); } }; myAdlComponent .getComponent() .addBrowseFolderListener( "Select ADL executable file", null, null, descriptor, new TextComponentAccessor<JTextField>() { public void setText(final JTextField component, @NotNull final String text) { component.setText(text); final String adlPath = FileUtil.toSystemDependentName(text); if (adlPath.endsWith(FlexSdkUtils.ADL_RELATIVE_PATH)) { final String runtimePath = adlPath.substring( 0, adlPath.length() - FlexSdkUtils.ADL_RELATIVE_PATH.length()) + FlexSdkUtils.AIR_RUNTIME_RELATIVE_PATH; myAirRuntimeComponent.getComponent().setText(runtimePath); } } public String getText(final JTextField component) { return component.getText(); } }); }
String getAirRuntimePath() { return FileUtil.toSystemIndependentName( myAirRuntimeComponent.getComponent().getText().trim()); }
void setAirRuntimePath(final String airRuntimePath) { myAirRuntimeComponent.getComponent().setText(FileUtil.toSystemDependentName(airRuntimePath)); }
String getAdlPath() { return FileUtil.toSystemIndependentName(myAdlComponent.getComponent().getText().trim()); }
void setAdlPath(final String adlPath) { myAdlComponent.getComponent().setText(FileUtil.toSystemDependentName(adlPath)); }