use of org.jkiss.dbeaver.model.edit.prop.DBECommandProperty in project dbeaver by dbeaver.
the class TabbedFolderPageForm method createControl.
@Override
public void createControl(Composite parent) {
this.boldFont = UIUtils.makeBoldFont(parent.getFont());
// ScrolledComposite scrolled = new ScrolledComposite(parent, SWT.V_SCROLL);
// scrolled.setLayout(new GridLayout(1, false));
propertiesGroup = new Composite(parent, SWT.NONE);
// CSSUtils.setCSSClass(propertiesGroup, DBStyles.COLORED_BY_CONNECTION_TYPE);
curPropertySource = input.getPropertySource();
DBECommandContext commandContext = input.getCommandContext();
if (commandContext != null) {
commandContext.addCommandListener(new DBECommandAdapter() {
@Override
public void onCommandChange(DBECommand<?> command) {
UIUtils.asyncExec(() -> {
updateEditButtonsState();
if (command instanceof DBECommandProperty) {
// We need to exclude current prop from update
// Simple value compare on update is not enough because value can be transformed (e.g. uppercased)
// and it will differ from the value in edit control
Object propId = ((DBECommandProperty<?>) command).getHandler().getId();
updateOtherPropertyValues(propId);
}
});
}
@Override
public void onSave() {
UIUtils.asyncExec(() -> updateEditButtonsState());
}
@Override
public void onReset() {
UIUtils.asyncExec(() -> {
refreshProperties();
updateEditButtonsState();
});
}
});
}
propertiesGroup.addDisposeListener(e -> dispose());
refreshProperties();
}
use of org.jkiss.dbeaver.model.edit.prop.DBECommandProperty in project dbeaver by serge-rider.
the class TabbedFolderPageForm method createControl.
@Override
public void createControl(Composite parent) {
this.boldFont = UIUtils.makeBoldFont(parent.getFont());
// ScrolledComposite scrolled = new ScrolledComposite(parent, SWT.V_SCROLL);
// scrolled.setLayout(new GridLayout(1, false));
propertiesGroup = new Composite(parent, SWT.NONE);
// CSSUtils.setCSSClass(propertiesGroup, DBStyles.COLORED_BY_CONNECTION_TYPE);
curPropertySource = input.getPropertySource();
DBECommandContext commandContext = input.getCommandContext();
if (commandContext != null) {
commandContext.addCommandListener(new DBECommandAdapter() {
@Override
public void onCommandChange(DBECommand<?> command) {
UIUtils.asyncExec(() -> {
updateEditButtonsState();
if (command instanceof DBECommandProperty) {
// We need to exclude current prop from update
// Simple value compare on update is not enough because value can be transformed (e.g. uppercased)
// and it will differ from the value in edit control
Object propId = ((DBECommandProperty<?>) command).getHandler().getId();
updateOtherPropertyValues(propId);
}
});
}
@Override
public void onSave() {
UIUtils.asyncExec(() -> updateEditButtonsState());
}
@Override
public void onReset() {
UIUtils.asyncExec(() -> {
refreshProperties();
updateEditButtonsState();
});
}
});
}
propertiesGroup.addDisposeListener(e -> dispose());
refreshProperties();
}
Aggregations