Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Designer preferences do not open in IDEA #2014

Closed
anssit opened this issue Mar 15, 2019 · 3 comments
Closed

Designer preferences do not open in IDEA #2014

anssit opened this issue Mar 15, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@anssit
Copy link
Contributor

anssit commented Mar 15, 2019

Steps to reproduce

Open File >> Settings >> Vaadin Designer Project page

Actual behavior

A permanent loading animation. In this way it is
impossible to change the base theme (Lumo to Material) the designer
shall use.

Expected behavior

Settings page opens normally and theme can be configured.

IDE, Designer and OS version

OS: Windows 10 10.0 amd64
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/64.0.3282.24 Safari/537.36
Java: 1.8.0_152-release
IntelliJ: IntelliJ IDEA - 2018.3.5 - IC-183.5912.21
Designer: 4.2.1
Vaadin: 0.0.0

Stack trace

Error: java.lang.NullPointerException 
at sun.swing.SwingUtilities2.getFontCharsWidth(SwingUtilities2.java:945) 
at javax.swing.text.Utilities.getTabbedTextWidth(Utilities.java:352) 
at javax.swing.text.Utilities.getTabbedTextWidth(Utilities.java:281) 
at javax.swing.text.Utilities.getTabbedTextWidth(Utilities.java:248) 
at javax.swing.text.PlainView.getLineWidth(PlainView.java:801) 
at javax.swing.text.PlainView.updateDamage(PlainView.java:699) 
at javax.swing.text.PlainView.insertUpdate(PlainView.java:583) 
at 
javax.swing.plaf.basic.BasicTextUI$RootView.insertUpdate(BasicTextUI.java:1656) 
at 
javax.swing.plaf.basic.BasicTextUI$UpdateHandler.insertUpdate(BasicTextUI.java:1930) 
at 
javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:201) 
at 
javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:748) 
at 
javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:707) 
at javax.swing.text.PlainDocument.insertString(PlainDocument.java:130) 
at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:669) 
at javax.swing.text.JTextComponent.setText(JTextComponent.java:1717) 
at 
com.vaadin.designer2.intellij.settings.ProjectSettingsForm.$$$setupUI$$$(ProjectSettingsForm.java) 
at 
com.vaadin.designer2.intellij.settings.ProjectSettingsForm.<init>(ProjectSettingsForm.java:113) 
at 
com.vaadin.designer2.intellij.settings.ProjectSettingsConfigurable.createComponent(ProjectSettingsConfigurable.java:71) 
at 
com.intellij.openapi.options.ex.ConfigurableWrapper.createComponent(ConfigurableWrapper.java:163) 
at 
com.intellij.openapi.options.ex.ConfigurableCardPanel.lambda$createConfigurableComponent$0(ConfigurableCardPanel.java:73) 
at 
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:973) 
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57) 
at 
com.intellij.openapi.options.ex.ConfigurableCardPanel.createConfigurableComponent(ConfigurableCardPanel.java:69) 
at 
com.intellij.openapi.options.ex.ConfigurableCardPanel.create(ConfigurableCardPanel.java:55) 
at 
com.intellij.openapi.options.newEditor.ConfigurableEditor$1.create(ConfigurableEditor.java:57) 
at 
com.intellij.openapi.options.newEditor.ConfigurableEditor$1.create(ConfigurableEditor.java:54) 
at com.intellij.ui.CardLayoutPanel.createValue(CardLayoutPanel.java:88) 
at com.intellij.ui.CardLayoutPanel.select(CardLayoutPanel.java:116) 
at com.intellij.ui.CardLayoutPanel.lambda$null$0(CardLayoutPanel.java:132) 
at 
com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315) 
at 
com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435) 
at 
com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419) 
at 
com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403) 
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) 
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762) 
at java.awt.EventQueue.access$500(EventQueue.java:98) 
at java.awt.EventQueue$3.run(EventQueue.java:715) 
at java.awt.EventQueue$3.run(EventQueue.java:709) 
at java.security.AccessController.doPrivileged(Native Method) 
at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) 
at java.awt.EventQueue.dispatchEvent(EventQueue.java:732) 
at 
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719) 
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:668) 
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363) 
at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) 
at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) 
at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109) 
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190) 
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235) 
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
at java.awt.Dialog.show(Dialog.java:1077) 
at 
com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:698) 
at 
com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:430) 
at 
com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1681) 
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1630) 
at 
com.intellij.openapi.options.newEditor.SettingsDialog.lambda$show$0(SettingsDialog.java:70) 
at 
com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88) 
at 
com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:153) 
at 
com.intellij.openapi.options.newEditor.SettingsDialog.show(SettingsDialog.java:70) 
at 
com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:84) 
at 
com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:54) 
at 
com.intellij.ide.actions.ShowSettingsAction.actionPerformed(ShowSettingsAction.java:41) 
at 
com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:258) 
at 
com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:275) 
at 
com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:287) 
at 
com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:283) 
at 
com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:106) 
at 
com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:277) 
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) 
at 
com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:111) 
at 
com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88) 
at 
com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:111) 
at 
com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:120) 
at 
com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122) 
at 
com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:111) 
at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:524) 
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:35) 
at 
com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:546) 
at java.awt.Component.processMouseEvent(Component.java:6548) 
at javax.swing.JComponent.processMouseEvent(JComponent.java:3325) 
at java.awt.Component.processEvent(Component.java:6313) 
at java.awt.Container.processEvent(Container.java:2237) 
at java.awt.Component.dispatchEventImpl(Component.java:4903) 
at java.awt.Container.dispatchEventImpl(Container.java:2295) 
at java.awt.Component.dispatchEvent(Component.java:4725) 
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889) 
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526) 
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281) 
at java.awt.Window.dispatchEventImpl(Window.java:2746) 
at java.awt.Component.dispatchEvent(Component.java:4725) 
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764) 
at java.awt.EventQueue.access$500(EventQueue.java:98) 
at java.awt.EventQueue$3.run(EventQueue.java:715) 
at java.awt.EventQueue$3.run(EventQueue.java:709) 
at java.security.AccessController.doPrivileged(Native Method) 
at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) 
at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) 
at java.awt.EventQueue$4.run(EventQueue.java:737) 
at java.awt.EventQueue$4.run(EventQueue.java:735) 
at java.security.AccessController.doPrivileged(Native Method) 
at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) 
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734) 
at 
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719) 
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:664) 
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363) 
at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) 
at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) 
at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) 
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) 
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) 
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
@anssit
Copy link
Contributor Author

