use of org.jkiss.dbeaver.model.virtual.DBVEntity in project dbeaver by serge-rider.
the class ResetRowColorAction method run.
@Override
public void run() {
final DBVEntity vEntity = getColorsVirtualEntity();
vEntity.removeColorOverride(attribute);
updateColors(vEntity);
}
use of org.jkiss.dbeaver.model.virtual.DBVEntity in project dbeaver by serge-rider.
the class ResetAllColorAction method run.
@Override
public void run() {
final DBVEntity vEntity = getColorsVirtualEntity();
if (!UIUtils.confirmAction("Reset all row coloring", "Are you sure you want to reset all color settings for '" + vEntity.getName() + "'?")) {
return;
}
vEntity.removeAllColorOverride();
updateColors(vEntity);
}
use of org.jkiss.dbeaver.model.virtual.DBVEntity in project dbeaver by serge-rider.
the class SetRowColorAction method run.
@Override
public void run() {
RGB color;
final Shell shell = UIUtils.createCenteredShell(resultSetViewer.getControl().getShell());
try {
ColorDialog cd = new ColorDialog(shell);
color = cd.open();
if (color == null) {
return;
}
} finally {
UIUtils.disposeCenteredShell(shell);
}
try {
final DBVEntity vEntity = getColorsVirtualEntity();
vEntity.setColorOverride(attribute, value, null, StringConverter.asString(color));
updateColors(vEntity);
} catch (IllegalStateException e) {
DBWorkbench.getPlatformUI().showError("Row color", "Can't set row color", e);
}
}
use of org.jkiss.dbeaver.model.virtual.DBVEntity in project dbeaver by serge-rider.
the class VirtualEntityEditAction method run.
@Override
public void run() {
DBSDataContainer dataContainer = resultSetViewer.getDataContainer();
if (dataContainer == null) {
return;
}
DBSEntity entity = resultSetViewer.getModel().isSingleSource() ? resultSetViewer.getModel().getSingleSource() : null;
DBVEntity vEntity = resultSetViewer.getModel().getVirtualEntity(entity, true);
EditVirtualEntityDialog dialog = new EditVirtualEntityDialog(resultSetViewer, entity, vEntity);
dialog.setInitPage(EditVirtualEntityDialog.InitPage.ATTRIBUTES);
if (dialog.open() == IDialogConstants.OK_ID) {
resultSetViewer.refreshMetaData();
}
}
use of org.jkiss.dbeaver.model.virtual.DBVEntity in project dbeaver by serge-rider.
the class VirtualUniqueKeyEditAction method isEnabled.
@Override
public boolean isEnabled() {
DBVEntity vEntity = resultSetViewer.getModel().getVirtualEntity(false);
DBVEntityConstraint vConstraint = vEntity == null ? null : vEntity.getBestIdentifier();
return vConstraint != null && (define != vConstraint.hasAttributes());
}
Aggregations