use of org.eclipse.swt.custom.SashForm in project tesb-studio-se by Talend.
the class CamelDependenciesEditor method createPartControl.
@Override
public void createPartControl(Composite parent) {
FormToolkit toolkit = new FormToolkit(parent.getDisplay());
parent.setLayout(new GridLayout());
//create search group, hide button and refresh button
Composite toolsPanel = toolkit.createComposite(parent);
toolsPanel.setLayout(new GridLayout(4, false));
toolsPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
toolsPanel.setBackgroundMode(SWT.INHERIT_FORCE);
toolkit.createLabel(toolsPanel, Messages.RouterDependenciesEditor_filterLabel);
SearchControl searchComposite = new SearchControl(toolsPanel, SWT.NONE);
searchComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
searchComposite.setActiveImage(CamelDesignerPlugin.getImage(CamelDesignerPlugin.HIGHLIGHT_REM_ICON));
searchComposite.setDeactiveImage(CamelDesignerPlugin.getImage(CamelDesignerPlugin.GRAY_REM_ICON));
Text filterText = searchComposite.getText();
Button hideBuiltIn = toolkit.createButton(toolsPanel, Messages.RouterDependenciesEditor_hideBuiltInItems, SWT.CHECK);
Button refreshBtn = toolkit.createButton(toolsPanel, null, SWT.PUSH);
refreshBtn.setImage(CamelDesignerPlugin.getImage(CamelDesignerPlugin.REFRESH_ICON));
refreshBtn.setToolTipText(Messages.RouterDependenciesEditor_refreshDependenciesTooltip);
refreshBtn.setEnabled(!isReadOnly());
// create data tables
ScrolledComposite top = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
top.setLayoutData(new GridData(GridData.FILL_BOTH));
SashForm mainForm = new SashForm(top, SWT.VERTICAL);
manageRouteResourcePanel = createResourceTableViewer(mainForm, toolkit, Messages.CamelDependenciesEditor_Resources);
SashForm topPart = new SashForm(mainForm, SWT.HORIZONTAL);
importPackageViewer = createTableViewer(topPart, toolkit, Messages.RouterDependenciesEditor_importPackageSec, ManifestItem.IMPORT_PACKAGE);
bundleClasspathViewer = createTableViewer(topPart, toolkit, Messages.RouterDependenciesEditor_classpathSec, ManifestItem.BUNDLE_CLASSPATH);
SashForm centerPart = new SashForm(mainForm, SWT.HORIZONTAL);
exportPackageViewer = createTableViewer(centerPart, toolkit, Messages.RouterDependenciesEditor_exportPackage, ManifestItem.EXPORT_PACKAGE);
requireBundleViewer = createTableViewer(centerPart, toolkit, Messages.RouterDependenciesEditor_requireBundleSec, ManifestItem.REQUIRE_BUNDLE);
top.setExpandHorizontal(true);
top.setExpandVertical(true);
top.setContent(mainForm);
top.setMinSize(mainForm.computeSize(SWT.DEFAULT, SWT.DEFAULT));
//create status
Composite statusComposite = toolkit.createComposite(parent);
statusComposite.setLayout(new GridLayout(2, false));
statusComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
statusLabel = toolkit.createLabel(statusComposite, null);
statusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// if (isReadOnly()) {
// statusLabel.setText(Messages.RouterDependenciesEditor_itemIsLockedByOther);
// }
Label shortCuts = toolkit.createLabel(statusComposite, Messages.RouterDependenciesEditor_KeyBindingw, SWT.SHADOW_OUT);
shortCuts.setEnabled(false);
// add filter listener
filterText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
final String filterString = ((Text) e.widget).getText().trim();
importPackageViewer.setFilterString(filterString);
requireBundleViewer.setFilterString(filterString);
bundleClasspathViewer.setFilterString(filterString);
exportPackageViewer.setFilterString(filterString);
manageRouteResourcePanel.setFilterString(filterString);
}
});
// add hide listener
hideBuiltIn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
final boolean show = ((Button) e.widget).getSelection();
importPackageViewer.setShowBuiltIn(!show);
requireBundleViewer.setShowBuiltIn(!show);
bundleClasspathViewer.setShowBuiltIn(!show);
exportPackageViewer.setShowBuiltIn(!show);
manageRouteResourcePanel.setShowBuiltIn(!show);
}
});
refreshBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
// setDirty(false);
updateInput();
}
});
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class TabFolderEditors method createComponents.
/**
* DOC amaumont Comment method "createComponents".
*/
private void createComponents() {
setSimple(false);
// TableEditorCompositeBase metaDatasDescriptorView3 = new TableEditorCompositeBase(tabFolder1);
// item.setControl(metaDatasDescriptorView3);
CTabItem item = new CTabItem(tabFolderEditors, SWT.BORDER);
//$NON-NLS-1$
item.setText(Messages.getString("TabFolderEditors.SchemaEditor.Title"));
SashForm inOutMetaEditorContainer = new SashForm(tabFolderEditors, SWT.SMOOTH | SWT.HORIZONTAL | SWT.SHADOW_OUT);
inOutMetaEditorContainer.setLayout(new RowLayout(SWT.HORIZONTAL));
item.setControl(inOutMetaEditorContainer);
// input metadata table view
inputMetaEditor = new XmlMapMetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
inputMetaEditor.initGraphicComponents();
// inputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
ILineSelectionListener metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
if (inputMetaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
if (inputMetaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
mapperManage.selectLinkedInputTableEntries(inputMetaEditor.getTableViewerCreator().getTable().getSelectionIndices(), false);
}
}
}
};
inputMetaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
addListenersToInputButtons();
// output metadata table view
outputMetaEditor = new XmlMapMetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
outputMetaEditor.initGraphicComponents();
// outputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
if (outputMetaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
if (outputMetaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
mapperManage.selectLinkedOutputTableEntries(outputMetaEditor.getTableViewerCreator().getTable().getSelectionIndices(), false);
}
}
}
};
outputMetaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
addListenersToOutputButtons();
item = new CTabItem(tabFolderEditors, SWT.BORDER);
//$NON-NLS-1$
item.setText(Messages.getString("TabFolderEditors.TreeSchemaEditor.Title"));
SashForm xmlTreeEditorContainer = new SashForm(tabFolderEditors, SWT.SMOOTH | SWT.HORIZONTAL | SWT.SHADOW_OUT);
xmlTreeEditorContainer.setLayout(new RowLayout(SWT.HORIZONTAL));
item.setControl(xmlTreeEditorContainer);
// input tree schema table view
inputTreeSchemaEditor = new XmlTreeSchemaTableView(xmlTreeEditorContainer, SWT.BORDER);
inputTreeSchemaEditor.initGraphicComponents();
metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
if (inputTreeSchemaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
if (inputTreeSchemaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
mapperManage.selectLinkedInputTableEntries(inputTreeSchemaEditor.getTableViewerCreator().getTable().getSelectionIndices(), true);
}
}
}
};
inputTreeSchemaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
// output tree schema table view
outputTreeSchemaEditor = new OutputXmlTreeSchemaTableView(xmlTreeEditorContainer, SWT.BORDER);
outputTreeSchemaEditor.initGraphicComponents();
metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
if (outputTreeSchemaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
if (outputTreeSchemaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
mapperManage.selectLinkedOutputTableEntries(outputTreeSchemaEditor.getTableViewerCreator().getTable().getSelectionIndices(), true);
}
}
}
};
outputTreeSchemaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
item = new CTabItem(tabFolderEditors, SWT.BORDER);
//$NON-NLS-1$
item.setText(Messages.getString("TabFolderEditors.ExpressionEditor.Title"));
StyledText styledText = createStyledText(item);
this.styledTextHandler = new StyledTextHandler(styledText, mapperManage);
tabFolderEditors.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
mapperManage.fireCurrentDirectEditApply();
// TDI-18185
if (styledTextHandler.getSelectedNode() != null && XmlMapUtil.DOCUMENT.equals(styledTextHandler.getSelectedNode().getType())) {
styledTextHandler.setTextWithoutNotifyListeners("");
styledTextHandler.getStyledText().setEnabled(false);
styledTextHandler.getStyledText().setEditable(false);
styledTextHandler.getStyledText().setText("");
}
lastSelectedTab = tabFolderEditors.getSelectionIndex();
}
});
tabFolderEditors.setSelection(0);
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class ExpressionBuilderDialog method createDialogArea.
/**
* Create contents of the dialog
*
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
container = (Composite) super.createDialogArea(parent);
final GridLayout gridLayout = new GridLayout();
gridLayout.makeColumnsEqualWidth = true;
container.setLayout(gridLayout);
final SashForm sashForm = new SashForm(container, SWT.NONE);
sashForm.setOrientation(SWT.VERTICAL);
final Composite upperComposite = new Composite(sashForm, SWT.NONE);
upperComposite.setLayout(new FillLayout());
final SashForm upperSashform = new SashForm(upperComposite, SWT.NONE);
expressionComposite = new ExpressionComposite(this, upperSashform, SWT.NONE, dataBean);
expressionComposite.setExpression(defaultExpression, true);
testComposite = new TestComposite(upperSashform, SWT.NONE);
testComposite.addVariables(defaultVariables);
upperSashform.setWeights(new int[] { 3, 2 });
final Composite lowerComposite = new Composite(sashForm, SWT.NONE);
lowerComposite.setLayout(new FillLayout());
categoryComposite = new CategoryComposite(lowerComposite, SWT.NONE, manager);
final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
sashForm.setLayoutData(gridData);
sashForm.setWeights(new int[] { 3, 2 });
return container;
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class FOXUI method createContent.
/**
* Comment method "createContent".
*
* @param child
*/
private void createContent(Composite mainComposite) {
header = new HeaderComposite(mainComposite, SWT.NONE);
if (this.foxManager.isNoLoopInComponent()) {
//$NON-NLS-1$
header.updateStatus(Messages.getString("FOXUI.NoLoop"));
}
// Splitter
xmlToSchemaSash = new SashForm(mainComposite, SWT.HORIZONTAL | SWT.SMOOTH);
xmlToSchemaSash.setLayoutData(new GridData(GridData.FILL_BOTH));
xmlToSchemaSash.setBackgroundMode(SWT.INHERIT_FORCE);
canModify = externalNode.getProcess().isReadOnly();
if (externalNode.getOriginalNode().getJobletNode() != null) {
canModify = externalNode.getOriginalNode().isReadOnly();
}
IElementParameter elem = externalNode.getElementParameter("PROPERTY_TYPE");
if (elem != null) {
String value = (String) elem.getValue();
if (value != null && value.equals("REPOSITORY")) {
isRepository = true;
}
}
addSchemaViewer(xmlToSchemaSash, 300, 110);
addXMLViewer(xmlToSchemaSash, 400, 110);
xmlToSchemaSash.setWeights(new int[] { 40, 60 });
linker = new Schema2XMLLinker(this.xmlToSchemaSash);
linker.init(schemaViewer.getTable(), xmlViewer);
linker.setManager(foxManager);
initSchemaTable();
footerComp = new FooterComposite(mainComposite, SWT.NONE, foxManager);
xmlViewer.expandToLevel(3);
linker.createLinks();
}
use of org.eclipse.swt.custom.SashForm in project tdi-studio-se by Talend.
the class TabFolderEditors method createComponents.
/**
* DOC amaumont Comment method "createComponents".
*/
private void createComponents() {
setSimple(false);
// TableEditorCompositeBase metaDatasDescriptorView3 = new TableEditorCompositeBase(tabFolder1);
// item.setControl(metaDatasDescriptorView3);
CTabItem item = new CTabItem(tabFolderEditors, SWT.BORDER);
//$NON-NLS-1$
item.setText(Messages.getString("TabFolderEditors.schemaEditor"));
SashForm inOutMetaEditorContainer = new SashForm(tabFolderEditors, SWT.SMOOTH | SWT.HORIZONTAL | SWT.SHADOW_OUT);
inOutMetaEditorContainer.setLayout(new RowLayout(SWT.HORIZONTAL));
item.setControl(inOutMetaEditorContainer);
CommandStack commandStack = mapperManager.getCommandStack();
inputMetaEditor = new MetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
inputMetaEditor.setMetadataTalendTypeFilter(NodeUtil.createMetadataTalendTypeFilter(mapperManager.getAbstractMapComponent()));
inputMetaEditor.initGraphicComponents();
inputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
addListenersToInputButtons();
outputMetaEditor = new MetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
outputMetaEditor.setMetadataTalendTypeFilter(NodeUtil.createMetadataTalendTypeFilter(mapperManager.getAbstractMapComponent()));
outputMetaEditor.initGraphicComponents();
outputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
addListenersToOutputButtons();
item = new CTabItem(tabFolderEditors, SWT.BORDER);
//$NON-NLS-1$
item.setText(Messages.getString("TabFolderEditors.expressionEditor"));
StyledText styledText = createStyledText(item);
this.styledTextHandler = new StyledTextHandler(styledText, mapperManager);
tabFolderEditors.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
lastSelectedTab = tabFolderEditors.getSelectionIndex();
}
});
tabFolderEditors.setSelection(0);
}
Aggregations