After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 610 B |
After Width: | Height: | Size: 602 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 774 B |
After Width: | Height: | Size: 774 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.7 KiB |
@ -1,21 +1,37 @@ |
|||||||
package com.fr.design.mainframe.widget.ui; |
package com.fr.design.mainframe.widget.ui; |
||||||
|
|
||||||
import com.fr.design.designer.creator.XCreator; |
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.designer.creator.XWParameterLayout; |
||||||
|
import com.fr.design.file.HistoryTemplateListCache; |
||||||
|
import com.fr.design.mainframe.EastRegionContainerPane; |
||||||
|
import com.fr.design.mainframe.JForm; |
||||||
|
|
||||||
/** |
/** |
||||||
* Created by kerry on 2017/9/30. |
* Created by kerry on 2017/9/30. |
||||||
*/ |
*/ |
||||||
public class WidgetBasicPropertyPaneFactory { |
public class WidgetBasicPropertyPaneFactory { |
||||||
|
|
||||||
public static FormBasicPropertyPane createBasicPropertyPane(XCreator xCreator){ |
public static FormBasicPropertyPane createBasicPropertyPane(XCreator xCreator) { |
||||||
if(xCreator.supportSetVisible() && xCreator.supportSetEnable()){ |
freshPropertyMode(xCreator); |
||||||
|
if (xCreator.supportSetVisible() && xCreator.supportSetEnable()) { |
||||||
return new FormBasicWidgetPropertyPane(); |
return new FormBasicWidgetPropertyPane(); |
||||||
} |
} |
||||||
if(xCreator.supportSetVisible()){ |
if (xCreator.supportSetVisible()) { |
||||||
return new BasicSetVisiblePropertyPane(); |
return new BasicSetVisiblePropertyPane(); |
||||||
}else{ |
} else { |
||||||
return new FormBasicPropertyPane(); |
return new FormBasicPropertyPane(); |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
|
private static void freshPropertyMode(XCreator xCreator) { |
||||||
|
if (!(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate() instanceof JForm)) { |
||||||
|
if (xCreator instanceof XWParameterLayout) { |
||||||
|
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_PARA); |
||||||
|
} else { |
||||||
|
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_PARA_WIDGET); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
} |
} |
||||||
|
@ -0,0 +1,50 @@ |
|||||||
|
package com.fr.start.module; |
||||||
|
|
||||||
|
import com.fr.design.constants.DesignerLaunchStatus; |
||||||
|
import com.fr.event.EventDispatcher; |
||||||
|
import com.fr.invoke.Reflect; |
||||||
|
import com.fr.workspace.WorkContext; |
||||||
|
import com.fr.workspace.Workspace; |
||||||
|
import org.easymock.EasyMock; |
||||||
|
import org.junit.Assert; |
||||||
|
import org.junit.Test; |
||||||
|
import org.junit.runner.RunWith; |
||||||
|
import org.powermock.api.easymock.PowerMock; |
||||||
|
import org.powermock.core.classloader.annotations.PrepareForTest; |
||||||
|
import org.powermock.modules.junit4.PowerMockRunner; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Lucian.Chen |
||||||
|
* @version 10.0 |
||||||
|
* Created by Lucian.Chen on 2021/1/7 |
||||||
|
*/ |
||||||
|
@RunWith(PowerMockRunner.class) |
||||||
|
@PrepareForTest({WorkContext.class}) |
||||||
|
public class DesignerWorkspaceProviderTest { |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testPluginErrorRemind() { |
||||||
|
|
||||||
|
try { |
||||||
|
Workspace workspace = EasyMock.mock(Workspace.class); |
||||||
|
EasyMock.expect(workspace.isLocal()).andReturn(false).once(); |
||||||
|
PowerMock.mockStatic(WorkContext.class); |
||||||
|
EasyMock.expect(WorkContext.getCurrent()).andReturn(workspace).anyTimes(); |
||||||
|
|
||||||
|
EasyMock.replay(workspace); |
||||||
|
PowerMock.replayAll(); |
||||||
|
|
||||||
|
DesignerWorkspaceProvider provider = new DesignerWorkspaceProvider(); |
||||||
|
Reflect.on(provider).call("pluginErrorRemind"); |
||||||
|
EventDispatcher.fire(DesignerLaunchStatus.STARTUP_COMPLETE); |
||||||
|
|
||||||
|
EasyMock.verify(workspace); |
||||||
|
PowerMock.verifyAll(); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
Assert.fail(e.getMessage()); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
} |