[JBoss JIRA] (ERT-709) [GTK] Incorrect behaviour of tree rendering on GTK after removing paint listener [EBZ#294300]
by Friendly Jira Robot (Jira)
Friendly Jira Robot created ERT-709:
---------------------------------------
Summary: [GTK] Incorrect behaviour of tree rendering on GTK after removing paint listener [EBZ#294300]
Key: ERT-709
URL: https://issues.jboss.org/browse/ERT-709
Project: Eclipse Release Train
Issue Type: Task
Components: Platform
Reporter: Friendly Jira Robot
If I'd like to add custom paint listener to my tree and than remove it, sometimes all text disappear. Actually, the problem is text foreground == white after removing paint listener.
Looks like the problem with Tree.drawForeground field: while custom rendering appear, Tree could cache this variable and then use invalid value when there are no custom painters (drawForeground value doesn't clear).
Following example reproduce my problem. You need to select the last one item in the tree, check "Enable custom painter" and then uncheck it -- all text will be white:
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.graphics.TextLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
public class TreePainter implements Listener {
private Tree tree;
private TextLayout textLayout;
TreePainter(Tree tree) {
this.tree = tree;
}
public void setListeners(boolean add) {
if (add) {
tree.addListener(SWT.EraseItem, this);
tree.addListener(SWT.PaintItem, this);
} else {
tree.removeListener(SWT.EraseItem, this);
tree.removeListener(SWT.PaintItem, this);
}
redraw();
}
@Override
public void handleEvent(Event event) {
switch (event.type) {
case SWT.PaintItem:
paint(event);
break;
case SWT.EraseItem:
erase(event);
break;
}
}
private void erase(Event event) {
event.detail &= ~(SWT.BACKGROUND | SWT.FOREGROUND | SWT.SELECTED | SWT.HOT);
}
private void paint(Event event) {
TreeItem item = (TreeItem) event.item;
GC gc = event.gc;
// remember colors to restore the GC later
Color oldForeground = gc.getForeground();
Color oldBackground = gc.getBackground();
int index = event.index;
Color foreground = item.getForeground(index);
if (foreground != null) {
gc.setForeground(foreground);
}
Color background = item.getBackground(index);
if (background != null) {
gc.setBackground(background);
}
if ((event.detail & SWT.SELECTED) != 0) {
gc.fillRectangle(item.getBounds(index));
}
Image image = item.getImage(index);
if (image != null) {
Rectangle imageBounds = item.getImageBounds(index);
if (imageBounds != null) {
Rectangle bounds = image.getBounds();
// center the image in the given space
int x = imageBounds.x
+ Math.max(0, (imageBounds.width - bounds.width) / 2);
int y = imageBounds.y
+ Math.max(0, (imageBounds.height - bounds.height) / 2);
gc.drawImage(image, x, y);
}
}
Rectangle textBounds = item.getTextBounds(index);
if (textBounds != null) {
TextLayout layout = getTextLayout();
layout.setText(item.getText(index));
layout.setFont(item.getFont(index));
Rectangle layoutBounds = layout.getBounds();
int x = textBounds.x;
int avg = (textBounds.height - layoutBounds.height) / 2;
int y = textBounds.y + Math.max(0, avg);
layout.draw(gc, x, y);
}
gc.setForeground(oldForeground);
gc.setBackground(oldBackground);
}
public void redraw() {
Rectangle rect = tree.getClientArea();
tree.redraw(rect.x, rect.y, rect.width, rect.height, true);
}
private TextLayout getTextLayout() {
if (textLayout == null) {
int orientation = tree.getStyle()
& (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT);
textLayout = new TextLayout(tree.getDisplay());
textLayout.setOrientation(orientation);
} else {
textLayout.setText("");
}
return textLayout;
}
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setBounds(10, 10, 800, 600);
shell.setLayout(new GridLayout());
final Tree tree = new Tree(shell, SWT.BORDER);
tree.setLinesVisible(true);
for (int i = 0; i < 5; i++) {
TreeItem item = new TreeItem(tree, SWT.NONE);
item.setText("item " + i);
for (int j = 0; j < 5; j++) {
TreeItem child = new TreeItem(item, SWT.NONE);
child.setText("item " + i + "-" + j);
}
}
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
final TreePainter painer = new TreePainter(tree);
final Button button = new Button(shell, SWT.CHECK);
button.setText("Enable custom painter");
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
painer.setListeners(button.getSelection());
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 1 month
[JBoss JIRA] (JBIDE-26559) Unable to deploy a Java EE 8 project on EAP 7.2
by Mattias Andersson (Jira)
[ https://issues.jboss.org/browse/JBIDE-26559?page=com.atlassian.jira.plugi... ]
Mattias Andersson commented on JBIDE-26559:
-------------------------------------------
This is the current configuration for 7.1
{code:xml}
<runtimeType
vendor="%enterpriseProviderName"
class="org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss71ServerRuntime"
description="%jboss.eap.version.71.description"
name="%jboss.eap.version.71.runtime.name"
id="org.jboss.ide.eclipse.as.runtime.eap.71"
version="7.1">
<moduleType types="jst.appclient" versions="5.0, 6.0,7.0"/>
<moduleType types="wst.web" versions="1.0,1.2,1.3,1.4"/>
<moduleType types="jst.web" versions="2.2, 2.3, 2.4, 2.5, 3.0,3.1"/>
<moduleType types="jst.ejb" versions="1.0, 1.1, 2.0, 2.1, 3.0, 3.1,3.2"/>
<moduleType types="jst.ear" versions="1.2, 1.3, 1.4, 5.0, 6.0,7.0"/>
<moduleType types="jst.connector" versions="1.0, 1.5, 1.6,1.7"/>
<moduleType types="jst.utility" versions="1.0"/>
<moduleType types="jboss.package" versions="1.0"/>
<moduleType types="jboss.singlefile" versions="1.0"/>
<moduleType types="jst.jboss.sar" versions="1.0"/>
<moduleType types="jbt.bpel.module" versions="1.1, 2.0"/>
<moduleType types="bpel.module" versions="1.1, 2.0"/>
<moduleType types="jboss.osgi" versions="1.0"/>
</runtimeType>
{code}
> Unable to deploy a Java EE 8 project on EAP 7.2
> -----------------------------------------------
>
> Key: JBIDE-26559
> URL: https://issues.jboss.org/browse/JBIDE-26559
> Project: Tools (JBoss Tools)
> Issue Type: Feature Request
> Components: server
> Affects Versions: 4.10.0.AM1
> Reporter: Mattias Andersson
> Priority: Critical
> Attachments: 53025554-63105e80-3461-11e9-8ec6-f7bf2f69f961.png
>
>
> Unable to deploy a Java EE 8 (servlet 4.0) project on EAP 7.2, it does not support version 4.0 of the J2EE Web module specification.
> The project implements a simple servlet war that imports the {{org.jboss.bom:jboss-eap-javaee8:7.2.0.GA:pom}}.
> I am using adapter {{3.6.2.v20190208-1835}} which I think is the latest.
> According to JBIDE-26307 the 7.1 server adapter should be be used for EAP 7.2.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 1 month
[JBoss JIRA] (JBIDE-26559) Unable to deploy a Java EE 8 project on EAP 7.2
by Mattias Andersson (Jira)
Mattias Andersson created JBIDE-26559:
-----------------------------------------
Summary: Unable to deploy a Java EE 8 project on EAP 7.2
Key: JBIDE-26559
URL: https://issues.jboss.org/browse/JBIDE-26559
Project: Tools (JBoss Tools)
Issue Type: Feature Request
Components: server
Affects Versions: 4.10.0.AM1
Reporter: Mattias Andersson
Attachments: 53025554-63105e80-3461-11e9-8ec6-f7bf2f69f961.png
Unable to deploy a Java EE 8 (servlet 4.0) project on EAP 7.2, it does not support version 4.0 of the J2EE Web module specification.
The project implements a simple servlet war that imports the {{org.jboss.bom:jboss-eap-javaee8:7.2.0.GA:pom}}.
I am using adapter {{3.6.2.v20190208-1835}} which I think is the latest.
According to JBIDE-26307 the 7.1 server adapter should be be used for EAP 7.2.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 1 month
[JBoss JIRA] (JBIDE-25814) Server adapter wizard: should preselected most recently used connection, not simply the 1st in the list
by Josef Kopriva (Jira)
[ https://issues.jboss.org/browse/JBIDE-25814?page=com.atlassian.jira.plugi... ]
Josef Kopriva updated JBIDE-25814:
----------------------------------
Sprint: (was: devex #162 February 2019)
> Server adapter wizard: should preselected most recently used connection, not simply the 1st in the list
> -------------------------------------------------------------------------------------------------------
>
> Key: JBIDE-25814
> URL: https://issues.jboss.org/browse/JBIDE-25814
> Project: Tools (JBoss Tools)
> Issue Type: Enhancement
> Components: openshift
> Affects Versions: 4.5.3.AM2
> Reporter: Andre Dietisheim
> Assignee: Josef Kopriva
> Priority: Major
> Labels: server_adapter_wizard
> Fix For: 4.11.0.AM1
>
>
> steps:
> # ASSERT: have several connections in the OpenShift explorer (ex. CDK, OpenShift online)
> # EXEC: launch new application wizard via File > New > Other > OpenShift > OpenShift Application
> # ASSERT: Connection selection page pops up
> # EXEC: select your 2nd connection, get to the next page. But then, cancel the wizard, dont get any further.
> # EXEC: launch server adapter wizard via File > New > Other > Server > OpenShift > OpenShift 3 Server adapter
> # ASSERT: Connection selection page pops up
> Result:
> the connection selection page has the 1st connection selected, not the one that we used most recently.
> (If you use the application wizard again, you'll notice how it is using the 2nd connection, the one that we used most recently)
> Bonus: some wizards even inspect the currently selected element in the OpenShift Explorer and deduce what they need. The server adapter wizard could inspect the resource that's selected and infer the connection from it.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 1 month
[JBoss JIRA] (JBIDE-26550) Cannot delete pod on OpenShift
by Josef Kopriva (Jira)
[ https://issues.jboss.org/browse/JBIDE-26550?page=com.atlassian.jira.plugi... ]
Josef Kopriva closed JBIDE-26550.
---------------------------------
Closing - I was able to delete pod on OpenShift 3.11.
Verified in:
Red Hat CodeReady Studio
Version: 12.11.0.AM1
Build id: AM1-v20190219-0850-B4091
Build date: 20190219-0850
> Cannot delete pod on OpenShift
> ------------------------------
>
> Key: JBIDE-26550
> URL: https://issues.jboss.org/browse/JBIDE-26550
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.11.0.AM1
> Reporter: Andre Dietisheim
> Assignee: Andre Dietisheim
> Priority: Critical
> Labels: delete_resource, delete_resources
> Fix For: 4.11.0.AM1
>
> Attachments: error-deleting-pod-openshift-3_10.png, image-2019-02-08-21-12-00-707.png, image-2019-02-08-21-12-12-917.png
>
>
> steps:
> # ASSERT: make sure that you have an application with a pod running on OpenShift (ex. https://employee.openshift.com)
> # EXEC: in Explorer select the pod and choose "Delete"
> Result:
> !image-2019-02-08-21-12-12-917.png!
> {code}
> com.openshift.restclient.OpenShiftException: Exception trying to DELETE https://api.rh-us-east-1.openshift.com/api/v1/namespaces/testomat/pods/wf... response code: 500 no kind "Pod" is registered for version "v1" in scheme "k8s.io/apimachinery/pkg/apis/meta/internalversion/register.go:31"
> at com.openshift.internal.restclient.okhttp.ResponseCodeInterceptor.createOpenShiftException(ResponseCodeInterceptor.java:116)
> at com.openshift.internal.restclient.okhttp.ResponseCodeInterceptor.intercept(ResponseCodeInterceptor.java:66)
> at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
> at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
> at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
> at okhttp3.RealCall.execute(RealCall.java:77)
> at com.openshift.internal.restclient.DefaultClient.execute(DefaultClient.java:294)
> at com.openshift.internal.restclient.DefaultClient.execute(DefaultClient.java:268)
> at com.openshift.internal.restclient.DefaultClient.execute(DefaultClient.java:236)
> at com.openshift.internal.restclient.DefaultClient.execute(DefaultClient.java:219)
> at com.openshift.internal.restclient.DefaultClient.delete(DefaultClient.java:388)
> at org.jboss.tools.openshift.core.connection.Connection.deleteResource(Connection.java:549)
> at org.jboss.tools.openshift.internal.core.job.AbstractDeleteResourceJob.delete(AbstractDeleteResourceJob.java:45)
> at org.jboss.tools.openshift.internal.core.job.DeleteResourceJob.doRun(DeleteResourceJob.java:35)
> at org.jboss.tools.openshift.internal.common.core.job.AbstractDelegatingMonitorJob.run(AbstractDelegatingMonitorJob.java:37)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
> {code}
> ps. Deleting the pod via "oc" command line (oc v3.11.0+0cbc58b) works fine.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 1 month