Revision 2d2a661d
Added by Andreas Müller over 1 year ago
eu.etaxonomy.taxeditor.store/fragment.e4xmi | ||
---|---|---|
74 | 74 |
<handlers xmi:id="_WsXuMZ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handler.CreateRemoteServerHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.remoteserver.handler.CreateRemoteServerHandler" command="_nYPOkJ1XEe2Oid79gMgNzw"/> |
75 | 75 |
<handlers xmi:id="_WsXuMp1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handler.EditRemoteServerHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.remoteserver.handler.EditRemoteServerHandler" command="_m1wMkJ1XEe2Oid79gMgNzw"/> |
76 | 76 |
<handlers xmi:id="_WsXuNJ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handler.DeleteRemoteServerHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.remoteserver.handler.DeleteRemoteServerHandler" command="_lvyqEJ1XEe2Oid79gMgNzw"/> |
77 |
<handlers xmi:id="_l8zFcNkaEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.local.handler.MoveUpRemoteServerHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.remoteserver.handler.MoveUpRemoteServerHandler" command="_tEWW8NkaEe231IdeAjpAvg"/> |
|
78 |
<handlers xmi:id="_8KIN0NkbEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.local.handler.MoveDownRemoteServerHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.remoteserver.handler.MoveDownRemoteServerHandler" command="_-iLDQNkbEe231IdeAjpAvg"/> |
|
77 | 79 |
<menus xsi:type="menu:PopupMenu" xmi:id="_WsXuNZ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.popupmenu.remoteServerViewPart"> |
78 | 80 |
<children xsi:type="menu:HandledMenuItem" xmi:id="_WsXuNp1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handledmenuitem.new" label="New" command="_nYPOkJ1XEe2Oid79gMgNzw"/> |
79 | 81 |
<children xsi:type="menu:HandledMenuItem" xmi:id="_WsXuN51XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handledmenuitem.edit" label="Edit" command="_m1wMkJ1XEe2Oid79gMgNzw"/> |
80 | 82 |
<children xsi:type="menu:HandledMenuItem" xmi:id="_WsXuOZ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handledmenuitem.delete" label="Delete" command="_lvyqEJ1XEe2Oid79gMgNzw"/> |
83 |
<children xsi:type="menu:HandledMenuItem" xmi:id="_lMYVINkaEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.moveup" label="Move up" command="_tEWW8NkaEe231IdeAjpAvg"/> |
|
84 |
<children xsi:type="menu:HandledMenuItem" xmi:id="_6bF5INkbEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.movedown" label="Move down" command="_-iLDQNkbEe231IdeAjpAvg"/> |
|
81 | 85 |
</menus> |
82 | 86 |
</elements> |
83 | 87 |
</fragments> |
... | ... | |
160 | 164 |
<elements xsi:type="commands:Command" xmi:id="_lvyqEJ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.command.deleteRemoteServer" commandName="Delete"/> |
161 | 165 |
<elements xsi:type="commands:Command" xmi:id="_m1wMkJ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.command.editRemoteServer" commandName="Edit"/> |
162 | 166 |
<elements xsi:type="commands:Command" xmi:id="_nYPOkJ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.command.newRemoteServer" commandName="New"/> |
167 |
<elements xsi:type="commands:Command" xmi:id="_tEWW8NkaEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.local.command.moveUpRemoteServer" commandName="Move up"/> |
|
168 |
<elements xsi:type="commands:Command" xmi:id="_-iLDQNkbEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.local.command.moveDownRemoteServer" commandName="Move down"/> |
|
163 | 169 |
</fragments> |
164 | 170 |
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_swGH0GhvEee3K4uKJljEYg" featurename="handlers" parentElementId="xpath:/"> |
165 | 171 |
<elements xsi:type="commands:Handler" xmi:id="_rVEdIGcjEee0qLTtA2ZpVQ" elementId="eu.etaxonomy.taxeditor.featuretree.e4.handler.RemoveFeatureHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.termtree.e4.handler.RemoveTermHandler" command="_fNBtQGcjEee0qLTtA2ZpVQ"/> |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/CdmRemoteServerViewPart.java | ||
---|---|---|
214 | 214 |
} |
215 | 215 |
} |
216 | 216 |
|
217 |
//FIXME E4 migrate |
|
218 |
// @Override |
|
219 |
// public void showBusy(boolean busy) { |
|
220 |
// super.showBusy(busy); |
|
221 |
//// viewer.getTable().setEnabled(!busy); |
|
222 |
// if(busy){ |
|
223 |
// partNameCache = getPartName(); |
|
224 |
// setPartName(Messages.CdmDataSourceViewPart_1); |
|
225 |
// }else{ |
|
226 |
// if(partNameCache != null){ |
|
227 |
// setPartName(partNameCache); |
|
228 |
// } |
|
229 |
// } |
|
230 |
// } |
|
231 |
|
|
232 | 217 |
public StructuredViewer getViewer() { |
233 | 218 |
return viewer; |
234 | 219 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/common/CdmRemoteServerRepository.java | ||
---|---|---|
11 | 11 |
package eu.etaxonomy.taxeditor.view.remoteserver.common; |
12 | 12 |
|
13 | 13 |
import java.io.File; |
14 |
import java.io.FileNotFoundException; |
|
15 | 14 |
import java.util.ArrayList; |
16 |
import java.util.HashMap; |
|
17 | 15 |
import java.util.List; |
18 | 16 |
|
19 |
import org.eclipse.core.runtime.IPath; |
|
20 |
import org.eclipse.ui.IMemento; |
|
21 |
import org.eclipse.ui.XMLMemento; |
|
22 |
|
|
23 |
import eu.etaxonomy.cdm.config.CdmPersistentSourceUtils; |
|
24 | 17 |
import eu.etaxonomy.cdm.config.ConfigFileUtil; |
25 |
import eu.etaxonomy.cdm.config.ICdmPersistentSource; |
|
26 |
import eu.etaxonomy.cdm.config.ICdmSource; |
|
27 |
import eu.etaxonomy.cdm.database.CdmDataSource; |
|
28 |
import eu.etaxonomy.cdm.database.CdmPersistentDataSource; |
|
29 |
import eu.etaxonomy.cdm.database.DataSourceNotFoundException; |
|
30 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
|
31 |
import eu.etaxonomy.taxeditor.model.MementoHelper; |
|
32 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
33 |
import eu.etaxonomy.taxeditor.remoting.source.CdmPersistentRemoteSource; |
|
34 |
import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource; |
|
35 | 18 |
import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSourceException; |
36 | 19 |
import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfo; |
37 | 20 |
import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig; |
38 |
import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource; |
|
39 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
40 |
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin; |
|
41 | 21 |
|
42 | 22 |
public class CdmRemoteServerRepository{ |
43 | 23 |
|
44 | 24 |
private static final String DEFAULT_REMOTE_SERVER_FILENAME = "cdm_remote_servers.json"; |
45 |
|
|
46 |
static List<CdmServerInfoConfig> cdmServerList = new ArrayList<>(); |
|
47 | 25 |
|
48 |
|
|
26 |
static List<CdmServerInfoConfig> cdmServerList = new ArrayList<>(); |
|
27 |
|
|
28 |
|
|
49 | 29 |
|
50 | 30 |
public static boolean delete(CdmServerInfoConfig remoteServerConfig) { |
51 | 31 |
cdmServerList.remove(remoteServerConfig); |
52 | 32 |
save(); |
53 | 33 |
return true; |
54 | 34 |
} |
55 |
|
|
56 |
public static boolean check(CdmServerInfoConfig remoteServerConfig) {
|
|
57 |
|
|
58 |
boolean contains = false;
|
|
35 |
|
|
36 |
public static Integer check(CdmServerInfoConfig remoteServerConfig) {
|
|
37 |
|
|
38 |
int index = 0;
|
|
59 | 39 |
for (CdmServerInfoConfig server: cdmServerList) { |
60 | 40 |
if (server.getName().equals(remoteServerConfig.getName())) { |
61 |
contains = true; |
|
62 |
break; |
|
41 |
return index; |
|
63 | 42 |
} |
43 |
index++; |
|
64 | 44 |
} |
65 |
return contains;
|
|
66 |
|
|
45 |
return null;
|
|
46 |
|
|
67 | 47 |
} |
68 |
|
|
48 |
|
|
69 | 49 |
public static boolean add(CdmServerInfoConfig newRemoteServer) { |
70 | 50 |
// if (cdmServerList.containsKey(newRemoteServer)) { |
71 | 51 |
// return false; |
72 | 52 |
// } |
73 |
|
|
53 |
|
|
74 | 54 |
cdmServerList.add(newRemoteServer); |
75 | 55 |
return true; |
76 | 56 |
} |
77 |
|
|
57 |
|
|
78 | 58 |
public static boolean update(CdmServerInfoConfig updatedRemoteServer, String oldName) { |
79 | 59 |
int i = 0; |
80 | 60 |
boolean contains = false; |
... | ... | |
91 | 71 |
return true; |
92 | 72 |
} |
93 | 73 |
|
74 |
public static boolean moveUp(CdmServerInfoConfig updatedRemoteServer) { |
|
75 |
int i = 0; |
|
76 |
boolean contains = false; |
|
77 |
for (CdmServerInfoConfig server: cdmServerList) { |
|
78 |
if (server.getName().equals(updatedRemoteServer.getName())) { |
|
79 |
contains = true; |
|
80 |
break; |
|
81 |
} |
|
82 |
i++; |
|
83 |
} |
|
84 |
if (contains) { |
|
85 |
cdmServerList.remove(i); |
|
86 |
} |
|
87 |
|
|
88 |
cdmServerList.add(--i, updatedRemoteServer); |
|
89 |
return true; |
|
90 |
} |
|
91 |
|
|
92 |
public static boolean moveDown(CdmServerInfoConfig updatedRemoteServer) { |
|
93 |
int i = 0; |
|
94 |
boolean contains = false; |
|
95 |
for (CdmServerInfoConfig server: cdmServerList) { |
|
96 |
if (server.getName().equals(updatedRemoteServer.getName())) { |
|
97 |
contains = true; |
|
98 |
break; |
|
99 |
} |
|
100 |
i++; |
|
101 |
} |
|
102 |
if (contains) { |
|
103 |
cdmServerList.remove(i); |
|
104 |
} |
|
105 |
|
|
106 |
cdmServerList.add(++i, updatedRemoteServer); |
|
107 |
return true; |
|
108 |
} |
|
109 |
|
|
94 | 110 |
public static List<CdmServerInfoConfig> getAll() { |
95 | 111 |
List<CdmServerInfoConfig> cdmServers = null; |
96 | 112 |
try { |
... | ... | |
104 | 120 |
// TODO Auto-generated catch block |
105 | 121 |
e.printStackTrace(); |
106 | 122 |
} |
107 |
|
|
123 |
|
|
108 | 124 |
return cdmServers; |
109 | 125 |
} |
110 | 126 |
|
111 |
|
|
112 | 127 |
|
113 |
|
|
128 |
|
|
129 |
|
|
114 | 130 |
|
115 | 131 |
/** |
116 | 132 |
* <p>save</p> |
... | ... | |
125 | 141 |
return CdmServerInfo.saveToConfigFile(cdmServerList, file); |
126 | 142 |
} |
127 | 143 |
|
128 |
|
|
129 | 144 |
|
130 |
// public static ICdmPersistentSource replace(String strCdmSourceName, CdmServerInfoConfig remoteServer){ |
|
131 |
// try { |
|
132 |
// return CdmPersistentDataSource.replace(strCdmSourceName, cdmSource); |
|
133 |
// } catch (Exception e) { |
|
134 |
// MessagingUtils.error(CdmRemoteServerRepository.class, "Error updating CDM Source", e); |
|
135 |
// } |
|
136 |
// return null; |
|
137 |
// } |
|
138 | 145 |
|
139 |
/** |
|
140 |
* <p>update</p> |
|
141 |
* |
|
142 |
* @param strDataSourceName a {@link java.lang.String} object. |
|
143 |
* @param dataSource a {@link eu.etaxonomy.cdm.database.ICdmDataSource} object. |
|
144 |
* @return a {@link eu.etaxonomy.cdm.database.CdmPersistentDataSource} object. |
|
145 |
*/ |
|
146 |
// public static ICdmPersistentSource update(String strCdmSourceName, CdmRemoteSource cdmSource){ |
|
147 |
// try { |
|
148 |
// return CdmPersistentRemoteSource.update(strCdmSourceName, cdmSource); |
|
149 |
// } catch (Exception e) { |
|
150 |
// MessagingUtils.error(CdmRemoteServerRepository.class, "Error updating CDM Source", e); |
|
151 |
// |
|
152 |
// } |
|
153 |
// return null; |
|
154 |
// } |
|
155 | 146 |
|
156 |
|
|
157 | 147 |
|
158 |
/* |
|
159 |
* Answer the workbench state file. |
|
160 |
*/ |
|
161 |
private static File getCdmServerFile() { |
|
162 |
IPath path = TaxeditorStorePlugin.getDefault().getStateLocation(); |
|
163 |
if (path == null) { |
|
164 |
return null; |
|
165 |
} |
|
166 |
path = path.append(DEFAULT_REMOTE_SERVER_FILENAME); |
|
167 |
return path.toFile(); |
|
168 |
} |
|
148 |
|
|
169 | 149 |
|
170 | 150 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/MoveDownRemoteServerHandler.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2023 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.view.remoteserver.handler; |
|
11 |
|
|
12 |
import javax.inject.Named; |
|
13 |
|
|
14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
|
15 |
import org.eclipse.e4.core.di.annotations.Optional; |
|
16 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
|
17 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
|
18 |
import org.eclipse.e4.ui.services.IServiceConstants; |
|
19 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
20 |
import org.eclipse.swt.widgets.Shell; |
|
21 |
|
|
22 |
import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig; |
|
23 |
import eu.etaxonomy.taxeditor.view.remoteserver.CdmRemoteServerViewPart; |
|
24 |
import eu.etaxonomy.taxeditor.view.remoteserver.common.CdmRemoteServerRepository; |
|
25 |
|
|
26 |
/** |
|
27 |
* @author k.luther |
|
28 |
* @date 12.04.2023 |
|
29 |
* |
|
30 |
*/ |
|
31 |
public class MoveDownRemoteServerHandler extends AbstractRemoteServerHandler{ |
|
32 |
@Override |
|
33 |
@CanExecute |
|
34 |
public boolean canExecute( |
|
35 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
|
36 |
@Named(IServiceConstants.ACTIVE_PART)MPart thisPart, |
|
37 |
MHandledMenuItem menuItem) { |
|
38 |
boolean canExecute = false; |
|
39 |
canExecute = thisPart.getObject() instanceof CdmRemoteServerViewPart |
|
40 |
&& selection!=null |
|
41 |
&& selection.size()==1 |
|
42 |
&& selection.getFirstElement() instanceof CdmServerInfoConfig |
|
43 |
&& CdmRemoteServerRepository.check((CdmServerInfoConfig)selection.getFirstElement()) < CdmRemoteServerRepository.getAll().size()-1; |
|
44 |
menuItem.setVisible(canExecute); |
|
45 |
return canExecute; |
|
46 |
} |
|
47 |
|
|
48 |
@Override |
|
49 |
public boolean specificExecute(CdmRemoteServerViewPart dataSourceViewPart, CdmServerInfoConfig container, |
|
50 |
Shell shell) { |
|
51 |
CdmRemoteServerRepository.moveDown(container); |
|
52 |
CdmRemoteServerRepository.save(); |
|
53 |
return true; |
|
54 |
} |
|
55 |
|
|
56 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/MoveUpRemoteServerHandler.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2023 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.view.remoteserver.handler; |
|
11 |
|
|
12 |
import javax.inject.Named; |
|
13 |
|
|
14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
|
15 |
import org.eclipse.e4.core.di.annotations.Optional; |
|
16 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
|
17 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
|
18 |
import org.eclipse.e4.ui.services.IServiceConstants; |
|
19 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
20 |
import org.eclipse.swt.widgets.Shell; |
|
21 |
|
|
22 |
import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig; |
|
23 |
import eu.etaxonomy.taxeditor.view.remoteserver.CdmRemoteServerViewPart; |
|
24 |
import eu.etaxonomy.taxeditor.view.remoteserver.common.CdmRemoteServerRepository; |
|
25 |
|
|
26 |
/** |
|
27 |
* @author k.luther |
|
28 |
* @date 12.04.2023 |
|
29 |
* |
|
30 |
*/ |
|
31 |
public class MoveUpRemoteServerHandler extends AbstractRemoteServerHandler{ |
|
32 |
|
|
33 |
|
|
34 |
@Override |
|
35 |
@CanExecute |
|
36 |
public boolean canExecute( |
|
37 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
|
38 |
@Named(IServiceConstants.ACTIVE_PART)MPart thisPart, |
|
39 |
MHandledMenuItem menuItem) { |
|
40 |
boolean canExecute = false; |
|
41 |
canExecute = thisPart.getObject() instanceof CdmRemoteServerViewPart |
|
42 |
&& selection!=null |
|
43 |
&& selection.size()==1 |
|
44 |
&& selection.getFirstElement() instanceof CdmServerInfoConfig |
|
45 |
&& CdmRemoteServerRepository.check((CdmServerInfoConfig)selection.getFirstElement()) > 0; |
|
46 |
menuItem.setVisible(canExecute); |
|
47 |
return canExecute; |
|
48 |
} |
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
@Override |
|
53 |
public boolean specificExecute(CdmRemoteServerViewPart dataSourceViewPart, CdmServerInfoConfig container, |
|
54 |
Shell shell) { |
|
55 |
CdmRemoteServerRepository.moveUp(container); |
|
56 |
CdmRemoteServerRepository.save(); |
|
57 |
return true; |
|
58 |
} |
|
59 |
|
|
60 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/wizard/CdmRemoteServerWizard.java | ||
---|---|---|
16 | 16 |
import eu.etaxonomy.taxeditor.view.remoteserver.common.CdmRemoteServerRepository; |
17 | 17 |
|
18 | 18 |
/** |
19 |
* <p>CdmDataSourceWizard class.</p> |
|
20 | 19 |
* |
21 | 20 |
* @author n.hoffmann |
22 |
* @created 18.05.2009 |
|
21 |
* @author k.luther |
|
22 |
* @created 23.03.2023 |
|
23 | 23 |
*/ |
24 | 24 |
public class CdmRemoteServerWizard extends Wizard { |
25 | 25 |
|
26 | 26 |
private CdmRemoteServerWizardPage remoteServerPage; |
27 |
|
|
27 |
|
|
28 | 28 |
private CdmServerInfoConfig remoteServer; |
29 | 29 |
private String oldName; |
30 |
|
|
30 |
|
|
31 | 31 |
public enum Mode { |
32 | 32 |
CREATE, |
33 | 33 |
EDIT, |
... | ... | |
41 | 41 |
super(); |
42 | 42 |
this.mode = Mode.CREATE; |
43 | 43 |
setForcePreviousAndNextButtons(false); |
44 |
setWindowTitle("Datasource Dialog");
|
|
44 |
setWindowTitle("Remote Server Dialog");
|
|
45 | 45 |
} |
46 | 46 |
|
47 | 47 |
public CdmRemoteServerWizard(CdmServerInfoConfig remoteServer, Mode mode) { |
... | ... | |
53 | 53 |
} else { |
54 | 54 |
this.remoteServer = new CdmServerInfoConfig(); |
55 | 55 |
this.remoteServer.setName(""); |
56 |
//CdmRemoteServerRepository.add(this.remoteServer); |
|
57 | 56 |
} |
58 |
//setForcePreviousAndNextButtons(true); |
|
59 | 57 |
setWindowTitle("Remote Server Dialog"); |
60 | 58 |
} |
61 | 59 |
|
62 | 60 |
@Override |
63 | 61 |
public void addPages() { |
64 | 62 |
if (remoteServer != null) { |
65 |
|
|
63 |
|
|
66 | 64 |
remoteServerPage = new CdmRemoteServerWizardPage(remoteServer.getName(), remoteServer, mode); |
67 | 65 |
}else { |
68 | 66 |
remoteServerPage = new CdmRemoteServerWizardPage("New remote server", remoteServer, mode); |
69 | 67 |
} |
70 | 68 |
this.addPage(remoteServerPage); |
71 | 69 |
return; |
72 |
|
|
70 |
|
|
73 | 71 |
} |
74 | 72 |
|
75 | 73 |
@Override |
76 | 74 |
public boolean performFinish() { |
77 | 75 |
try { |
78 | 76 |
CdmServerInfoConfig cdmServerConf = this.remoteServerPage.getRemoteServer(); |
79 |
if (mode.equals(Mode.CREATE) && CdmRemoteServerRepository.check(cdmServerConf)) { |
|
80 |
while(CdmRemoteServerRepository.check(cdmServerConf)){ |
|
77 |
if (mode.equals(Mode.CREATE) && CdmRemoteServerRepository.check(cdmServerConf)!= null) {
|
|
78 |
while(CdmRemoteServerRepository.check(cdmServerConf) != null){
|
|
81 | 79 |
cdmServerConf.setName(cdmServerConf.getName()+ 1); |
82 | 80 |
} |
83 | 81 |
|
Also available in: Unified diff
ref #10287: add move up and down in context menu