anssit commented Mar 15, 2019

Designer stores the theme configuration into a file so that you can share it with other developers via your version control system. You can create and edit that file manually to work around this problem.

At your project's root create a folder called .vaadin and a folder called designer under that. Then, create the file project-settings.json in that folder manually and set its contents to:

{
  "flow.theme.component": "Material",
  "flow.theme.component.palette": "light",
  "flow.theme.application": "src/main/webapp/frontend/styles/shared-styles.html"
}

Designer reads this file (./.vaadin/designer/project-settings.json) when the project is opened, so if you had your project open, you need to close and reopen it for the changes to take effect. The preferences page would update the theme without requiring you to reopen the project but since it is not working, a reopen is needed.

The allowed values for "flow.theme.component" in Designer 4.2.1 are "Lumo", "Material", and "None", and for the "flow.theme.component.palette", "light" and "dark". "flow.theme.application" can be set to the path of the shared-styles.html file or set to the value "None" in which case no application theme file is loaded.

@anssit
Copy link
Contributor Author

anssit commented Mar 15, 2019

I can reproduce the issue in Windows with IntelliJ IDEA 2018.3.4 and 2018.3.5 with Designer 4.2.1. I can not reproduce the issue on macOS.

@anssit anssit added the windows label Mar 15, 2019
@anssit
Copy link
Contributor Author

anssit commented Mar 15, 2019

Going back to Designer 4.2.0 solves the issue. A change in 4.2.1 has caused this problem.

4.2.0 can be downloaded from https://plugins.jetbrains.com/plugin/9519-vaadin-designer and installed with the "Install plugin from disk" option in IntelliJ IDEA plugins preference page (under the cogwheel menu in latest IDEA).

@tanbt tanbt self-assigned this Mar 18, 2019
@szolo szolo added this to the 4.2.2 milestone Apr 11, 2019
@szolo szolo closed this as completed Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants