org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus Java Examples

The following examples show how to use org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IntermediateThrowMessageEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #2
Source File: BoundaryMessageEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #3
Source File: XORGatewayLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #4
Source File: IntermediateCatchMessageEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #5
Source File: ThrowLinkEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #6
Source File: SequenceFlowNameEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #7
Source File: InclusiveGatewayLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #8
Source File: IntermediateThrowSignalEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #9
Source File: StartSignalEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #10
Source File: TaskNameEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #11
Source File: ScriptTaskLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #12
Source File: ActivityNameEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #13
Source File: ScriptTaskLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #14
Source File: ServiceTaskLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #15
Source File: EndMessageEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #16
Source File: CallActivityNameEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #17
Source File: TaskName2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #18
Source File: SendTaskLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #19
Source File: IntermediateErrorCatchEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #20
Source File: StartEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #21
Source File: MessageFlowLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #22
Source File: ActivityName2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #23
Source File: SubProcessEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #24
Source File: ANDGatewayLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #25
Source File: StartEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #26
Source File: StartMessageEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #27
Source File: SubProcessEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #28
Source File: PoolNameEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #29
Source File: IntermediateCatchTimerEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}
 
Example #30
Source File: TextAnnotationText2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
	return new ICellEditorValidator() {

		public String isValid(final Object value) {
			if (value instanceof String) {
				final EObject element = getParserElement();
				final IParser parser = getParser();
				try {
					IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
							.runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {

								public void run() {
									setResult(
											parser.isValidEditString(new EObjectAdapter(element), (String) value));
								}
							});
					return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
				} catch (InterruptedException ie) {
					ie.printStackTrace();
				}
			}

			// shouldn't get here
			return null;
		}
	};
}