Compare commits
11 Commits
feature/TB
...
feature/TB
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
765dcf69bb | ||
|
|
daa6260119 | ||
|
|
e3552ba1b2 | ||
|
|
7cc2d111b9 | ||
|
|
e12595d2ab | ||
|
|
85b9b052ee | ||
|
|
c1f772fc31 | ||
|
|
a694fd9cd8 | ||
|
|
dd51e2a854 | ||
|
|
b140f713e1 | ||
|
|
c2a1fb7dff |
@@ -142,8 +142,14 @@ public abstract class AbstractDataTableEditorView<B> {
|
||||
* @param mainCompositeStyle
|
||||
*/
|
||||
public AbstractDataTableEditorView(Composite parentComposite, int mainCompositeStyle, boolean initGraphicsComponents) {
|
||||
this(parentComposite, mainCompositeStyle, initGraphicsComponents, true);
|
||||
}
|
||||
|
||||
public AbstractDataTableEditorView(Composite parentComposite, int mainCompositeStyle, boolean initGraphicsComponents,
|
||||
boolean toolbarVisable) {
|
||||
this.parentComposite = parentComposite;
|
||||
this.mainCompositeStyle = mainCompositeStyle;
|
||||
this.toolbarVisible = toolbarVisable;
|
||||
if (initGraphicsComponents) {
|
||||
initGraphicComponents();
|
||||
}
|
||||
|
||||
@@ -1132,6 +1132,10 @@ public class RepositoryToComponentProperty {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Map<String, Object> line = new HashMap<String, Object>();
|
||||
line.put("JAR_NAME", jar);
|
||||
value2.add(line);
|
||||
}
|
||||
}
|
||||
if (deployed) {
|
||||
|
||||
@@ -15,6 +15,7 @@ package org.talend.core.model.process;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
@@ -94,9 +95,7 @@ public interface IProcess2 extends IRepositoryObject, IProcess {
|
||||
|
||||
public IUpdateManager getUpdateManager();
|
||||
|
||||
public byte[] getScreenshot();
|
||||
|
||||
public void setScreenshot(byte[] image);
|
||||
public Map<String, byte[]> getScreenshots();
|
||||
|
||||
public void dispose();
|
||||
|
||||
@@ -123,6 +122,8 @@ public interface IProcess2 extends IRepositoryObject, IProcess {
|
||||
|
||||
public void setLastRunContext(IContext context);
|
||||
|
||||
public Map<Object, Object> getAdditionalProperties();
|
||||
|
||||
boolean isSubjobEnabled();
|
||||
|
||||
void removeProblems4ProcessDeleted();
|
||||
|
||||
@@ -25,7 +25,8 @@ Require-Bundle: org.apache.commons.lang,
|
||||
org.eclipse.nebula.widgets.nattable.core,
|
||||
org.eclipse.nebula.widgets.nattable.extension.glazedlists,
|
||||
org.talend.libraries.nattable,
|
||||
org.eclipse.e4.core.di.extensions
|
||||
org.eclipse.e4.core.di.extensions,
|
||||
org.talend.librariesmanager
|
||||
Import-Package: org.eclipse.jdt.internal.ui.workingsets
|
||||
Export-Package: org.talend.core.ui,
|
||||
org.talend.core.ui.actions,
|
||||
|
||||
@@ -382,6 +382,10 @@ ModuleListCellEditor.externalLabel=External modules
|
||||
ModuleListCellEditor.innerLabel=Inner modules
|
||||
ModuleListCellEditor.selectLabel=Select module
|
||||
ModuleListCellEditor.title=Select Module
|
||||
ModuleListCellEditor.add=Add
|
||||
ModuleListCellEditor.delete=Delete
|
||||
ModuleListCellEditor.warningTitle=Select database driver jars
|
||||
ModuleListCellEditor.warningMessage=The jar have existed.
|
||||
MultiStringSelectionDialog.nameEmpty=Name can not be empty
|
||||
PromptDialog.stringTip=The input text must be surrounded with single quote.
|
||||
ApplicationActionBarAdvisor.menuFileLabel=&File
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.Project;
|
||||
import org.talend.core.ui.context.IContextModelManager;
|
||||
import org.talend.core.ui.context.model.table.ContextTableConstants;
|
||||
import org.talend.core.ui.context.model.table.ContextTableTabChildModel;
|
||||
import org.talend.core.ui.context.model.table.ContextTableTabParentModel;
|
||||
import org.talend.core.ui.i18n.Messages;
|
||||
@@ -55,9 +54,7 @@ public class ContextNatTableUtils {
|
||||
IContextParameter para = null;
|
||||
IContext context = null;
|
||||
if (manager != null) {
|
||||
if (!(property.equals(ContextTableConstants.COLUMN_NAME_PROPERTY))) {
|
||||
context = manager.getContext(property);
|
||||
}
|
||||
context = manager.getContext(property);
|
||||
if (context == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -289,9 +289,7 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
IContextParameter para = null;
|
||||
IContext context = null;
|
||||
if (manager != null) {
|
||||
if (!(property.equals(ContextTableConstants.COLUMN_NAME_PROPERTY))) {
|
||||
context = manager.getContext(property);
|
||||
}
|
||||
context = manager.getContext(property);
|
||||
if (context == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -12,54 +12,25 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.metadata.celleditor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.viewers.ArrayContentProvider;
|
||||
import org.eclipse.jface.viewers.DialogCellEditor;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.ListViewer;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.AbstractDataTableEditorView;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
import org.talend.commons.ui.swt.formtools.LabelledFileField;
|
||||
import org.talend.commons.ui.swt.tableviewer.TableViewerCreator;
|
||||
import org.talend.commons.utils.io.FilesUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.general.ILibrariesService;
|
||||
import org.talend.core.model.process.IElement;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.process.IProcess2;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
import org.talend.core.ui.i18n.Messages;
|
||||
import org.talend.core.ui.process.IGEFProcess;
|
||||
import org.talend.core.ui.services.IDesignerCoreUIService;
|
||||
|
||||
@@ -126,7 +97,7 @@ public class ModuleListCellEditor extends DialogCellEditor {
|
||||
@Override
|
||||
protected Object openDialogBox(Control cellEditorWindow) {
|
||||
String value = (String) getValue();
|
||||
ModuleListDialog dialog = new ModuleListDialog(cellEditorWindow.getShell(), value);
|
||||
ModuleListDialog dialog = new ModuleListDialog(cellEditorWindow.getShell(), value, this.param, false);
|
||||
if (dialog.open() == Window.OK) {
|
||||
String selecteModule = dialog.getSelecteModule();
|
||||
if (selecteModule != null && (value == null || !value.equals(selecteModule))) {
|
||||
@@ -199,198 +170,4 @@ public class ModuleListCellEditor extends DialogCellEditor {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* ggu ModuleListDialog class global comment. Detailled comment
|
||||
*/
|
||||
class ModuleListDialog extends Dialog {
|
||||
|
||||
private String selecteModule;
|
||||
|
||||
private Button innerBtn, extBtn;
|
||||
|
||||
private ListViewer jarsViewer;
|
||||
|
||||
private LabelledFileField selectField;
|
||||
|
||||
private boolean isInner;
|
||||
|
||||
protected ModuleListDialog(Shell parentShell, String selecteModule) {
|
||||
super(parentShell);
|
||||
this.selecteModule = selecteModule;
|
||||
this.setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configureShell(Shell newShell) {
|
||||
super.configureShell(newShell);
|
||||
newShell.setText(Messages.getString("ModuleListCellEditor.title")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.Dialog#create()
|
||||
*/
|
||||
@Override
|
||||
public void create() {
|
||||
super.create();
|
||||
checkField(true); // init
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite composite = (Composite) super.createDialogArea(parent);
|
||||
|
||||
Group group = new Group(composite, SWT.NONE);
|
||||
group.setLayout(new GridLayout(2, false));
|
||||
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
innerBtn = new Button(group, SWT.RADIO);
|
||||
innerBtn.setText(Messages.getString("ModuleListCellEditor.innerLabel")); //$NON-NLS-1$
|
||||
extBtn = new Button(group, SWT.RADIO);
|
||||
extBtn.setText(Messages.getString("ModuleListCellEditor.externalLabel")); //$NON-NLS-1$
|
||||
|
||||
Composite comp = new Composite(composite, SWT.NONE);
|
||||
comp.setLayout(new GridLayout());
|
||||
GridData layoutData = new GridData(GridData.FILL_BOTH);
|
||||
layoutData.minimumHeight = 150;
|
||||
layoutData.minimumWidth = 450;
|
||||
layoutData.heightHint = 150;
|
||||
layoutData.widthHint = 450;
|
||||
comp.setLayoutData(layoutData);
|
||||
|
||||
//
|
||||
jarsViewer = new ListViewer(comp, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
|
||||
jarsViewer.setContentProvider(new ArrayContentProvider());
|
||||
jarsViewer.setLabelProvider(new LabelProvider() {
|
||||
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
String text = getText(element);
|
||||
if (text != null && !text.equals(selecteModule)) {
|
||||
return ImageProvider.getImage(EImage.LOCK_ICON);
|
||||
}
|
||||
return super.getImage(element);
|
||||
}
|
||||
|
||||
});
|
||||
jarsViewer.setInput(param.getListItemsDisplayName());
|
||||
jarsViewer.getList().setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
|
||||
Composite c = new Composite(comp, SWT.NONE);
|
||||
c.setLayout(new GridLayout(3, false));
|
||||
c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
selectField = new LabelledFileField(c,
|
||||
Messages.getString("ModuleListCellEditor.selectLabel"), FilesUtils.getAcceptJARFilesSuffix()); //$NON-NLS-1$
|
||||
|
||||
addListeners();
|
||||
// checkField(true); // init
|
||||
jarsViewer.getList().setSelection(new String[] { selecteModule });
|
||||
return composite;
|
||||
}
|
||||
|
||||
private void addListeners() {
|
||||
innerBtn.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
checkField(true);
|
||||
}
|
||||
|
||||
});
|
||||
extBtn.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
checkField(false);
|
||||
}
|
||||
|
||||
});
|
||||
jarsViewer.addSelectionChangedListener(new ISelectionChangedListener() {
|
||||
|
||||
@Override
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
if (jarsViewer.getList().getSelection().length <= 0) {
|
||||
getOKButton().setEnabled(false);
|
||||
} else {
|
||||
getOKButton().setEnabled(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
selectField.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
if (selectField.getText().trim().length()<=0) {
|
||||
getOKButton().setEnabled(false);
|
||||
} else {
|
||||
getOKButton().setEnabled(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void checkField(boolean inner) {
|
||||
innerBtn.setSelection(inner);
|
||||
extBtn.setSelection(!inner);
|
||||
jarsViewer.getList().setVisible(inner);
|
||||
((GridData) jarsViewer.getList().getLayoutData()).exclude = !inner;
|
||||
selectField.getTextControl().getParent().setVisible(!inner);
|
||||
((GridData) selectField.getTextControl().getParent().getLayoutData()).exclude = inner;
|
||||
jarsViewer.getList().getParent().layout();
|
||||
boolean canFinish = true;
|
||||
if (innerBtn.getSelection()) {
|
||||
if (jarsViewer.getList().getSelection().length <= 0) {
|
||||
canFinish = false;
|
||||
}
|
||||
|
||||
} else {
|
||||
String fileName = selectField.getText().trim();
|
||||
if (fileName.length() <= 0) {
|
||||
canFinish = false;
|
||||
}
|
||||
}
|
||||
if (getOKButton() != null) {
|
||||
getOKButton().setEnabled(canFinish);
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelecteModule() {
|
||||
return this.selecteModule;
|
||||
}
|
||||
|
||||
public boolean isInner() {
|
||||
return isInner;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void okPressed() {
|
||||
isInner = innerBtn.getSelection();
|
||||
if (isInner) {
|
||||
if (jarsViewer.getList().getSelection().length > 0) {
|
||||
selecteModule = jarsViewer.getList().getSelection()[0];
|
||||
}
|
||||
} else {
|
||||
IPath path = Path.fromOSString(selectField.getText());
|
||||
File source = path.toFile();
|
||||
if (!source.exists()) {
|
||||
MessageDialog.openWarning(getParentShell(), "File Not Found", path
|
||||
+ " is not Found,Please make sure the file is exist!");
|
||||
return;
|
||||
}
|
||||
String lastSegment = path.lastSegment();
|
||||
try {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibrariesService.class)) {
|
||||
ILibrariesService service = (ILibrariesService) GlobalServiceRegister.getDefault().getService(
|
||||
ILibrariesService.class);
|
||||
service.deployLibrary(path.toFile().toURI().toURL());
|
||||
}
|
||||
} catch (IOException ee) {
|
||||
ExceptionHandler.process(ee);
|
||||
}
|
||||
selecteModule = lastSegment;
|
||||
}
|
||||
super.okPressed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,387 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.metadata.celleditor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.viewers.ArrayContentProvider;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.ListViewer;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.FileDialog;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.formtools.LabelledFileField;
|
||||
import org.talend.commons.utils.io.FilesUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.general.ILibrariesService;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.ui.i18n.Messages;
|
||||
import org.talend.librariesmanager.model.ModulesNeededProvider;
|
||||
|
||||
/**
|
||||
* created by hwang on Dec 24, 2014 Detailled comment copied from ModuleListCellEditor/ModuleListDialog
|
||||
*/
|
||||
public class ModuleListDialog extends Dialog {
|
||||
|
||||
private String selecteModule;
|
||||
|
||||
private Button innerBtn, extBtn, addBtn, delBtn;;
|
||||
|
||||
private ListViewer jarsViewer;
|
||||
|
||||
private LabelledFileField selectField;
|
||||
|
||||
private boolean isInner;
|
||||
|
||||
private boolean isJDBCCreate = false;
|
||||
|
||||
private IElementParameter param;
|
||||
|
||||
private String[] selecteModuleArray = null;
|
||||
|
||||
private String[] moduleNameArray = null;
|
||||
|
||||
private List<String> jarsList = new ArrayList<String>();
|
||||
|
||||
public ModuleListDialog(Shell parentShell, String selecteModule, IElementParameter param, boolean isJDBCCreate) {
|
||||
super(parentShell);
|
||||
this.selecteModule = selecteModule;
|
||||
this.param = param;
|
||||
this.isJDBCCreate = isJDBCCreate;
|
||||
this.setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||
initModuleArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configureShell(Shell newShell) {
|
||||
super.configureShell(newShell);
|
||||
newShell.setText(Messages.getString("ModuleListCellEditor.title")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.Dialog#create()
|
||||
*/
|
||||
@Override
|
||||
public void create() {
|
||||
super.create();
|
||||
checkField(true); // init
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite composite = (Composite) super.createDialogArea(parent);
|
||||
|
||||
Group group = new Group(composite, SWT.NONE);
|
||||
group.setLayout(new GridLayout(2, false));
|
||||
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
innerBtn = new Button(group, SWT.RADIO);
|
||||
innerBtn.setText(Messages.getString("ModuleListCellEditor.innerLabel")); //$NON-NLS-1$
|
||||
extBtn = new Button(group, SWT.RADIO);
|
||||
extBtn.setText(Messages.getString("ModuleListCellEditor.externalLabel")); //$NON-NLS-1$
|
||||
|
||||
Composite comp = new Composite(composite, SWT.NONE);
|
||||
comp.setLayout(new GridLayout());
|
||||
GridData layoutData = new GridData(GridData.FILL_BOTH);
|
||||
layoutData.minimumHeight = 150;
|
||||
layoutData.minimumWidth = 450;
|
||||
layoutData.heightHint = 150;
|
||||
layoutData.widthHint = 450;
|
||||
comp.setLayoutData(layoutData);
|
||||
|
||||
int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL;
|
||||
if (isJDBCCreate) {
|
||||
style = SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL;
|
||||
}
|
||||
jarsViewer = new ListViewer(comp, style);
|
||||
jarsViewer.setContentProvider(new ArrayContentProvider());
|
||||
jarsViewer.setLabelProvider(new LabelProvider() {
|
||||
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
String text = getText(element);
|
||||
if (text != null && !text.equals(selecteModule)) {
|
||||
return ImageProvider.getImage(EImage.LOCK_ICON);
|
||||
}
|
||||
return super.getImage(element);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jarsViewer.getList().setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
|
||||
Composite buttnComp = new Composite(comp, SWT.NONE);
|
||||
buttnComp.setLayout(new GridLayout(2, false));
|
||||
addBtn = new Button(buttnComp, SWT.PUSH);
|
||||
addBtn.setText(Messages.getString("ModuleListCellEditor.add")); //$NON-NLS-1$
|
||||
delBtn = new Button(buttnComp, SWT.PUSH);
|
||||
delBtn.setText(Messages.getString("ModuleListCellEditor.delete")); //$NON-NLS-1$
|
||||
|
||||
Composite c = new Composite(comp, SWT.NONE);
|
||||
c.setLayout(new GridLayout(3, false));
|
||||
c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
selectField = new LabelledFileField(c,
|
||||
Messages.getString("ModuleListCellEditor.selectLabel"), FilesUtils.getAcceptJARFilesSuffix()); //$NON-NLS-1$
|
||||
|
||||
addListeners();
|
||||
// checkField(true); // init
|
||||
jarsViewer.getList().setSelection(new String[] { selecteModule });
|
||||
return composite;
|
||||
}
|
||||
|
||||
private void addListeners() {
|
||||
innerBtn.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
checkField(true);
|
||||
}
|
||||
|
||||
});
|
||||
extBtn.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
checkField(false);
|
||||
}
|
||||
|
||||
});
|
||||
jarsViewer.addSelectionChangedListener(new ISelectionChangedListener() {
|
||||
|
||||
@Override
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
if (jarsViewer.getList().getSelection().length <= 0) {
|
||||
getOKButton().setEnabled(false);
|
||||
} else {
|
||||
getOKButton().setEnabled(true);
|
||||
}
|
||||
selecteModuleArray = jarsViewer.getList().getSelection();
|
||||
}
|
||||
});
|
||||
selectField.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
if (selectField.getText().trim().length() <= 0) {
|
||||
getOKButton().setEnabled(false);
|
||||
} else {
|
||||
getOKButton().setEnabled(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
addBtn.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
FileDialog dialog = new FileDialog(getShell());
|
||||
dialog.setFilterExtensions(new String[] { "*.jar", "*.zip", "*.*", "*" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
String userDir = System.getProperty("user.dir"); //$NON-NLS-1$
|
||||
String pathSeparator = System.getProperty("file.separator"); //$NON-NLS-1$
|
||||
dialog.setFilterPath(userDir + pathSeparator + "lib" + pathSeparator + "java"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
String path = dialog.open();
|
||||
if (path == null) {
|
||||
return;
|
||||
}
|
||||
if (!jarsList.contains(path)) {
|
||||
jarsList.add(path);
|
||||
jarsViewer.setInput(jarsList);
|
||||
} else {
|
||||
MessageDialog.openWarning(
|
||||
getShell(),
|
||||
Messages.getString("ModuleListCellEditor.warningTitle"), Messages.getString("ModuleListCellEditor.warningMessage")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
if (jarsList.size() > 0) {
|
||||
getOKButton().setEnabled(true);
|
||||
} else {
|
||||
getOKButton().setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
delBtn.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
for (Object o : ((StructuredSelection) jarsViewer.getSelection()).toList()) {
|
||||
jarsList.remove(o);
|
||||
}
|
||||
jarsViewer.setInput(jarsList);
|
||||
|
||||
if (jarsList.size() > 0) {
|
||||
getOKButton().setEnabled(true);
|
||||
} else {
|
||||
getOKButton().setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void checkField(boolean inner) {
|
||||
innerBtn.setSelection(inner);
|
||||
extBtn.setSelection(!inner);
|
||||
jarsViewer.getList().setVisible(inner || isJDBCCreate);
|
||||
((GridData) jarsViewer.getList().getLayoutData()).exclude = !inner && !isJDBCCreate;
|
||||
selectField.getTextControl().getParent().setVisible(!inner && !isJDBCCreate);
|
||||
((GridData) selectField.getTextControl().getParent().getLayoutData()).exclude = inner || isJDBCCreate;
|
||||
addBtn.getParent().setVisible(!inner && isJDBCCreate);
|
||||
((GridData) addBtn.getParent().getLayoutData()).exclude = inner || !isJDBCCreate;
|
||||
jarsViewer.getList().getParent().layout();
|
||||
|
||||
jarsViewer.getList().removeAll();
|
||||
if (inner) {
|
||||
jarsViewer.setInput(this.moduleNameArray);
|
||||
if (selecteModuleArray != null) {
|
||||
jarsViewer.getList().setSelection(selecteModuleArray);
|
||||
} else if (selecteModule != null) {
|
||||
if (selecteModule.contains(";")) {
|
||||
String[] names = selecteModule.trim().split(";");
|
||||
jarsViewer.getList().setSelection(names);
|
||||
} else {
|
||||
jarsViewer.getList().setSelection(new String[] { selecteModule });
|
||||
}
|
||||
}
|
||||
} else {
|
||||
jarsViewer.setInput(jarsList);
|
||||
}
|
||||
|
||||
boolean canFinish = true;
|
||||
if (innerBtn.getSelection()) {
|
||||
if (jarsViewer.getList().getSelection().length <= 0) {
|
||||
canFinish = false;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (isJDBCCreate) {
|
||||
if (jarsList.size() <= 0) {
|
||||
canFinish = false;
|
||||
}
|
||||
} else {
|
||||
String fileName = selectField.getText().trim();
|
||||
if (fileName.length() <= 0) {
|
||||
canFinish = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (getOKButton() != null) {
|
||||
getOKButton().setEnabled(canFinish);
|
||||
}
|
||||
}
|
||||
|
||||
public String getSelecteModule() {
|
||||
return this.selecteModule;
|
||||
}
|
||||
|
||||
public boolean isInner() {
|
||||
return isInner;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void okPressed() {
|
||||
isInner = innerBtn.getSelection();
|
||||
if (isInner) {
|
||||
if (isJDBCCreate) {
|
||||
selecteModuleArray = jarsViewer.getList().getSelection();
|
||||
} else {
|
||||
selecteModuleArray = null;
|
||||
selecteModule = jarsViewer.getList().getSelection()[0];
|
||||
}
|
||||
} else {
|
||||
List<String> pathList = new ArrayList<String>();
|
||||
if (isJDBCCreate) {
|
||||
pathList.addAll(jarsList);
|
||||
} else {
|
||||
selecteModuleArray = null;
|
||||
pathList.add(selectField.getText());
|
||||
}
|
||||
String[] jarNames = new String[pathList.size()];
|
||||
for (int i = 0; i < pathList.size(); i++) {
|
||||
String jarPath = pathList.get(i);
|
||||
IPath path = Path.fromOSString(jarPath);
|
||||
File source = path.toFile();
|
||||
if (!source.exists()) {
|
||||
MessageDialog.openWarning(getParentShell(), "File Not Found", path
|
||||
+ " is not Found,Please make sure the file is exist!");
|
||||
return;
|
||||
}
|
||||
String lastSegment = path.lastSegment();
|
||||
try {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibrariesService.class)) {
|
||||
ILibrariesService service = (ILibrariesService) GlobalServiceRegister.getDefault().getService(
|
||||
ILibrariesService.class);
|
||||
service.deployLibrary(path.toFile().toURI().toURL());
|
||||
}
|
||||
} catch (IOException ee) {
|
||||
ExceptionHandler.process(ee);
|
||||
}
|
||||
selecteModule = lastSegment;
|
||||
jarNames[i] = lastSegment;
|
||||
}
|
||||
if (isJDBCCreate) {
|
||||
selecteModuleArray = jarNames;
|
||||
}
|
||||
}
|
||||
super.okPressed();
|
||||
}
|
||||
|
||||
private void initModuleArray() {
|
||||
if (param != null) {
|
||||
this.moduleNameArray = param.getListItemsDisplayName();
|
||||
return;
|
||||
}
|
||||
List<ModuleNeeded> moduleNeededList = ModulesNeededProvider.getModulesNeeded();
|
||||
Set<String> moduleNameList = new TreeSet<String>();
|
||||
for (ModuleNeeded module : moduleNeededList) {
|
||||
String moduleName = module.getModuleName();
|
||||
moduleNameList.add(moduleName);
|
||||
}
|
||||
this.moduleNameArray = moduleNameList.toArray(new String[0]);
|
||||
if (this.moduleNameArray == null) {
|
||||
this.moduleNameArray = new String[0];
|
||||
}
|
||||
}
|
||||
|
||||
public String[] getSelecteModuleArray() {
|
||||
return this.selecteModuleArray;
|
||||
}
|
||||
}
|
||||
@@ -159,6 +159,11 @@ public abstract class AbstractMetadataTableEditorView<B> extends AbstractDataTab
|
||||
super(parentComposite, mainCompositeStyle, initGraphicsComponents);
|
||||
}
|
||||
|
||||
public AbstractMetadataTableEditorView(Composite parentComposite, int mainCompositeStyle, boolean initGraphicsComponents,
|
||||
boolean toolbarVisable) {
|
||||
super(parentComposite, mainCompositeStyle, initGraphicsComponents, toolbarVisable);
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC amaumont AbstractMetadataTableEditorView constructor comment.
|
||||
*
|
||||
|
||||
@@ -29,7 +29,6 @@ import org.talend.core.model.metadata.builder.connection.impl.MetadataColumnImpl
|
||||
import org.talend.core.model.metadata.types.TypesManager;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.ui.proposal.JavaSimpleDateFormatProposalProvider;
|
||||
|
||||
import orgomg.cwm.objectmodel.core.TaggedValue;
|
||||
|
||||
/**
|
||||
@@ -65,6 +64,11 @@ public class MetadataEmfTableEditorView extends AbstractMetadataTableEditorView<
|
||||
super(parentComposite, mainCompositeStyle, initGraphicsComponents);
|
||||
}
|
||||
|
||||
public MetadataEmfTableEditorView(Composite parentComposite, int mainCompositeStyle, boolean initGraphicsComponents,
|
||||
boolean toolbarVisable) {
|
||||
super(parentComposite, mainCompositeStyle, initGraphicsComponents, toolbarVisable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Graphics components are automatically initialized.
|
||||
*
|
||||
|
||||
@@ -6,8 +6,7 @@ Bundle-Version: 6.0.0.qualifier
|
||||
Bundle-Activator: org.talend.core.CorePlugin
|
||||
Bundle-Localization: plugin
|
||||
Eclipse-LazyStart: true
|
||||
Require-Bundle: org.eclipse.update.core,
|
||||
org.eclipse.debug.core,
|
||||
Require-Bundle: org.eclipse.debug.core,
|
||||
org.eclipse.ui.workbench,
|
||||
org.eclipse.jdt.core,
|
||||
org.apache.commons.io,
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="CODEGENERATIONType">
|
||||
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
|
||||
<details key="name" value="CODEGENERATION_._type"/>
|
||||
<details key="name" value="CODEGENERATION_._type"></details>
|
||||
<details key="kind" value="elementOnly"/>
|
||||
</eAnnotations>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="tEMPLATES" upperBound="-1"
|
||||
@@ -882,6 +882,14 @@
|
||||
<details key="namespace" value="##targetNamespace"/>
|
||||
</eAnnotations>
|
||||
</eStructuralFeatures>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="eQUIVALENT" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
|
||||
defaultValueLiteral="false" unsettable="true">
|
||||
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
|
||||
<details key="kind" value="attribute"/>
|
||||
<details key="name" value="EQUIVALENT"/>
|
||||
<details key="namespace" value="##targetNamespace"/>
|
||||
</eAnnotations>
|
||||
</eStructuralFeatures>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="IMPORTSType">
|
||||
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
|
||||
|
||||
@@ -134,6 +134,7 @@
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Component.ecore#//HEADERType/tYPE"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Component.ecore#//HEADERType/vERSION"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Component.ecore#//HEADERType/vISIBLE"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Component.ecore#//HEADERType/eQUIVALENT"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="Component.ecore#//IMPORTSType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Component.ecore#//IMPORTSType/iMPORT"/>
|
||||
|
||||
@@ -187,6 +187,8 @@
|
||||
type="xsd:decimal" use="required" />
|
||||
<xsd:attribute default="true" ecore:name="vISIBLE" name="VISIBLE"
|
||||
type="xsd:boolean" />
|
||||
<xsd:attribute default="false" ecore:name="eQUIVALENT"
|
||||
name="EQUIVALENT" type="xsd:string" />
|
||||
<xsd:attribute ecore:name="tYPE" name="TYPE" type="xsd:string" />
|
||||
<xsd:attribute default="false" ecore:name="rEDUCE" name="REDUCE"
|
||||
type="xsd:boolean" />
|
||||
|
||||
@@ -1203,6 +1203,15 @@ public interface ComponentPackage extends EPackage {
|
||||
*/
|
||||
int HEADER_TYPE__VISIBLE = 31;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>EQUIVALENT</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int HEADER_TYPE__EQUIVALENT = 32;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>HEADER Type</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
@@ -1210,7 +1219,7 @@ public interface ComponentPackage extends EPackage {
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int HEADER_TYPE_FEATURE_COUNT = 32;
|
||||
int HEADER_TYPE_FEATURE_COUNT = 33;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.talend.designer.core.model.utils.emf.component.impl.IMPORTSTypeImpl <em>IMPORTS Type</em>}' class.
|
||||
@@ -3669,6 +3678,17 @@ public interface ComponentPackage extends EPackage {
|
||||
*/
|
||||
EAttribute getHEADERType_VISIBLE();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.talend.designer.core.model.utils.emf.component.HEADERType#getEQUIVALENT <em>EQUIVALENT</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>EQUIVALENT</em>'.
|
||||
* @see org.talend.designer.core.model.utils.emf.component.HEADERType#getEQUIVALENT()
|
||||
* @see #getHEADERType()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getHEADERType_EQUIVALENT();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.talend.designer.core.model.utils.emf.component.HEADERType#getTYPE <em>TYPE</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
@@ -5945,6 +5965,14 @@ public interface ComponentPackage extends EPackage {
|
||||
*/
|
||||
EAttribute HEADER_TYPE__VISIBLE = eINSTANCE.getHEADERType_VISIBLE();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>EQUIVALENT</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute HEADER_TYPE__EQUIVALENT = eINSTANCE.getHEADERType_EQUIVALENT();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>TYPE</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
|
||||
@@ -46,6 +46,7 @@ import org.eclipse.emf.ecore.EObject;
|
||||
* <li>{@link org.talend.designer.core.model.utils.emf.component.HEADERType#getTYPE <em>TYPE</em>}</li>
|
||||
* <li>{@link org.talend.designer.core.model.utils.emf.component.HEADERType#getVERSION <em>VERSION</em>}</li>
|
||||
* <li>{@link org.talend.designer.core.model.utils.emf.component.HEADERType#isVISIBLE <em>VISIBLE</em>}</li>
|
||||
* <li>{@link org.talend.designer.core.model.utils.emf.component.HEADERType#getEQUIVALENT <em>EQUIVALENT</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
@@ -1145,6 +1146,61 @@ public interface HEADERType extends EObject {
|
||||
*/
|
||||
boolean isSetVISIBLE();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>EQUIVALENT</b></em>' attribute.
|
||||
* The default value is <code>"false"</code>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>EQUIVALENT</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>EQUIVALENT</em>' attribute.
|
||||
* @see #isSetEQUIVALENT()
|
||||
* @see #unsetEQUIVALENT()
|
||||
* @see #setEQUIVALENT(String)
|
||||
* @see org.talend.designer.core.model.utils.emf.component.ComponentPackage#getHEADERType_EQUIVALENT()
|
||||
* @model default="false" unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
|
||||
* extendedMetaData="kind='attribute' name='EQUIVALENT' namespace='##targetNamespace'"
|
||||
* @generated
|
||||
*/
|
||||
String getEQUIVALENT();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.talend.designer.core.model.utils.emf.component.HEADERType#getEQUIVALENT <em>EQUIVALENT</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>EQUIVALENT</em>' attribute.
|
||||
* @see #isSetEQUIVALENT()
|
||||
* @see #unsetEQUIVALENT()
|
||||
* @see #getEQUIVALENT()
|
||||
* @generated
|
||||
*/
|
||||
void setEQUIVALENT(String value);
|
||||
|
||||
/**
|
||||
* Unsets the value of the '{@link org.talend.designer.core.model.utils.emf.component.HEADERType#getEQUIVALENT <em>EQUIVALENT</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #isSetEQUIVALENT()
|
||||
* @see #getEQUIVALENT()
|
||||
* @see #setEQUIVALENT(String)
|
||||
* @generated
|
||||
*/
|
||||
void unsetEQUIVALENT();
|
||||
|
||||
/**
|
||||
* Returns whether the value of the '{@link org.talend.designer.core.model.utils.emf.component.HEADERType#getEQUIVALENT <em>EQUIVALENT</em>}' attribute is set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return whether the value of the '<em>EQUIVALENT</em>' attribute is set.
|
||||
* @see #unsetEQUIVALENT()
|
||||
* @see #getEQUIVALENT()
|
||||
* @see #setEQUIVALENT(String)
|
||||
* @generated
|
||||
*/
|
||||
boolean isSetEQUIVALENT();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>TYPE</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
|
||||
@@ -1323,6 +1323,15 @@ public class ComponentPackageImpl extends EPackageImpl implements ComponentPacka
|
||||
return (EAttribute)headerTypeEClass.getEStructuralFeatures().get(31);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getHEADERType_EQUIVALENT() {
|
||||
return (EAttribute)headerTypeEClass.getEStructuralFeatures().get(32);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
@@ -2602,6 +2611,7 @@ public class ComponentPackageImpl extends EPackageImpl implements ComponentPacka
|
||||
createEAttribute(headerTypeEClass, HEADER_TYPE__TYPE);
|
||||
createEAttribute(headerTypeEClass, HEADER_TYPE__VERSION);
|
||||
createEAttribute(headerTypeEClass, HEADER_TYPE__VISIBLE);
|
||||
createEAttribute(headerTypeEClass, HEADER_TYPE__EQUIVALENT);
|
||||
|
||||
importsTypeEClass = createEClass(IMPORTS_TYPE);
|
||||
createEReference(importsTypeEClass, IMPORTS_TYPE__IMPORT);
|
||||
@@ -2898,6 +2908,7 @@ public class ComponentPackageImpl extends EPackageImpl implements ComponentPacka
|
||||
initEAttribute(getHEADERType_TYPE(), theXMLTypePackage.getString(), "tYPE", null, 0, 1, HEADERType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getHEADERType_VERSION(), theXMLTypePackage.getDecimal(), "vERSION", null, 1, 1, HEADERType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getHEADERType_VISIBLE(), theXMLTypePackage.getBoolean(), "vISIBLE", "true", 0, 1, HEADERType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getHEADERType_EQUIVALENT(), theXMLTypePackage.getString(), "eQUIVALENT", "false", 0, 1, HEADERType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(importsTypeEClass, IMPORTSType.class, "IMPORTSType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getIMPORTSType_IMPORT(), this.getIMPORTType(), null, "iMPORT", null, 0, -1, IMPORTSType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
@@ -3954,6 +3965,14 @@ public class ComponentPackageImpl extends EPackageImpl implements ComponentPacka
|
||||
"name", "VISIBLE",
|
||||
"namespace", "##targetNamespace"
|
||||
});
|
||||
addAnnotation
|
||||
(getHEADERType_EQUIVALENT(),
|
||||
source,
|
||||
new String[] {
|
||||
"kind", "attribute",
|
||||
"name", "EQUIVALENT",
|
||||
"namespace", "##targetNamespace"
|
||||
});
|
||||
addAnnotation
|
||||
(importsTypeEClass,
|
||||
source,
|
||||
|
||||
@@ -56,6 +56,7 @@ import org.talend.designer.core.model.utils.emf.component.HEADERType;
|
||||
* <li>{@link org.talend.designer.core.model.utils.emf.component.impl.HEADERTypeImpl#getTYPE <em>TYPE</em>}</li>
|
||||
* <li>{@link org.talend.designer.core.model.utils.emf.component.impl.HEADERTypeImpl#getVERSION <em>VERSION</em>}</li>
|
||||
* <li>{@link org.talend.designer.core.model.utils.emf.component.impl.HEADERTypeImpl#isVISIBLE <em>VISIBLE</em>}</li>
|
||||
* <li>{@link org.talend.designer.core.model.utils.emf.component.impl.HEADERTypeImpl#getEQUIVALENT <em>EQUIVALENT</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
@@ -818,6 +819,35 @@ public class HEADERTypeImpl extends EObjectImpl implements HEADERType {
|
||||
*/
|
||||
protected boolean vISIBLEESet;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getEQUIVALENT() <em>EQUIVALENT</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getEQUIVALENT()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String EQUIVALENT_EDEFAULT = "false";
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getEQUIVALENT() <em>EQUIVALENT</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getEQUIVALENT()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String eQUIVALENT = EQUIVALENT_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the EQUIVALENT attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean eQUIVALENTESet;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
@@ -1750,6 +1780,52 @@ public class HEADERTypeImpl extends EObjectImpl implements HEADERType {
|
||||
return vISIBLEESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getEQUIVALENT() {
|
||||
return eQUIVALENT;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setEQUIVALENT(String newEQUIVALENT) {
|
||||
String oldEQUIVALENT = eQUIVALENT;
|
||||
eQUIVALENT = newEQUIVALENT;
|
||||
boolean oldEQUIVALENTESet = eQUIVALENTESet;
|
||||
eQUIVALENTESet = true;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.HEADER_TYPE__EQUIVALENT, oldEQUIVALENT, eQUIVALENT, !oldEQUIVALENTESet));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void unsetEQUIVALENT() {
|
||||
String oldEQUIVALENT = eQUIVALENT;
|
||||
boolean oldEQUIVALENTESet = eQUIVALENTESet;
|
||||
eQUIVALENT = EQUIVALENT_EDEFAULT;
|
||||
eQUIVALENTESet = false;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.UNSET, ComponentPackage.HEADER_TYPE__EQUIVALENT, oldEQUIVALENT, EQUIVALENT_EDEFAULT, oldEQUIVALENTESet));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetEQUIVALENT() {
|
||||
return eQUIVALENTESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
@@ -1964,6 +2040,8 @@ public class HEADERTypeImpl extends EObjectImpl implements HEADERType {
|
||||
return getVERSION();
|
||||
case ComponentPackage.HEADER_TYPE__VISIBLE:
|
||||
return isVISIBLE() ? Boolean.TRUE : Boolean.FALSE;
|
||||
case ComponentPackage.HEADER_TYPE__EQUIVALENT:
|
||||
return getEQUIVALENT();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
@@ -2071,6 +2149,9 @@ public class HEADERTypeImpl extends EObjectImpl implements HEADERType {
|
||||
case ComponentPackage.HEADER_TYPE__VISIBLE:
|
||||
setVISIBLE(((Boolean)newValue).booleanValue());
|
||||
return;
|
||||
case ComponentPackage.HEADER_TYPE__EQUIVALENT:
|
||||
setEQUIVALENT((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
@@ -2178,6 +2259,9 @@ public class HEADERTypeImpl extends EObjectImpl implements HEADERType {
|
||||
case ComponentPackage.HEADER_TYPE__VISIBLE:
|
||||
unsetVISIBLE();
|
||||
return;
|
||||
case ComponentPackage.HEADER_TYPE__EQUIVALENT:
|
||||
unsetEQUIVALENT();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
@@ -2253,6 +2337,8 @@ public class HEADERTypeImpl extends EObjectImpl implements HEADERType {
|
||||
return VERSION_EDEFAULT == null ? vERSION != null : !VERSION_EDEFAULT.equals(vERSION);
|
||||
case ComponentPackage.HEADER_TYPE__VISIBLE:
|
||||
return isSetVISIBLE();
|
||||
case ComponentPackage.HEADER_TYPE__EQUIVALENT:
|
||||
return isSetEQUIVALENT();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
@@ -2328,6 +2414,8 @@ public class HEADERTypeImpl extends EObjectImpl implements HEADERType {
|
||||
result.append(vERSION);
|
||||
result.append(", vISIBLE: ");
|
||||
if (vISIBLEESet) result.append(vISIBLE); else result.append("<unset>");
|
||||
result.append(", eQUIVALENT: ");
|
||||
if (eQUIVALENTESet) result.append(eQUIVALENT); else result.append("<unset>");
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
@@ -28,8 +28,10 @@ import java.util.regex.Pattern;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Priority;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.emf.common.util.EMap;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
@@ -90,6 +92,7 @@ import org.talend.commons.ui.utils.loader.MyURLClassLoader;
|
||||
import org.talend.commons.utils.data.list.IListenableListListener;
|
||||
import org.talend.commons.utils.data.list.ListenableListEvent;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ILibraryManagerService;
|
||||
import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.conn.ConnParameterKeys;
|
||||
import org.talend.core.database.conn.DatabaseConnStrUtil;
|
||||
@@ -137,6 +140,7 @@ import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
import org.talend.core.ui.branding.IBrandingConfiguration;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
import org.talend.core.ui.metadata.celleditor.ModuleListDialog;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
@@ -629,7 +633,14 @@ public class DatabaseForm extends AbstractForm {
|
||||
generalJdbcUserText.setText(getConnection().getUsername());
|
||||
generalJdbcPasswordText.setText(getConnection().getRawPassword());
|
||||
|
||||
generalJdbcDriverjarText.setText(getConnection().getDriverJarPath());
|
||||
String jarPath = getConnection().getDriverJarPath();
|
||||
IPath path = Path.fromOSString(jarPath);
|
||||
if (path.lastSegment() != null) {
|
||||
generalJdbcDriverjarText.setText(path.lastSegment());
|
||||
} else {
|
||||
generalJdbcDriverjarText.setText(jarPath);
|
||||
}
|
||||
|
||||
generalMappingFileText.setText(getConnection().getDbmsId());
|
||||
|
||||
String jdbcUrlString = ""; //$NON-NLS-1$
|
||||
@@ -3665,9 +3676,31 @@ public class DatabaseForm extends AbstractForm {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
SelectDatabaseJarDialog dialog = new SelectDatabaseJarDialog(getShell(), generalJdbcDriverjarText.getText());
|
||||
String value = generalJdbcDriverjarText.getText();
|
||||
if (value != null && value.length() > 0) {
|
||||
IPath path = Path.fromOSString(value);
|
||||
if (path.lastSegment() != null) {
|
||||
value = path.lastSegment();
|
||||
}
|
||||
}
|
||||
ModuleListDialog dialog = new ModuleListDialog(getShell(), value, null, true);
|
||||
|
||||
if (dialog.open() == Window.OK) {
|
||||
generalJdbcDriverjarText.setText(dialog.getJarsString());
|
||||
if (dialog.getSelecteModuleArray() != null) {
|
||||
String[] moduleArray = dialog.getSelecteModuleArray();
|
||||
StringBuffer modeleList = new StringBuffer();
|
||||
for (int i = 0; i < moduleArray.length; i++) {
|
||||
String module = moduleArray[i];
|
||||
modeleList.append(module);
|
||||
if (i < moduleArray.length - 1) {
|
||||
modeleList.append(";");
|
||||
}
|
||||
}
|
||||
generalJdbcDriverjarText.setText(modeleList.toString());
|
||||
} else if (dialog.getSelecteModule() != null) {
|
||||
String selecteModule = dialog.getSelecteModule();
|
||||
generalJdbcDriverjarText.setText(selecteModule);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3679,7 +3712,11 @@ public class DatabaseForm extends AbstractForm {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
|
||||
generalJdbcClassNameText.removeAll();
|
||||
for (String stringToFile : generalJdbcDriverjarText.getText().trim().split(";")) { //$NON-NLS-1$
|
||||
for (String jarName : generalJdbcDriverjarText.getText().trim().split(";")) { //$NON-NLS-1$
|
||||
String stringToFile = getselecteModulePath(jarName);
|
||||
if (stringToFile == null) {
|
||||
stringToFile = jarName;
|
||||
}
|
||||
File file = new File(stringToFile);
|
||||
if (file != null) {
|
||||
try {
|
||||
@@ -5918,6 +5955,22 @@ public class DatabaseForm extends AbstractForm {
|
||||
return hadoopClusterService != null;
|
||||
}
|
||||
|
||||
private String getselecteModulePath(String selecteModule) {
|
||||
File file = new File(selecteModule);
|
||||
if (file.exists() && file.isFile()) {
|
||||
return selecteModule;
|
||||
}
|
||||
String selecteModulePath = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
|
||||
ILibraryManagerService librairesService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(
|
||||
ILibraryManagerService.class);
|
||||
if (librairesService != null) {
|
||||
selecteModulePath = librairesService.getJarPath(selecteModule);
|
||||
}
|
||||
}
|
||||
return selecteModulePath;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC zshen Comment method "getMetadataConnection".
|
||||
|
||||
Reference in New Issue
Block a user