Revision 4db49a38
Added by Alexander Oppermann over 9 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java | ||
---|---|---|
74 | 74 |
*/ |
75 | 75 |
@Override |
76 | 76 |
public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) { |
77 |
monitor.subTask("Refreshing Datasource View"); |
|
77 |
monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
|
|
78 | 78 |
viewer.refresh(); |
79 | 79 |
} |
80 | 80 |
|
... | ... | |
83 | 83 |
*/ |
84 | 84 |
@Override |
85 | 85 |
public void contextStop(IMemento memento, IProgressMonitor monitor) { |
86 |
monitor.subTask("Refreshing Datasource View"); |
|
86 |
monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
|
|
87 | 87 |
viewer.refresh(); |
88 | 88 |
} |
89 | 89 |
|
... | ... | |
92 | 92 |
*/ |
93 | 93 |
@Override |
94 | 94 |
public void contextStart(IMemento memento, IProgressMonitor monitor) { |
95 |
monitor.subTask("Refreshing Datasource View"); |
|
95 |
monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
|
|
96 | 96 |
viewer.refresh(); |
97 | 97 |
} |
98 | 98 |
} |
... | ... | |
115 | 115 |
@Override |
116 | 116 |
public IStatus run(final IProgressMonitor monitor) { |
117 | 117 |
try{ |
118 |
logger.debug("Begin of eclipse core runtime Job to Retrieve datasources"); |
|
119 |
monitor.beginTask("Retrieving datasources", cdmSources.size() + 1); |
|
118 |
logger.debug("Begin of eclipse core runtime Job to Retrieve datasources"); //$NON-NLS-1$
|
|
119 |
monitor.beginTask("Retrieving datasources", cdmSources.size() + 1); //$NON-NLS-1$
|
|
120 | 120 |
|
121 | 121 |
final List<CdmMetaDataAwareDataSourceContainer> containers = new ArrayList<CdmMetaDataAwareDataSourceContainer>(); |
122 | 122 |
|
... | ... | |
136 | 136 |
for(final CdmMetaDataAwareDataSourceContainer container : containers){ |
137 | 137 |
|
138 | 138 |
|
139 |
if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " : next DataSourceContainer"); |
|
139 |
if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " : next DataSourceContainer"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
140 | 140 |
container.getMetaDataFromDataSource(); |
141 |
if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " : metadata retrieved, creating new runnable ..."); |
|
141 |
if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " : metadata retrieved, creating new runnable ..."); //$NON-NLS-1$ //$NON-NLS-2$
|
|
142 | 142 |
Display.getDefault().asyncExec(new Runnable() { |
143 | 143 |
|
144 | 144 |
@Override |
145 | 145 |
public void run() { |
146 |
if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " starting sub thread to update ..."); |
|
146 |
if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " starting sub thread to update ..."); //$NON-NLS-1$ //$NON-NLS-2$
|
|
147 | 147 |
viewer.update(container, null); |
148 |
if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " end of sub thread to update ..."); |
|
148 |
if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " end of sub thread to update ..."); //$NON-NLS-1$ //$NON-NLS-2$
|
|
149 | 149 |
} |
150 | 150 |
}); |
151 |
if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " done"); |
|
151 |
if(logger.isDebugEnabled()) logger.debug(" #" + container.hashCode() + " done"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
152 | 152 |
monitor.worked(1); |
153 | 153 |
} |
154 | 154 |
|
... | ... | |
160 | 160 |
} |
161 | 161 |
|
162 | 162 |
/** Constant <code>ID="eu.etaxonomy.taxeditor.store.datasource"{trunked}</code> */ |
163 |
public static String ID = "eu.etaxonomy.taxeditor.view.datasource"; |
|
163 |
public static String ID = "eu.etaxonomy.taxeditor.view.datasource"; //$NON-NLS-1$
|
|
164 | 164 |
|
165 | 165 |
private TableViewer viewer; |
166 | 166 |
|
... | ... | |
222 | 222 |
Object element = ((StructuredSelection) event |
223 | 223 |
.getSelection()).getFirstElement(); |
224 | 224 |
if (element instanceof CdmMetaDataAwareDataSourceContainer) { |
225 |
String commandId = "eu.etaxonomy.taxeditor.store.datasource.change"; |
|
225 |
String commandId = "eu.etaxonomy.taxeditor.store.datasource.change"; //$NON-NLS-1$
|
|
226 | 226 |
|
227 | 227 |
ICommandService commandService = (ICommandService)getSite().getService(ICommandService.class); |
228 | 228 |
|
... | ... | |
255 | 255 |
// This will create the columns for the table |
256 | 256 |
private void createColumns(TableViewer viewer) { |
257 | 257 |
Table table = viewer.getTable(); |
258 |
String[] titles = {"Connected", "Name", "Server", "Up", "Type", "Database", "Nomenclatural Code", "Created", "CDM Version", "Compatible", "Notes"};
|
|
258 |
String[] titles = {Messages.CdmDataSourceViewPart_12, Messages.CdmDataSourceViewPart_11, Messages.CdmDataSourceViewPart_10, Messages.CdmDataSourceViewPart_9, Messages.CdmDataSourceViewPart_8, Messages.CdmDataSourceViewPart_7, Messages.CdmDataSourceViewPart_6, Messages.CdmDataSourceViewPart_5, Messages.CdmDataSourceViewPart_4, Messages.CdmDataSourceViewPart_3, Messages.CdmDataSourceViewPart_2};
|
|
259 | 259 |
int[] bounds = { 24, 200, 100, 50 , 80, 120, 50, 100, 100, 50, 300}; |
260 | 260 |
|
261 | 261 |
for (int i = 0; i < titles.length; i++) { |
... | ... | |
279 | 279 |
* <p>refresh</p> |
280 | 280 |
*/ |
281 | 281 |
public void refresh(){ |
282 |
getService().schedule(new DataSourceJob("Loading datasources", CdmDataSourceRepository.getAll()), Job.LONG);
|
|
282 |
getService().schedule(new DataSourceJob(Messages.CdmDataSourceViewPart_1, CdmDataSourceRepository.getAll()), Job.LONG);
|
|
283 | 283 |
} |
284 | 284 |
|
285 | 285 |
/** {@inheritDoc} */ |
... | ... | |
306 | 306 |
// viewer.getTable().setEnabled(!busy); |
307 | 307 |
if(busy){ |
308 | 308 |
partNameCache = getPartName(); |
309 |
setPartName("Loading datasources");
|
|
309 |
setPartName(Messages.CdmDataSourceViewPart_1);
|
|
310 | 310 |
}else{ |
311 | 311 |
if(partNameCache != null){ |
312 | 312 |
setPartName(partNameCache); |
Also available in: Unified diff
reintegrated redlist branch into trunk