use of com.haulmont.cuba.gui.components.actions.RefreshAction in project cuba by cuba-platform.
the class CategoryAttrsFrame method init.
@Override
public void init(Map<String, Object> params) {
super.init(params);
categoryAttrsTable.addAction(new CategoryAttributeCreateAction());
categoryAttrsTable.addAction(new CategoryAttributeEditAction());
categoryAttrsTable.addAction(new RemoveAction(categoryAttrsTable, false));
categoryAttrsTable.addAction(new RefreshAction(categoryAttrsTable));
categoryAttrsDs.addStateChangeListener(e -> {
if (e.getState() != Datasource.State.VALID) {
return;
}
initDataTypeColumn();
initDefaultValueColumn();
});
initMoveButtons();
}
use of com.haulmont.cuba.gui.components.actions.RefreshAction in project cuba by cuba-platform.
the class ScheduledExecutionBrowser method init.
@Override
public void init(Map<String, Object> params) {
executionsTable.addAction(new RefreshAction(executionsTable));
int maxResults = persistenceManager.getFetchUI(executionsDs.getMetaClass().getName());
executionsDs.setMaxResults(maxResults);
}
use of com.haulmont.cuba.gui.components.actions.RefreshAction in project cuba by cuba-platform.
the class MbeansDisplayWindow method init.
@Override
public void init(Map<String, Object> params) {
super.init(params);
objectNameField.addValueChangeListener(new ObjectNameFieldListener());
mbeansTable.addAction(new RefreshAction(mbeansTable));
Action inspectAction = new ItemTrackingAction("inspect").withCaption(getMessage("action.inspect")).withHandler(event -> {
Set<ManagedBeanInfo> selected = mbeansTable.getSelected();
if (!selected.isEmpty()) {
ManagedBeanInfo mbi = selected.iterator().next();
if (mbi.getObjectName() != null) {
// otherwise it's a fake root node
Window editor = openEditor("jmxConsoleInspectMbean", mbi, OpenType.THIS_TAB);
editor.addCloseListener(actionId -> {
mbeansTable.requestFocus();
});
} else {
// expand / collapse fake root node
UUID itemId = mbi.getId();
if (mbeansTable.isExpanded(itemId)) {
mbeansTable.collapse(itemId);
} else {
mbeansTable.expand(itemId);
}
}
}
});
mbeansTable.addAction(inspectAction);
mbeansTable.setItemClickAction(inspectAction);
localJmxInstance = jmxControlAPI.getLocalInstance();
jmxInstancesDs.refresh();
jmxConnectionField.setValue(localJmxInstance);
jmxConnectionField.setRequired(true);
jmxConnectionField.addValueChangeListener(e -> {
JmxInstance jmxInstance = (JmxInstance) e.getValue();
try {
mbeanDs.setJmxInstance(jmxInstance);
mbeanDs.refresh();
} catch (JmxControlException ex) {
showNotification(getMessage("unableToConnectToInterface"), NotificationType.WARNING);
if (jmxInstance != localJmxInstance) {
jmxConnectionField.setValue(localJmxInstance);
}
}
});
jmxConnectionField.removeAllActions();
jmxConnectionField.addAction(new PickerField.LookupAction(jmxConnectionField) {
@Override
public void afterCloseLookup(String actionId) {
jmxInstancesDs.refresh();
}
});
jmxConnectionField.addAction(new BaseAction("actions.Add").withIcon("icons/plus-btn.png").withHandler(event -> {
JmxInstanceEditor instanceEditor = (JmxInstanceEditor) openEditor(metadata.create(JmxInstance.class), OpenType.DIALOG);
instanceEditor.addCloseListener(actionId -> {
if (COMMIT_ACTION_ID.equals(actionId)) {
jmxInstancesDs.refresh();
jmxConnectionField.setValue(instanceEditor.getItem());
}
});
}));
mbeanDs.setJmxInstance(localJmxInstance);
mbeanDs.refresh();
localJmxField.setValue(jmxControlAPI.getLocalNodeName());
localJmxField.setEditable(false);
mbeansTable.setStyleProvider((entity, property) -> {
if (entity != null && entity.getObjectName() == null) {
return "c-jmx-tree-table-domain";
}
return null;
});
}
Aggregations