|
Lines 45-51
Link Here
|
| 45 |
import org.eclipse.pde.internal.core.schema.SchemaRootElement; |
45 |
import org.eclipse.pde.internal.core.schema.SchemaRootElement; |
| 46 |
import org.eclipse.pde.internal.core.schema.SchemaSimpleType; |
46 |
import org.eclipse.pde.internal.core.schema.SchemaSimpleType; |
| 47 |
import org.eclipse.pde.internal.core.util.CoreUtility; |
47 |
import org.eclipse.pde.internal.core.util.CoreUtility; |
| 48 |
import org.eclipse.pde.internal.core.util.IdUtil; |
|
|
| 49 |
import org.eclipse.pde.internal.ui.IHelpContextIds; |
48 |
import org.eclipse.pde.internal.ui.IHelpContextIds; |
| 50 |
import org.eclipse.pde.internal.ui.IPDEUIConstants; |
49 |
import org.eclipse.pde.internal.ui.IPDEUIConstants; |
| 51 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
50 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
|
Lines 380-388
Link Here
|
| 380 |
} |
379 |
} |
| 381 |
public boolean checkFieldsFilled() { |
380 |
public boolean checkFieldsFilled() { |
| 382 |
boolean empty = fIdText.getText().length() == 0 || fNameText.getText().length() == 0; |
381 |
boolean empty = fIdText.getText().length() == 0 || fNameText.getText().length() == 0; |
| 383 |
if (!empty) { |
|
|
| 384 |
empty = !IdUtil.isValidSimpleID(fIdText.getText()); |
| 385 |
} |
| 386 |
if (!empty && isPluginIdNeeded()) { |
382 |
if (!empty && isPluginIdNeeded()) { |
| 387 |
empty = getPluginId().length() == 0 || fSchemaText.getText().length() == 0 ; |
383 |
empty = getPluginId().length() == 0 || fSchemaText.getText().length() == 0 ; |
| 388 |
} |
384 |
} |
|
Lines 391-414
Link Here
|
| 391 |
return !empty; |
387 |
return !empty; |
| 392 |
} |
388 |
} |
| 393 |
|
389 |
|
| 394 |
public boolean isInvalidValidId() { |
|
|
| 395 |
return fIdText.getText().length()>0 && !IdUtil.isValidSimpleID(fIdText.getText()); |
| 396 |
} |
| 397 |
|
| 398 |
private void validatePage() { |
390 |
private void validatePage() { |
| 399 |
if (!validateContainer()) |
391 |
if (!validateContainer()) |
| 400 |
return; |
392 |
return; |
| 401 |
boolean isFilled = checkFieldsFilled(); |
393 |
boolean isFilled = checkFieldsFilled(); |
| 402 |
String message = null; |
394 |
String message = getInvalidIdMessage(); |
| 403 |
if (isInvalidValidId()) |
395 |
if (message == null && !isFilled) { |
| 404 |
message = PDEUIMessages.BaseExtensionPoint_malformedId; |
|
|
| 405 |
else if (!isFilled) { |
| 406 |
if (isPluginIdNeeded()) |
396 |
if (isPluginIdNeeded()) |
| 407 |
message = PDEUIMessages.BaseExtensionPoint_missingId; |
397 |
message = PDEUIMessages.BaseExtensionPoint_missingId; |
| 408 |
else |
398 |
else |
| 409 |
message = PDEUIMessages.BaseExtensionPoint_noPlugin_missingId; |
399 |
message = PDEUIMessages.BaseExtensionPoint_noPlugin_missingId; |
| 410 |
} |
400 |
} |
| 411 |
setPageComplete(isFilled); |
401 |
setPageComplete(isFilled && isComplete()); |
| 412 |
setMessage(message, IMessageProvider.WARNING); |
402 |
setMessage(message, IMessageProvider.WARNING); |
| 413 |
} |
403 |
} |
| 414 |
private boolean validateContainer() { |
404 |
private boolean validateContainer() { |
|
Lines 486-489
Link Here
|
| 486 |
path = path.replaceFirst(workspacePath, ""); //$NON-NLS-1$ |
476 |
path = path.replaceFirst(workspacePath, ""); //$NON-NLS-1$ |
| 487 |
return path; |
477 |
return path; |
| 488 |
} |
478 |
} |
|
|
479 |
public String getInvalidIdMessage() { |
| 480 |
// No validation done (other than making sure id is not blank) |
| 481 |
return null; |
| 482 |
} |
| 483 |
protected boolean isComplete() { |
| 484 |
return true; |
| 485 |
} |
| 489 |
} |
486 |
} |