use of com.evolveum.midpoint.studio.impl.Environment in project midpoint-studio by Evolveum.
the class EncryptedPropertyEditorDialog method createUIComponents.
private void createUIComponents() {
environment = new ComboBox();
environment.setRenderer(new DefaultListCellRenderer() {
@Override
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
if (value instanceof Environment) {
value = ((Environment) value).getName();
} else if (value == null) {
value = ALL_ENVIRONMENTS;
}
return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
}
});
}
use of com.evolveum.midpoint.studio.impl.Environment in project midpoint-studio by Evolveum.
the class EncryptedPropertyEditorDialog method populateProperty.
private void populateProperty() {
property.setKey(key.getText());
Environment env = (Environment) environment.getSelectedItem();
property.setEnvironment(env != null ? env.getId() : null);
property.setValue(password.getText());
property.setDescription(description.getText());
}
use of com.evolveum.midpoint.studio.impl.Environment in project midpoint-studio by Evolveum.
the class EnvironmentEditorDialog method fillInFields.
private void fillInFields() {
selected.setSelected(selectable.isSelected());
Environment environment = selectable.getObject();
name.setText(environment.getName());
url.setText(environment.getUrl());
username.setText(environment.getUsername());
password.setText(environment.getPassword());
ignoreSslErrors.setSelected(environment.isIgnoreSslErrors());
useHttp2.setSelected(environment.isUseHttp2());
proxyHost.setText(environment.getProxyServerHost());
proxyPort.setText(environment.getProxyServerPort() != null ? environment.getProxyServerPort().toString() : null);
proxyType.setSelectedItem(environment.getProxyServerType());
proxyUsername.setText(environment.getProxyUsername());
proxyPassword.setText(environment.getProxyPassword());
properties.setText(environment.getPropertiesFilePath());
colorLabel.setBackground(environment.getAwtColor());
}
use of com.evolveum.midpoint.studio.impl.Environment in project midpoint-studio by Evolveum.
the class EnvironmentsPanel method getFullSettings.
public EnvironmentSettings getFullSettings() {
EnvironmentSettings settings = new EnvironmentSettings();
List<Environment> envts = new ArrayList<>();
getData().forEach(s -> envts.add(s.getObject()));
settings.setEnvironments(envts);
for (Selectable<Environment> e : getData()) {
if (e.isSelected()) {
settings.setSelectedId(e.getObject().getId());
break;
}
}
return settings;
}
use of com.evolveum.midpoint.studio.impl.Environment in project midpoint-studio by Evolveum.
the class BrowseToolPanel method createQueryActionGroup.
private DefaultActionGroup createQueryActionGroup() {
DefaultActionGroup group = new DefaultActionGroup();
objectType = new ComboObjectTypes();
group.add(objectType);
queryType = new ComboQueryType() {
@Override
public void setSelected(Type selected) {
super.setSelected(selected);
if (queryType.getSelected() == null || query == null) {
return;
}
switch(queryType.getSelected()) {
case QUERY_XML:
if (StringUtils.isEmpty(query.getText())) {
query.setText(EMPTY_XML_QUERY);
}
break;
case NAME:
case NAME_OR_OID:
case OID:
// todo file type
break;
case AXIOM:
if (StringUtils.isEmpty(query.getText())) {
query.setText("");
}
break;
}
}
};
group.add(queryType);
CheckboxAction rawSearch = new CheckboxAction("Raw") {
@Override
public void update(AnActionEvent e) {
e.getPresentation().setEnabled(isSearchEnabled());
super.update(e);
}
@Override
public boolean isSelected(@NotNull AnActionEvent e) {
return BrowseToolPanel.this.rawSearch;
}
@Override
public void setSelected(@NotNull AnActionEvent e, boolean state) {
BrowseToolPanel.this.rawSearch = state;
}
};
group.add(rawSearch);
pagingAction = createAnAction("Paging", "Paging Settings", AllIcons.General.GearPlain, e -> pagingSettingsPerformed(e), e -> e.getPresentation().setEnabled(isSearchEnabled()));
group.add(pagingAction);
searchAction = new AsyncAction<>("Search", AllIcons.Actions.Find) {
@Override
protected BackgroundableTask createTask(AnActionEvent e, Environment env) {
return new BackgroundableTask(e.getProject(), "Searching objects", "Searching objects") {
@Override
protected void doRun(ProgressIndicator indicator) {
searchPerformed(e, indicator);
}
};
}
@Override
protected boolean isActionEnabled(AnActionEvent evt) {
return isSearchEnabled();
}
};
group.add(searchAction);
cancelAction = createAnAction("Cancel", AllIcons.Actions.Cancel, e -> cancelPerformed(e), e -> e.getPresentation().setEnabled(isCancelEnabled()));
group.add(cancelAction);
return group;
}
Aggregations