use of org.eclipse.gef.commands.CommandStackEvent in project tdi-studio-se by Talend.
the class DynamicTabbedPropertySection method registerListenerForRefreshingSection.
/**
* amaumont Comment method "registerListenerForRefreshingSection".
*/
public void registerListenerForRefreshingSection() {
if (commandStackEventListener == null) {
DynamicTabbedPropertySection.commandStackEventListener = new CommandStackEventListener() {
@Override
public void stackChanged(CommandStackEvent event) {
int detail = event.getDetail();
if (lastPropertyUsed != null) {
if ((lastPropertyUsed.getElement() instanceof org.talend.designer.core.ui.editor.connections.Connection) && (event.getCommand() instanceof ChangeMetadataCommand) && (//
0 != (detail & CommandStack.POST_EXECUTE) || 0 != (detail & CommandStack.POST_REDO) || 0 != (detail & CommandStack.POST_REDO))) {
lastPropertyUsed.addComponents(true);
lastPropertyUsed.refresh();
}
if (0 != (detail & CommandStack.POST_UNDO) || 0 != (detail & CommandStack.POST_REDO)) {
if (event.getCommand() instanceof IExtendedTableCommand) {
lastPropertyUsed.refresh();
}
}
}
}
};
getCommandStack().addCommandStackEventListener(DynamicTabbedPropertySection.commandStackEventListener);
}
}
use of org.eclipse.gef.commands.CommandStackEvent in project tdi-studio-se by Talend.
the class ProjectSettingMultipleThreadDynamicComposite method getCommandStack.
@Override
public CommandStack getCommandStack() {
if (cs == null) {
// fixed bug 12476
cs = new CommandStack();
cs.addCommandStackEventListener(new CommandStackEventListener() {
public void stackChanged(CommandStackEvent event) {
if (event.getDetail() == CommandStack.POST_EXECUTE) {
isCommandExcute = true;
// when show connection param ,update it if needed
updateConnectionFromRepository();
}
}
});
}
return cs;
}
Aggregations