Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2009 EclipseSource Corporation and others. |
2 |
* Copyright (c) 2009, 2011 EclipseSource Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 11-16
Link Here
|
11 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
12 |
package org.eclipse.pde.internal.ui.editor.product; |
12 |
package org.eclipse.pde.internal.ui.editor.product; |
13 |
|
13 |
|
|
|
14 |
import org.eclipse.jface.dialogs.IMessageProvider; |
14 |
import org.eclipse.pde.core.IModelChangedEvent; |
15 |
import org.eclipse.pde.core.IModelChangedEvent; |
15 |
import org.eclipse.pde.internal.core.iproduct.IProduct; |
16 |
import org.eclipse.pde.internal.core.iproduct.IProduct; |
16 |
import org.eclipse.pde.internal.core.iproduct.IProductModel; |
17 |
import org.eclipse.pde.internal.core.iproduct.IProductModel; |
Lines 24-29
Link Here
|
24 |
import org.eclipse.swt.layout.GridData; |
25 |
import org.eclipse.swt.layout.GridData; |
25 |
import org.eclipse.swt.widgets.*; |
26 |
import org.eclipse.swt.widgets.*; |
26 |
import org.eclipse.ui.IActionBars; |
27 |
import org.eclipse.ui.IActionBars; |
|
|
28 |
import org.eclipse.ui.forms.IMessageManager; |
27 |
import org.eclipse.ui.forms.widgets.*; |
29 |
import org.eclipse.ui.forms.widgets.*; |
28 |
|
30 |
|
29 |
public class GeneralInfoSection extends PDESection { |
31 |
public class GeneralInfoSection extends PDESection { |
Lines 94-106
Link Here
|
94 |
fIdEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { |
96 |
fIdEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { |
95 |
public void textValueChanged(FormEntry entry) { |
97 |
public void textValueChanged(FormEntry entry) { |
96 |
getProduct().setId(entry.getValue().trim()); |
98 |
getProduct().setId(entry.getValue().trim()); |
|
|
99 |
validateProductId(); |
97 |
} |
100 |
} |
|
|
101 |
|
98 |
}); |
102 |
}); |
99 |
GridData gd = new GridData(GridData.FILL_HORIZONTAL); |
103 |
GridData gd = new GridData(GridData.FILL_HORIZONTAL); |
100 |
gd.grabExcessHorizontalSpace = true; |
104 |
gd.grabExcessHorizontalSpace = true; |
101 |
gd.horizontalSpan = 2; |
105 |
gd.horizontalSpan = 2; |
102 |
fIdEntry.getText().setLayoutData(gd); |
106 |
fIdEntry.getText().setLayoutData(gd); |
103 |
fIdEntry.setEditable(isEditable()); |
107 |
fIdEntry.setEditable(isEditable()); |
|
|
108 |
validateProductId(); |
109 |
} |
110 |
|
111 |
private void validateProductId() { |
112 |
String pluginId = getProduct().getDefiningPluginId(); |
113 |
IMessageManager messageManager = getManagedForm().getForm().getMessageManager(); |
114 |
if (pluginId != null && pluginId.equals(getProduct().getId())) { |
115 |
messageManager.addMessage(PDEUIMessages.GeneralInfoSection_IdWarning, PDEUIMessages.GeneralInfoSection_IdWarning, null, IMessageProvider.WARNING); |
116 |
} else { |
117 |
messageManager.removeMessage(PDEUIMessages.GeneralInfoSection_IdWarning); |
118 |
} |
104 |
} |
119 |
} |
105 |
|
120 |
|
106 |
private void createVersionEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { |
121 |
private void createVersionEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { |