use of org.talend.mdm.repository.model.mdmproperties.MDMServerDefItem in project tmdm-studio-se by Talend.
the class ServerExplorer method reInputPassword.
private void reInputPassword() {
List<IRepositoryViewObject> viewObjects = ServerDefService.getAllServerDefViewObjects();
for (IRepositoryViewObject viewObj : viewObjects) {
MDMServerDefItem serverDefItem = getMDMItem(viewObj);
MDMServerDef serverDef = serverDefItem.getServerDef();
if (serverDef.getPasswd().equals("")) {
// $NON-NLS-1$
MessageDialog.openInformation(null, Messages.ServerExplorer_WarningText, Messages.bind(Messages.Reinput_Password, serverDef.getName()));
editServerDef(viewObj);
}
}
}
use of org.talend.mdm.repository.model.mdmproperties.MDMServerDefItem in project tmdm-studio-se by Talend.
the class ServerExplorer method createPartControl.
/**
* Create contents of the view part.
*
* @param parent
*/
@Override
public void createPartControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FillLayout(SWT.HORIZONTAL));
treeViewer = new TreeViewer(container, SWT.BORDER);
treeViewer.setSorter(new ServerSorter());
tree = treeViewer.getTree();
tree.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
IRepositoryViewObject viewObject = getCurSelectedViewObject();
String name = null;
if (viewObject != null) {
MDMServerDefItem serverDefItem = getMDMItem(viewObject);
name = serverDefItem.getServerDef().getName();
}
editServerDef();
}
});
toolkit.paintBordersFor(tree);
treeViewer.setContentProvider(new TreeContentProvider());
treeViewer.setLabelProvider(new ViewerLabelProvider());
initAdapter();
initializeToolBar();
initializeMenu();
refreshServerDefs();
reInputPassword();
}
use of org.talend.mdm.repository.model.mdmproperties.MDMServerDefItem in project tmdm-studio-se by Talend.
the class ServerExplorer method getMenuListener.
private IMenuListener getMenuListener() {
return new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
ISelection selection = treeViewer.getSelection();
boolean isEmpty = selection.isEmpty();
if (isEmpty) {
manager.add(addServerDefAction);
} else {
addAllActions(manager);
IRepositoryViewObject viewObject = getCurSelectedViewObject();
if (viewObject != null) {
MDMServerDefItem mdmItem = getMDMItem(viewObject);
if (mdmItem != null) {
MDMServerDef serverDef = mdmItem.getServerDef();
manager.add(new Separator());
if (serverDef.isEnabled()) {
manager.add(toDisableServerAction);
} else {
manager.add(toEnableServerAction);
}
}
}
}
}
};
}
use of org.talend.mdm.repository.model.mdmproperties.MDMServerDefItem in project tmdm-studio-se by Talend.
the class ServerDefRepositoryContentHandler method save.
public Resource save(Item item) throws PersistenceException {
if (item instanceof MDMServerDefItem) {
Resource resource = xmiResourceManager.getItemResource(item);
resource.getContents().clear();
resource.getContents().add(((MDMServerDefItem) item).getServerDef());
return resource;
}
return null;
}
use of org.talend.mdm.repository.model.mdmproperties.MDMServerDefItem in project tmdm-studio-se by Talend.
the class ServerDefRepositoryContentHandler method create.
public Resource create(IProject project, Item item, int classifierID, IPath path) throws PersistenceException {
if (item instanceof MDMServerDefItem) {
Resource itemResource = xmiResourceManager.createItemResource(project, item, path, ServerDefService.REPOSITORY_TYPE_SERVER_DEF, false);
itemResource.getContents().add(((MDMServerDefItem) item).getServerDef());
return itemResource;
}
return null;
}
Aggregations