public void run() { try { moved = s.tryAcquire(2, 4, TimeUnit.SECONDS); } catch (InterruptedException e) { JPADiagramEditorPlugin.logError("Thread interrupted", e); // $NON-NLS-1$ } }
public void execute( ICustomContext context, String newName, ICompilationUnit cu, PersistentType originalJPT) { IProject project = originalJPT.getJpaProject().getProject(); final Diagram d = ModelIntegrationUtil.getDiagramByProject(project); if (d == null) return; final JPAEditorDiagramTypeProvider provider = ModelIntegrationUtil.getProviderByDiagram(d.getName()); PictogramElement pe = provider.getFeatureProvider().getPictogramElementForBusinessObject(originalJPT); provider.getDiagramEditor().selectPictogramElements(new PictogramElement[] {null}); final Semaphore s = new Semaphore(0); ShowBusy showBusy = new ShowBusy(s); JPASolver.ignoreEvents = true; Command renameEntityCommand = new RenameEntityClass(originalJPT, newName); try { getJpaProjectManager().execute(renameEntityCommand, SynchronousUiCommandContext.instance()); } catch (InterruptedException e) { JPADiagramEditorPlugin.logError("Cannot delete attribute with name ", e); // $NON-NLS-1$ } BusyIndicator.showWhile(Display.getCurrent(), showBusy); JPASolver.ignoreEvents = false; provider.getDiagramEditor().setPictogramElementForSelection(pe); }
@Override public void run() { UpdateFromModel taskClass = new UpdateFromModel(); while (goOn) { try { Thread.sleep(PAUSE_DURATION); } catch (InterruptedException e) { JPADiagramEditorPlugin.logError("Thread sleep interruprted", e); // $NON-NLS-1$ } Display.getDefault().asyncExec(taskClass); } solver = null; featureProvider = null; }
public JPAEditorPreferenceInitializer() { store = JPADiagramEditorPlugin.getDefault().getPreferenceStore(); }