use of org.eclipse.swt.events.ControlEvent in project tdi-studio-se by Talend.
the class StyledTextHandler method addListeners.
/**
* DOC amaumont Comment method "addListeners".
*/
private void addListeners() {
styledText.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent e) {
refreshProposalSize();
}
public void focusLost(FocusEvent e) {
}
});
styledText.addControlListener(new ControlListener() {
public void controlMoved(ControlEvent e) {
}
public void controlResized(ControlEvent e) {
refreshProposalSize();
}
});
styledText.addExtendedModifyListener(new ExtendedModifyListener() {
public void modifyText(ExtendedModifyEvent event) {
// System.out.println("ExtendedModifyListener modify text");
updateCellExpression();
}
});
styledText.getContent().addTextChangeListener(new TextChangeListener() {
public void textChanged(TextChangedEvent event) {
highlightLineOfCursorPosition(styledText.getSelection());
}
public void textChanging(TextChangingEvent event) {
// System.out.println("textChanging");
}
public void textSet(TextChangedEvent event) {
// System.out.println("textSet");
}
});
styledText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
highlightLineOfCursorPosition(styledText.getSelection());
}
});
styledText.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {
highlightLineOfCursorPosition(styledText.getSelection());
}
public void keyReleased(KeyEvent e) {
// TODO Auto-generated method stub
}
});
styledText.addVerifyKeyListener(new VerifyKeyListener() {
public void verifyKey(VerifyEvent verifyEvent) {
if (verifyEvent.character == '\r' && contentProposalAdapter != null && contentProposalAdapter.isProposalOpened()) {
verifyEvent.doit = false;
} else {
verifyEvent.doit = true;
}
}
});
styledText.addMouseListener(new MouseListener() {
public void mouseDoubleClick(MouseEvent e) {
highlightLineOfCursorPosition(styledText.getSelection());
}
public void mouseDown(MouseEvent e) {
mapperManager.fireCurrentDirectEditApply();
highlightLineOfCursorPosition(styledText.getSelection());
}
public void mouseUp(MouseEvent e) {
}
});
}
use of org.eclipse.swt.events.ControlEvent in project tdi-studio-se by Talend.
the class RowGenMain method createUI.
/**
* qzhang Comment method "createUI".
*
* @param display
* @return
*/
public Shell createUI(Display display) {
Shell shell = new Shell(display, SWT.APPLICATION_MODAL | SWT.BORDER | SWT.RESIZE | SWT.CLOSE | SWT.MIN | SWT.MAX | SWT.TITLE);
IComponent component = connector.getComponent();
shell.setImage(CoreImageProvider.getComponentIcon(component, ICON_SIZE.ICON_32));
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
String productName = brandingService.getFullProductName();
//$NON-NLS-1$
shell.setText(Messages.getString("RowGenMain.ShellTitle", productName, connector.getUniqueName()));
Rectangle boundsRG = ExternalRowGeneratorUiProperties.getBoundsRowGen();
if (ExternalRowGeneratorUiProperties.isShellMaximized()) {
shell.setMaximized(ExternalRowGeneratorUiProperties.isShellMaximized());
} else {
boundsRG = ExternalRowGeneratorUiProperties.getBoundsRowGen();
if (boundsRG.x < 0) {
boundsRG.x = 0;
}
if (boundsRG.y < 0) {
boundsRG.y = 0;
}
shell.setBounds(boundsRG);
}
createUI(shell, false);
updateComponentsSize();
updateTableTitleColumn();
shell.open();
shell.addControlListener(new ControlListener() {
public void controlMoved(ControlEvent e) {
generatorUI.getDataTableView().attachLabelPosition();
}
public void controlResized(ControlEvent e) {
generatorUI.getDataTableView().attachLabelPosition();
generatorUI.getDataTableView().fixedLabelSize();
}
});
addAllControlForKeyListener(shell);
// shell.moveAbove(null);
generatorUI.getDataTableView().updateHeader(ExternalRowGeneratorUiProperties.getShowColumnsList());
return shell;
}
use of org.eclipse.swt.events.ControlEvent in project tdi-studio-se by Talend.
the class MapperUI method createOutputZoneWithTables.
private void createOutputZoneWithTables(MapperModel mapperModel, final UIManager uiManager, final Display display) {
Control previousControl;
outputsZone = new OutputsZone(datasFlowViewSashForm, SWT.NONE, mapperManager);
outputsZone.createHeaderZoneComponents();
// this.dropTargetOperationListener.addControl(outputsZone);
sc3 = new ScrolledComposite(outputsZone, getBorder() | SWT.H_SCROLL | SWT.V_SCROLL);
// this.dropTargetOperationListener.addControl(sc3);
GridData sc3GridData = new GridData(GridData.FILL_BOTH);
sc3.setLayoutData(sc3GridData);
sc3.setBackgroundMode(SWT.INHERIT_DEFAULT);
sc3.addControlListener(new ControlListener() {
public void controlMoved(ControlEvent e) {
// System.out.println("sc3 controlMoved");
}
public void controlResized(ControlEvent e) {
// System.out.println("sc3 controlResized");
onSashResized(display);
}
});
outputTablesZoneView = new OutputTablesZoneView(sc3, getBorder(), mapperManager);
// this.dropTargetOperationListener.addControl(outputTablesZoneView);
outputTablesZoneView.setBackgroundMode(SWT.INHERIT_DEFAULT);
sc3.setExpandHorizontal(true);
sc3.setContent(outputTablesZoneView);
sc3MSListener = new MouseScrolledListener(mapperManager.getUiManager(), sc3);
outputTablesZoneView.initInsertionIndicator();
previousControl = null;
List<OutputTable> tables = mapperModel.getOutputDataMapTables();
Boolean minimizeStateOfTables = getMinimizedButtonState(tables);
if (minimizeStateOfTables != null) {
outputsZone.getToolbar().setMinimizeButtonState(minimizeStateOfTables.booleanValue());
}
for (IDataMapTable abstractDataMapTable : tables) {
OutputDataMapTableView dataMapTableView = uiManager.createNewOutputTableView(previousControl, abstractDataMapTable, outputTablesZoneView);
previousControl = dataMapTableView;
}
outputTablesZoneView.setSize(outputTablesZoneView.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
use of org.eclipse.swt.events.ControlEvent in project tdi-studio-se by Talend.
the class MetadataTableEditorViewExt method addTableColumnsListener.
private void addTableColumnsListener() {
ControlListener controlListener = new ControlListener() {
@Override
public void controlMoved(ControlEvent e) {
MetadataTableEditorViewExt.this.attachLabelPosition(getTable().getHorizontalBar().getSelection());
}
@Override
public void controlResized(ControlEvent e) {
MetadataTableEditorViewExt.this.attachLabelPosition(getTable().getHorizontalBar().getSelection());
}
};
for (Object element2 : getTableViewerCreator().getColumns()) {
TableViewerCreatorColumnNotModifiable element = (TableViewerCreatorColumnNotModifiable) element2;
element.getTableColumn().addControlListener(controlListener);
}
}
use of org.eclipse.swt.events.ControlEvent in project tdi-studio-se by Talend.
the class MapperUI method addParentListeners.
private void addParentListeners(final UIManager uiManager, final ExternalMapperUiProperties uiProperties) {
mapperUIParent.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
release();
}
});
mapperUIParent.addListener(SWT.Close, new Listener() {
public void handleEvent(Event event) {
if (uiManager.getMapperResponse() == SWT.NONE) {
uiManager.setMapperResponse(SWT.CANCEL);
}
}
});
mapperUIParent.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent e) {
updateBackground(false, true);
}
public void focusLost(FocusEvent e) {
}
});
// store size if not maximized
if (mapperUIParent instanceof Shell) {
((Shell) mapperUIParent).addControlListener(new ControlListener() {
public void controlMoved(ControlEvent e) {
}
public void controlResized(ControlEvent e) {
if (!((Shell) e.getSource()).getMaximized()) {
uiProperties.setBoundsMapper(((Shell) e.getSource()).getBounds());
}
}
});
}
}
Aggregations