Java Code Examples for org.eclipse.jface.dialogs.MessageDialog.CONFIRM

The following are Jave code examples for showing how to use CONFIRM of the org.eclipse.jface.dialogs.MessageDialog class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Hydrograph   File: TransformWidget.java   Source Code and License Vote up 6 votes
/** 
 * @param inputLinkSchema
 * @param currentCompSchema
 */
private boolean compareSchemaFields(List<GridRow> inputLinkSchema, List<GridRow> currentCompSchema){
	for(int index = 0; index < currentCompSchema.size() - 1; index++){
		for(GridRow gridRow : inputLinkSchema){
			if(StringUtils.equals(gridRow.getFieldName(), currentCompSchema.get(index).getFieldName())){
				if(!StringUtils.equals(gridRow.getDataTypeValue(), currentCompSchema.get(index).getDataTypeValue())){
					MessageDialog dialog = new MessageDialog(new Shell(),
							"Warning", null,"Output Schema is updated,Do you want to continue with changes?", MessageDialog.CONFIRM,
							new String[] {"Yes", "No"}, 0);
					int dialogResult =dialog.open();
					if(dialogResult == 0){
						return true;
					}else{
						return false;
					}
				}
			}
		}
	}
	return true;
}
 
Example 2
Project: Hydrograph   File: ELTSchemaGridWidget.java   Source Code and License Vote up 6 votes
private void propagateInternalSchema() {
 if (schemaGridRowList != null) {
	 if (SchemaSyncUtility.INSTANCE.isAutoSchemaSyncAllow(getComponent()
			 .getComponentName())) {

		 if (SchemaSyncUtility.INSTANCE.isAutoSyncRequiredInMappingWidget(getComponent(),
				 schemaGridRowList)) {

			 MessageDialog dialog = new MessageDialog(new Shell(), Constants.SYNC_WARNING, null, Constants.SCHEMA_NOT_SYNC_MESSAGE, MessageDialog.CONFIRM, new String[] { Messages.SYNC_NOW, Messages.MANUAL_SYNC }, 0);
			 if (dialog.open() == 0) {
				 if(isSchemaUpdated)
				 SchemaSyncUtility.INSTANCE.pushSchemaToMapping(
						 getComponent(), schemaGridRowList);
				 else
				 updateSchemaWithPropogatedSchema(true);	 
			 }
		 }
	 }

 }
}
 
Example 3
Project: Hydrograph   File: SchemaSyncUtility.java   Source Code and License Vote up 5 votes
public void autoSyncSchema(Schema SchemaForInternalPropagation,Component component,List<AbstractWidget> widgets) {
	if (SchemaSyncUtility.INSTANCE.isAutoSyncRequiredInSchemaTab(
			SchemaForInternalPropagation.getGridRow(),
			(Schema) component.getProperties().get(Constants.SCHEMA_PROPERTY_NAME))) {
		MessageDialog dialog = new MessageDialog(new Shell(),
				Constants.SYNC_WARNING, null,
				Constants.SCHEMA_NOT_SYNC_MESSAGE, MessageDialog.CONFIRM,
				new String[] { Messages.SYNC_NOW, Messages.MANUAL_SYNC }, 0);
		if (dialog.open() == 0) {
			getSchemaGridWidget(widgets).updateSchemaWithPropogatedSchema(false);
		}
	}
}