use of com.intellij.javascript.karma.scope.KarmaScopeView in project intellij-plugins by JetBrains.
the class KarmaRunConfigurationEditor method getScopeKindView.
@NotNull
private KarmaScopeView getScopeKindView(@NotNull KarmaScopeKind scopeKind) {
KarmaScopeView view = myScopeKindViewMap.get(scopeKind);
if (view == null) {
view = scopeKind.createView(myProject);
myScopeKindViewMap.put(scopeKind, view);
JComponent component = view.getComponent();
if (component.getLayout() instanceof GridBagLayout) {
component.add(Box.createHorizontalStrut(myLongestLabelWidth), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, JBUI.insetsRight(UIUtil.DEFAULT_HGAP), 0, 0));
}
}
return view;
}
use of com.intellij.javascript.karma.scope.KarmaScopeView in project intellij-plugins by JetBrains.
the class KarmaRunConfigurationEditor method resetEditorFrom.
@Override
protected void resetEditorFrom(@NotNull KarmaRunConfiguration runConfiguration) {
KarmaRunSettings runSettings = runConfiguration.getRunSettings();
myNodeInterpreterField.setInterpreterRef(runSettings.getInterpreterRef());
myKarmaPackageField.setSelected(runConfiguration.getKarmaPackage());
myConfigPathField.setTextAndAddToHistory(FileUtil.toSystemDependentName(runSettings.getConfigPath()));
myBrowsers.setText(runSettings.getBrowsers());
myEnvVarsComponent.setData(runSettings.getEnvData());
setScopeKind(runSettings.getScopeKind());
KarmaScopeView view = getScopeKindView(runSettings.getScopeKind());
view.resetFrom(runSettings);
updatePreferredWidth();
}
use of com.intellij.javascript.karma.scope.KarmaScopeView in project intellij-plugins by JetBrains.
the class KarmaRunConfigurationEditor method applyEditorTo.
@Override
protected void applyEditorTo(@NotNull KarmaRunConfiguration runConfiguration) throws ConfigurationException {
KarmaRunSettings.Builder builder = new KarmaRunSettings.Builder();
builder.setConfigPath(myConfigPathField.getChildComponent().getText());
builder.setBrowsers(StringUtil.notNullize(myBrowsers.getText()));
builder.setInterpreterRef(myNodeInterpreterField.getInterpreterRef());
builder.setEnvData(myEnvVarsComponent.getData());
builder.setKarmaPackage(myKarmaPackageField.getSelected());
KarmaScopeKind scopeKind = getScopeKind();
if (scopeKind != null) {
builder.setScopeKind(scopeKind);
KarmaScopeView view = getScopeKindView(scopeKind);
view.applyTo(builder);
}
runConfiguration.setRunSettings(builder.build());
}
use of com.intellij.javascript.karma.scope.KarmaScopeView in project intellij-plugins by JetBrains.
the class KarmaRunConfigurationEditor method setScopeKind.
private void setScopeKind(@NotNull KarmaScopeKind scopeKind) {
KarmaScopeKind selectedScopeKind = getScopeKind();
if (selectedScopeKind != scopeKind) {
JRadioButton radioButton = myRadioButtonMap.get(scopeKind);
radioButton.setSelected(true);
}
KarmaScopeView view = getScopeKindView(scopeKind);
setCenterBorderLayoutComponent(mySelectedScopeKindPanel, view.getComponent());
}
Aggregations