copy content from popup - popup

How to achieve opportunity copy content from popup-open?
In OpenLayers-2 I could select part of content popup and copy it.
In OL-3 miss this option.
Popup-open has disable default option select content from popup.

I think this is related to this issue: https://github.com/openlayers/openlayers/issues/6720
However I think setting user-select: auto for the .ol-selectable class doesn't have the desired effect as according to the spec the value of auto will results in none if the computed value of user-select on the parent of this element is none, which it is in OpenLayers due to user-select being set on the .ol-viewport.
Try adding this CSS to your page after the OpenLayers CSS is loaded:
.ol-selectable {
-webkit-touch-callout: text;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}

Related

How to change layout of sap.uxap.ObjectPage Blocks

Demo
I have 2 + 5 blocks here, in small screen, each panel in blocks are in full width.
But in large screen, blocks are in 3:3:3 or 6:3. I want them all in a single row.
each section is contained in <div class="sapUiRespGridSpanL4 sapUiRespGridSpanM6 sapUiRespGridSpanS12 sapUiRespGridSpanXL3">
How to change it to class="sapUiRespGridSpanL12 sapUiRespGridSpanM12 sapUiRespGridSpanS12 sapUiRespGridSpanXL12" ?
I've tried to add layout in Panel, but not working.
Refrence:
sap.uxap.ObjectPageLayout Documentation
layout of blocks, blocks are in the same color, hard to specify
Finally after 1.5 hours figured out
Reason: Blocks will have to be extended from BlockBase to apply columnLayout.
Extending the BlockBase:
sap.ui.define(["sap/uxap/BlockBase"], function (BlockBase) {
"use strict";
var BlockPanel = BlockBase.extend("sap.uxap.sample.ObjectPageSubSectionSized.blocks.BlockPanel", {
metadata: {
/* no additional views provided */
}
});
return BlockPanel;
});
Then create a view and controller using the above new ui5 extended control. Use that in your page with columnLayout
xmlns:sample="sap.uxap.sample.ObjectPageSubSectionSized.blocks"
...
...
<uxap:blocks>
<sample:BlockPanel columnLayout="4"/>
</uxap:blocks>
columnLayout can't be applied if you don't extend block base. (which is really pathetic design). Nevertheless, values range from 1-4 and "auto".
Created working plnkr here
How to build custom SAPUI control?
You can wrap the target controls up with sap.uxap.BlockBase[API]. BlockBase controls are intended to be used inside sap.uxap.ObjectPageSubSection (hence the name <blocks>) and support customizing the grid spans with the property columnLayout.
Here is a demo: https://embed.plnkr.co/lSrDk9/?show=view%2FHome.view.xml,preview
<uxap:ObjectPageSubSection>
<block:MyBlock columnLayout="4"/>
<block:MyBlock columnLayout="4"/>
</uxap:ObjectPageSubSection>
Provide a not elegant, but very fast way: Overwrite CSS
<uxap:ObjectPageSubSection class="fullWidthPanel">
/* CSS specificity */
.fullWidthPanel .sapUiRespGrid.sapUiRespGridHSpace1 > div {
width: 98.88888889%;
width: -webkit-calc(100% - 1rem);
width: calc(100% - 1rem)
}

How to set the visibility for row drag default icon in ag-grid angular 2+

In gridColumns i am setting the rowDrag: true. This creates a default icon for all the rows having children or single rows. But i wanted to have this icon only for particular rows by setting the visibility of a drag icon as hidden.
More over if i populate rowDrag true or false conditionally, then rows for which i dont want drag icon, icon won't come but its breaking the alignment. That's why i want something explicitly where i can set the rowDrag for all rows as true and then explicitly set the visibility as hidden.
Please help me in this case. not finding any solution.
If you just want to hide the drag icon you need to override the CSS. Just assign css class to the rows you want to hide and then in the CSS file make the visibility as hidden.
Assign class as below
this.rowClassRules = {
"hide-row-drag-class": function(params) {
if (params.node.rowIndex % 2 == 0) {
return true;
}
}
};
Override CSS file
.yourTheme .yourClass .ag-row-drag{
visibility: hidden;
}
The above code assigns a CSS class to all odd rows and then will hide the row drag icon based on the CSS
https://plnkr.co/edit/dIfq96KHFmEx25BnC5ze?p=preview

