public void run() { document.getTransactionManager().readAccess(new Runnable() { public void run() { refreshModel(); } }); } });
public void run () { if (designDocument != null) { designDocument.getTransactionManager ().readAccess (new Runnable () { public void run () { ScreenAccessController accessController = designDocument.getListenerManager ().getAccessController (ScreenAccessController.class); if (accessController != null) accessController.setScreenSize (deviceScreenSize); } }); } } });
public void actionPerformed(ActionEvent e) { document.getTransactionManager().readAccess(new Runnable() { public void run() { DesignComponent component = (DesignComponent) editedScreenCombo.getSelectedItem(); EditedScreenSupport.getSupportForDocument(document).setEditedScreenComponentID(component != null ? component.getComponentID() : -1); } }); } };
private String getDecodeValue(final PropertyValue value) { final String[] decodeValue = new String[1]; if (component != null && component.get() != null) { final DesignDocument document = component.get().getDocument(); document.getTransactionManager().readAccess(new Runnable() { public void run() { decodeValue[0] = getComponentDisplayName(value.getComponent()); } }); } return decodeValue[0]; }
@Override public boolean isEnabled() { component.get().getDocument().getTransactionManager().readAccess(new Runnable() { public void run() { if (component.get().getDocument().getSelectedComponents().size() > 1) isEnabled = false; else isEnabled = true; } }); return isEnabled; }
private void reload() { if (component == null || component.get() == null) return; final DesignDocument document = component.get().getDocument(); document.getTransactionManager().readAccess(new Runnable() { public void run() { ScreenDeviceInfo deviceInfo = getScreenDeviceInfo(); if (deviceInfo != null) { ScreenDisplayPresenter presenter = component.get().getPresenter(ScreenDisplayPresenter.class); presenter.reload(deviceInfo); } } }); }
private PropertyValue readDefaultPropertyValue(final String propertyName) { component.get().getDocument().getTransactionManager().readAccess(new Runnable() { public void run() { propertyValue = component.get().getComponentDescriptor().getPropertyDescriptor(propertyName).getDefaultValue(); } }); return propertyValue; }
private int getInputMode() { final int[] inputMode = new int[]{DateFieldCD.VALUE_DATE_TIME}; if (component != null && component.get() != null) { final DesignComponent _component = component.get(); _component.getDocument().getTransactionManager().readAccess(new Runnable() { public void run() { PropertyValue pv = _component.readProperty(DateFieldCD.PROP_INPUT_MODE); if (pv.getKind() == PropertyValue.Kind.VALUE) { inputMode[0] = MidpTypes.getInteger(pv); } } }); } return inputMode[0]; }
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { final JLabel renderer = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (value instanceof DesignComponent) { final DesignComponent component = (DesignComponent) value; component.getDocument().getTransactionManager().readAccess(new Runnable() { public void run() { InfoPresenter presenter = component.getPresenter(InfoPresenter.class); renderer.setText(presenter.getDisplayName(InfoPresenter.NameType.PRIMARY)); renderer.setIcon(new ImageIcon(presenter.getIcon(InfoPresenter.IconType.COLOR_16x16))); } }); } return renderer; }
public void update (JComponent visualRepresentation, final DesignDocument document) { if (visualRepresentation == null || document == null) return; final JList list = (JList) ((JScrollPane) visualRepresentation).getViewport ().getView (); document.getTransactionManager ().readAccess (new Runnable() { public void run () { DefaultListModel model = (DefaultListModel) list.getModel (); model.removeAllElements (); DesignComponent rootComponent = document.getRootComponent (); if (rootComponent != null) analyze (model, rootComponent); } }); }
public void saveDocument () { waitDocumentLoaded (); final DesignDocument savingDocument; synchronized (this) { savingDocument = document; } savingDocument.getTransactionManager ().readAccess (new Runnable () { public void run () { DocumentSave.save (context, savingDocument); } }); }
protected PropertyValue readPropertyValue(final DesignComponent component, final String propertyName) { assert component != null; component.getDocument().getTransactionManager().readAccess(new Runnable() { public void run() { propertyValue = component.readProperty(propertyName); } }); return propertyValue; }
public GlobalRepository getGameDesign() { final DesignDocument doc = this.getDesignDocument(); if (doc == null) { return null; } final GlobalRepository[] gameDesign = {null}; doc.getTransactionManager().readAccess(new Runnable() { public void run () { GameAccessController controller = doc.getListenerManager().getAccessController(GameAccessController.class); gameDesign[0] = controller.getGameDesign(); } }); return gameDesign[0]; }
private ScreenDeviceInfo getDeviceInfo() { final ScreenDeviceInfo[] screenDevice = new ScreenDeviceInfo[1]; final DesignDocument document = controller.getDocument(); if (document == null) return null; document.getTransactionManager().readAccess(new Runnable() { public void run() { DesignComponent rootComponent = document.getRootComponent(); ScreenDeviceInfoPresenter presenter = rootComponent.getPresenter(ScreenDeviceInfoPresenter.class); assert (presenter != null) : "No ScreenDevice attached to the root component"; //NOI18N screenDevice[0] = presenter.getScreenDeviceInfo(); } }); return screenDevice[0]; }
public static boolean singleSelectionEditAsTextOnly() { final DesignDocument document = ActiveDocumentSupport.getDefault().getActiveDocument(); if (document == null) return false; final boolean[] canEditAsText = new boolean[1]; document.getTransactionManager().readAccess(new Runnable() { public void run() { canEditAsText[0] = !(document.getSelectedComponents().size() > 1); } }); return canEditAsText[0]; }
public boolean isEnabled() { final DesignComponent activeComponent = getActiveComponent(); if (activeComponent == null) return false; final boolean[] ret = new boolean[] { false }; activeComponent.getDocument().getTransactionManager().readAccess(new Runnable() { public void run() { ret[0] = activeComponent.getPresenter(GoToSourcePresenter.class) != null; } }); return ret[0]; }
public boolean isAcceptable(final Point point, final Transferable transferable, final AcceptSuggestion suggestion) { final DesignDocument document = devicePanel.getController().getDocument(); if (document == null) return false; final boolean[] ret = new boolean[1]; document.getTransactionManager().readAccess(new Runnable() { public void run() { DesignComponent component = devicePanel.getDesignComponentAt(point); ret[0] = AcceptSupport.isAcceptable(component, transferable, suggestion); } }); return ret[0]; }
@Override public boolean isEnabled() { final DesignDocument activeDocument = ActiveDocumentSupport.getDefault ().getActiveDocument (); if (activeDocument == null) return false; final boolean[] ret = new boolean[1]; activeDocument.getTransactionManager().readAccess(new Runnable() { public void run() { ret[0] = DeleteSupport.canDeleteAsUser (activeDocument, activeDocument.getSelectedComponents ()); } }); return ret[0]; }
public void popupMenu(final MouseEvent e) { final DesignDocument document = devicePanel.getController().getDocument(); if (document == null) return; document.getTransactionManager().readAccess(new Runnable() { public void run() { DesignComponent component = devicePanel.getDesignComponentAt(e.getPoint()); if (component == null) return; JPopupMenu menu = Utilities.actionsToPopup(ActionsSupport.createActionsArray(component), TopPanel.this); menu.show(TopPanel.this, e.getX(), e.getY()); } }); }
public String getHtmlDisplayName() { if (getDesignPropertyDescriptor().getPropertyNames().isEmpty()) return getDesignPropertyDescriptor().getPropertyDisplayName(); getDesignPropertyDescriptor().getComponent().getDocument().getTransactionManager().readAccess(new Runnable() { public void run() { if (getDesignPropertyDescriptor().getComponent().isDefaultValue(getDesignPropertyDescriptor().getPropertyNames().iterator().next())) displayName = getDesignPropertyDescriptor().getPropertyDisplayName(); else displayName = "<b>" + getDesignPropertyDescriptor().getPropertyDisplayName()+"</b>"; // NOI18N } }); return displayName; }