use of org.talend.designer.core.ui.views.properties.ComponentSettingsView in project tdi-studio-se by Talend.
the class ConnectionPart method setSelected.
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.editparts.AbstractEditPart#setSelected(int)
*/
@Override
public void setSelected(final int value) {
super.setSelected(value);
List cl = this.getChildren();
for (int i = 0; i < cl.size(); i++) {
if (((EditPart) cl.get(i)).getSelected() != value) {
((EditPart) cl.get(i)).setSelected(value);
}
}
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
if (value == SELECTED_PRIMARY) {
IViewPart view = page.findView(ComponentSettingsView.ID);
if (view != null) {
ComponentSettingsView compSettings = (ComponentSettingsView) view;
compSettings.setElement((Connection) getModel());
CodeView.refreshCodeView((Connection) getModel());
}
} else if (value == SELECTED_NONE) {
IViewPart view = page.findView(ComponentSettingsView.ID);
if (view != null) {
ComponentSettingsView compSettings = (ComponentSettingsView) view;
compSettings.cleanDisplay();
}
}
}
use of org.talend.designer.core.ui.views.properties.ComponentSettingsView in project tdi-studio-se by Talend.
the class AbstractElementPropertySectionController method fixedCursorPosition.
/**
* qzhang Comment method "fixedCursorPosition".
*
* @param param
* @param labelText
* @param value
* @param valueChanged
*/
protected void fixedCursorPosition(IElementParameter param, Control labelText, Object value, boolean valueChanged) {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPart workbenchPart = page.getActivePart();
if ((workbenchPart instanceof PropertySheet) || (workbenchPart instanceof JobSettingsView) || (workbenchPart instanceof ComponentSettingsView)) {
Object control = editionControlHelper.undoRedoHelper.typedTextCommandExecutor.getActiveControl();
if (param.getName().equals(control) && valueChanged && !param.isRepositoryValueUsed()) {
String previousText = editionControlHelper.undoRedoHelper.typedTextCommandExecutor.getPreviousText2();
String currentText = String.valueOf(value);
labelText.setFocus();
ControlUtils.setCursorPosition(labelText, getcursorPosition(previousText, currentText));
}
}
}
use of org.talend.designer.core.ui.views.properties.ComponentSettingsView in project tdi-studio-se by Talend.
the class DesignerCoreService method refreshComponentView.
@Override
public void refreshComponentView() {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart view = page.findView(ComponentSettingsView.ID);
if (view == null) {
// don't do anything. before it made the view appear for nothing even in other product like DQ.
return;
}
if (view != null && view instanceof ComponentSettingsView) {
ComponentSettingsView settingView = (ComponentSettingsView) view;
Element element = settingView.getElement();
if (element != null) {
settingView.cleanDisplay();
settingView.setElement(element);
}
}
List<ComponentSettingsView> otherViews = JobTemplateViewsAndProcessUtil.getInstance().getAllViews();
if (otherViews == null || otherViews.isEmpty()) {
return;
}
for (ComponentSettingsView v : otherViews) {
if (v.getParent() != null && !v.getParent().isDisposed()) {
Element elem = v.getElement();
if (elem != null) {
v.cleanDisplay();
v.setElement(elem);
}
}
}
}
use of org.talend.designer.core.ui.views.properties.ComponentSettingsView in project tdi-studio-se by Talend.
the class NodeLabelEditPart method propertyChange.
/*
* (non-Javadoc)
*
* @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
*/
public void propertyChange(final PropertyChangeEvent evt) {
String request = evt.getPropertyName();
if (request.equals(NodeLabel.OFFSET_CHANGE)) {
//$NON-NLS-1$ //$NON-NLS-2$
refreshVisuals();
getParent().refresh();
}
if (request.equals(NodeLabel.TEXT_CHANGE)) {
refreshVisuals();
// set the new size to update the node container
((NodeLabel) getModel()).setLabelSize(((SimpleHtmlFigure) figure).getPreferredSize());
NodeLabel label = (NodeLabel) getModel();
if (GlobalServiceRegister.getDefault().isServiceRegistered(ISQLBuilderService.class)) {
ISQLBuilderService service = (ISQLBuilderService) GlobalServiceRegister.getDefault().getService(ISQLBuilderService.class);
service.updateSqlBuilderDialogTitle(label.getLabelText(), label.getNode().getProcess().getName(), label.getNode().getUniqueName());
}
getParent().refresh();
// refresh the title of component setting view.
ComponentSettingsView viewer = (ComponentSettingsView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(ComponentSettingsView.ID);
if (viewer != null) {
viewer.updatePropertiesViewerTitle();
}
}
if (request.equals(NodeLabel.LOCATION)) {
//$NON-NLS-1$
refreshVisuals();
getParent().refresh();
}
if (request.equals(EParameterName.ACTIVATE.getName())) {
if (((NodeLabel) getModel()).isActivate()) {
((SimpleHtmlFigure) figure).setAlpha(-1);
((SimpleHtmlFigure) figure).repaint();
refreshVisuals();
} else {
((SimpleHtmlFigure) figure).setAlpha(Node.ALPHA_VALUE);
((SimpleHtmlFigure) figure).repaint();
refreshVisuals();
}
}
EditPart editPart = getParent();
if (editPart != null) {
while ((!(editPart instanceof ProcessPart)) && (!(editPart instanceof SubjobContainerPart))) {
editPart = editPart.getParent();
}
if (editPart instanceof SubjobContainerPart) {
editPart.refresh();
}
}
}
use of org.talend.designer.core.ui.views.properties.ComponentSettingsView in project tdi-studio-se by Talend.
the class ShowBreakpointAction method run.
public void run() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
ComponentSettingsView view;
try {
view = (ComponentSettingsView) page.showView(ComponentSettingsView.ID);
view.setElement(connection);
view.selectTab(EComponentCategory.BREAKPOINT);
} catch (PartInitException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Aggregations