How to user custom Drag Appearance in smart gwt

I am trying to user Custom Drag appearance in smart gwt. how can i implement it.
Current when using DragAppearance.TRACKER its show on 10px square i want a lable with caption Drag to Lineup.
vLayout1.setDragAppearance(DragAppearance.TRACKER);
vLayout1.setCanHover(true);
vLayout1.setCursor(Cursor.HAND);
I hope, the following links will help you
https://github.com/moravianlibrary/MEditor/blob/master/editor-editation/src/main/java/cz/mzk/editor/client/view/ModifyView.java#L1100:L1104
https://github.com/moravianlibrary/MEditor/blob/master/editor-common/editor-common-client/src/main/java/cz/mzk/editor/client/view/other/EditorDragMoveHandler.java
Override BaseWidget.setDragTracker and provide required content using EventHandler.setDragTracker.
VLayout vLayout1 = new VLayout() {
#Override
protected boolean setDragTracker() {
EventHandler.setDragTracker("<pre>Drag to Lineup</pre>");
return false;
}
};
vLayout1.setCanDrop(true);
vLayout1.setCanDrag(true);
vLayout1.setDragAppearance(DragAppearance.TRACKER);
EventHandler.setDragTracker accepts any valid html code and <pre/> tags were used above to avoid word wrap.
Check following sample in SmartGWT showcase:
http://www.smartclient.com/smartgwt/showcase/#effects_dd_tracker

How to modify the button width and height in ActionCell of GWT

the button is automatically generated by the ActionCell in gwt, I want to change the width and height of the generated button, any method?
I chekced the ActionCell has no any addStyleName to allow me to change the css of the button.
You have several options.
If you use this cell in a CellTable or DataGrid, set the style on a column which is built using ActionCell:
myColumn.setCellStyleNames("myButtonStyle");
You can also set this style on the parent element which includes ActionCell:
.myButtonStyle button {
background: red;
}
or, even more specific, if necessary:
.myButtonStyle td button {
background: red;
}

TabLayoutPanel align tab to the right

I am using a TabLayoutPanel in GWT and I want to have the last tab show up on the right side of the page. Is it possible to do this?
Common idea:
set tab container width to "auto" instead of predefined "16384px"
set "float: right" css property to last tab
move last tab to firts position
public void onModuleLoad() {
.....
// init TabLayoutPanel
.....
Widget rightTab = tabPanel.getTabWidget(0).getParent();
DOM.setStyleAttribute(rightTab.getElement(), "float", "right");
Widget tabBar = rightTab.getParent();
tabBar.setWidth("auto");
tabPanel.selectTab(1);
}
If you want to align all tabs to right try this:
.gwt-TabBar .gwt-TabBarFirst {
width: 100%;
}
.gwt-TabBar .gwt-TabBarRest {
width: 4px;
}
.gwt-TabBar .gwt-TabBarFirst-wrapper {
width: 100%;
}
Short Answer - NO.
I drilled down to the source at GWT 2.3 and AFAIK it easier to build your own composite from TabBar and StackLayoutPanel than start fighting this implementation.
Just to save you an effort it cannot be centered easily too.
I am sorry it is like this.
it all hardcoded...
private static final int BIG_ENOUGH_TO_NOT_WRAP = 16384;
private final FlowPanel tabBar = new FlowPanel();
...
tabBar.getElement().getStyle().setWidth(BIG_ENOUGH_TO_NOT_WRAP, Unit.PX);
Why not pure CSS solution ? It is good practice to separate your code from design.
.gwt-TabLayoutPanelTabs {
width: auto!important;
}
.gwt-TabLayoutPanelTab {
float: right;
}
Remember that your tabs will come in reverse order (first added will be first on the right)
It is possible and will be very easy if you create your own tab.Just create an png image of tab shape (which is having rounded corner at top).Write one css rule.Take one FlextTable and apply that css to each cell that will be your tabs and then add that FlexTable into another mainTable. So in your mainTable in first row there will be tabFlexTable and in second row whatever you want to display after selecting particular tab.So for the first row apply horizontal alignment to right. This the way and same way I am also using in my professional projects.