use of com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlashPlayerTrustUtil method updateTrustedStatus.
public static void updateTrustedStatus(final Module module, final FlexBuildConfiguration bc, final boolean isDebug, final boolean isTrusted) {
final Collection<String> paths = new ArrayList<>();
try {
paths.add(new File(PathUtil.getParentPath(bc.getActualOutputFilePath())).getCanonicalPath());
} catch (IOException e) {
/**/
}
for (DependencyEntry entry : bc.getDependencies().getEntries()) {
if (entry instanceof BuildConfigurationEntry && entry.getDependencyType().getLinkageType() == LinkageType.LoadInRuntime) {
final FlexBuildConfiguration dependencyBC = ((BuildConfigurationEntry) entry).findBuildConfiguration();
if (dependencyBC != null) {
try {
paths.add(new File(PathUtil.getParentPath(dependencyBC.getActualOutputFilePath())).getCanonicalPath());
} catch (IOException e) {
/**/
}
}
}
}
updateTrustedStatus(module.getProject(), isTrusted, isDebug, paths.toArray(new String[paths.size()]));
}
use of com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlashRunConfiguration method getState.
@Override
public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException {
final FlexBuildConfiguration config;
try {
config = myRunnerParameters.checkAndGetModuleAndBC(getProject()).second;
} catch (RuntimeConfigurationError e) {
throw new ExecutionException(e.getMessage());
}
final BuildConfigurationNature nature = config.getNature();
if (nature.isDesktopPlatform() || (nature.isMobilePlatform() && myRunnerParameters.getMobileRunTarget() == AirMobileRunTarget.Emulator)) {
return new AirRunState(getProject(), env, myRunnerParameters);
}
return EmptyRunProfileState.INSTANCE;
}
use of com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlashRunConfigurationForm method doResetEditorFrom.
private void doResetEditorFrom(final FlashRunConfiguration configuration) {
final FlashRunnerParameters params = configuration.getRunnerParameters();
// must be before myBCsCombo.setModel()
myLauncherParameters = params.getLauncherParameters().clone();
myBCCombo.resetFrom(params);
myOverrideMainClassCheckBox.setSelected(params.isOverrideMainClass());
if (params.isOverrideMainClass()) {
myMainClassComponent.setText(params.getOverriddenMainClass());
myOutputFileNameTextField.setText(params.getOverriddenOutputFileName());
}
myBCOutputRadioButton.setSelected(!params.isLaunchUrl());
myUrlOrFileRadioButton.setSelected(params.isLaunchUrl());
final String url = params.getUrl();
final boolean windowsLocalFile = SystemInfo.isWindows && url.length() >= 2 && Character.isLetter(url.charAt(0)) && ':' == url.charAt(1);
myUrlOrFileTextWithBrowse.setText(windowsLocalFile ? FileUtil.toSystemDependentName(url) : url);
myRunTrustedCheckBox.setSelected(params.isRunTrusted());
myAdlOptionsEditor.setText(params.getAdlOptions());
myAirProgramParametersEditor.setText(params.getAirProgramParameters());
myOnEmulatorRadioButton.setSelected(params.getMobileRunTarget() == AirMobileRunTarget.Emulator);
myEmulatorCombo.setSelectedItem(params.getEmulator());
if (params.getEmulator().adlAlias == null) {
myScreenWidth.setText(String.valueOf(params.getScreenWidth()));
myScreenHeight.setText(String.valueOf(params.getScreenHeight()));
myFullScreenWidth.setText(String.valueOf(params.getFullScreenWidth()));
myFullScreenHeight.setText(String.valueOf(params.getFullScreenHeight()));
myScreenDpi.setText(params.getScreenDpi() > 0 ? String.valueOf(params.getScreenDpi()) : "");
}
myOnAndroidDeviceRadioButton.setSelected(params.getMobileRunTarget() == AirMobileRunTarget.AndroidDevice);
myOnIOSSimulatorRadioButton.setSelected(params.getMobileRunTarget() == AirMobileRunTarget.iOSSimulator);
myIOSSimulatorSdkTextWithBrowse.setText(FileUtil.toSystemDependentName(params.getIOSSimulatorSdkPath()));
myOnIOSDeviceRadioButton.setSelected(params.getMobileRunTarget() == AirMobileRunTarget.iOSDevice);
myFastPackagingCheckBox.setSelected(params.isFastPackaging());
myDebugOverNetworkRadioButton.setSelected(params.getDebugTransport() == AirMobileDebugTransport.Network);
myDebugOverUSBRadioButton.setSelected(params.getDebugTransport() == AirMobileDebugTransport.USB);
myUsbDebugPortTextField.setText(String.valueOf(params.getUsbDebugPort()));
myEmulatorAdlOptionsEditor.setText(params.getEmulatorAdlOptions());
myAppDescriptorForEmulatorCombo.setSelectedItem(params.getAppDescriptorForEmulator());
final FlexBuildConfiguration bc = myBCCombo.getBC();
mySdkForDebuggingCombo.setBCSdk(bc == null ? null : bc.getSdk());
mySdkForDebuggingCombo.setSelectedSdkRaw(params.getDebuggerSdkRaw());
updateControls();
}
use of com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlashRunConfigurationForm method initMainClassRelatedControls.
private void initMainClassRelatedControls() {
myOverrideMainClassCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
if (myOverrideMainClassCheckBox.isSelected()) {
updateOutputFileName(myOutputFileNameTextField, false);
}
updateControls();
if (myMainClassComponent.isEnabled()) {
IdeFocusManager.getInstance(myProject).requestFocus(myMainClassComponent.getChildComponent(), true);
}
}
});
myMainClassComponent.addDocumentListener(new DocumentListener() {
@Override
public void documentChanged(final DocumentEvent e) {
final String shortName = StringUtil.getShortName(myMainClassComponent.getText().trim());
if (!shortName.isEmpty()) {
myOutputFileNameTextField.setText(shortName + ".swf");
}
}
});
myOutputFileNameTextField.getDocument().addDocumentListener(new com.intellij.ui.DocumentAdapter() {
@Override
protected void textChanged(final javax.swing.event.DocumentEvent e) {
final FlexBuildConfiguration bc = myBCCombo.getBC();
if (bc != null && bc.getTargetPlatform() == TargetPlatform.Web) {
updateBCOutputLabel(bc);
}
}
});
}
use of com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlashRunConfigurationForm method updateControls.
private void updateControls() {
final FlexBuildConfiguration bc = myBCCombo.getBC();
final Module module = myBCCombo.getModule();
final boolean overrideMainClass = myOverrideMainClassCheckBox.isSelected();
myMainClassComponent.setEnabled(overrideMainClass);
myOutputFileNameLabel.setEnabled(overrideMainClass);
myOutputFileNameTextField.setEnabled(overrideMainClass);
if (!overrideMainClass && bc != null && module != null) {
final InfoFromConfigFile info = FlexCompilerConfigFileUtil.getInfoFromConfigFile(bc.getCompilerOptions().getAdditionalConfigFilePath());
myMainClassComponent.setText(StringUtil.notNullize(info.getMainClass(module), bc.getMainClass()));
myOutputFileNameTextField.setText(StringUtil.notNullize(info.getOutputFileName(), bc.getOutputFileName()));
}
final boolean web = bc != null && bc.getTargetPlatform() == TargetPlatform.Web;
final boolean desktop = bc != null && bc.getTargetPlatform() == TargetPlatform.Desktop;
final boolean mobile = bc != null && bc.getTargetPlatform() == TargetPlatform.Mobile;
myLaunchPanel.setVisible(web);
myWebOptionsPanel.setVisible(web);
myDesktopOptionsPanel.setVisible(desktop);
myMobileRunPanel.setVisible(mobile);
myMobileOptionsPanel.setVisible(mobile);
if (web) {
updateBCOutputLabel(bc);
myUrlOrFileTextWithBrowse.setEnabled(myUrlOrFileRadioButton.isSelected());
myLauncherParametersTextWithBrowse.getTextField().setText(myLauncherParameters.getPresentableText());
myRunTrustedCheckBox.setEnabled(!myUrlOrFileRadioButton.isSelected());
}
if (mobile) {
final boolean runOnEmulator = myOnEmulatorRadioButton.isSelected();
final boolean app = bc.getOutputType() == OutputType.Application;
myEmulatorCombo.setEnabled(runOnEmulator);
UIUtil.setEnabled(myEmulatorScreenSizePanel, runOnEmulator, true);
myFastPackagingCheckBox.setEnabled(myOnIOSDeviceRadioButton.isSelected());
myEmulatorAdlOptionsLabel.setEnabled(runOnEmulator);
myEmulatorAdlOptionsEditor.setEnabled(runOnEmulator);
myAppDescriptorForEmulatorLabel.setEnabled(app && runOnEmulator);
myAppDescriptorForEmulatorCombo.setEnabled(app && runOnEmulator);
if (runOnEmulator) {
updateEmulatorRelatedControls();
}
myIOSSimulatorSdkTextWithBrowse.setEnabled(myOnIOSSimulatorRadioButton.isSelected());
if (myIOSSimulatorSdkTextWithBrowse.isEnabled() && myIOSSimulatorSdkTextWithBrowse.getText().isEmpty() && SystemInfo.isMac) {
final String latestSelected = PropertiesComponent.getInstance().getValue(LATEST_SELECTED_IOS_SIMULATOR_SDK_PATH_KEY);
myIOSSimulatorSdkTextWithBrowse.setText(FileUtil.toSystemDependentName(StringUtil.notNullize(latestSelected, guessIosSimulatorSdkPath())));
}
updateDebugTransportRelatedControls();
}
}
Aggregations