Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Jack clouseau

Greenhorn
+ Follow
since May 14, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jack clouseau

I have an RCP application in which i have added the Intro page (welcome page). This is implemented using the IIntroPart. so mine is not an xml oriented welcome page.

Problem: when the application is started the welcome page is displayed perfectly. But now when the welcome page is still opened (visible), if i try to open a perspective in my application, the welcome page is not moving towards right (as it does in Eclipse IDE) making space for the perspective that i have selected.

So even after selecting the perspective, the perspective is not shown and the welcome page is still occupying the entire workbench area. Please note that, the selected perspectve is NOT hiding behind the welcome page. But the selected perspective is getting updated in the perspective shortcuts!

On restart (after clearing the metadata) if i manually close the welcome page and then try to open the perspective, the perspective just opens fine.

It is because of the welcome page (when it is visible) the selected perspective is not opening in the workbench.

Could anyone please help me to resolve this issue? It should behave just like the way the welcome page behaves in Eclipse IDE. i.e, when the welcome page is still opened, if a perspective is opened, then the welcome page should move right making space for the pespective and hence both (the selected perspective and the welcome page) should be visible
7 years ago
I have scenario where the perspective opened before closing the rcp application should not be restored when the application is restarted.

This is required because, we have the login system implemented and depending on the login-user we need to enable the perspective which the login-user is authorized to.

But when user-A login and opens "perspective A" before closing the application, then for user-B "perspective A" is showed by default when user-B login.

I know this is being stored in .metadata folder, but i do not want to clear the metadata folder at runtime (while opening the application)

So while restarting the application, how do i restrict the workbench not to open the last opened perspective?

I have tried overriding the getInitialWindowPerspectiveId() of workbenchadvisor class but no use.

I also tried, deleting the prespective descriptor from the perspective registry but still no use...

any inputs to solve this is much appreciated...
7 years ago
Hello All,

We have an RCP application with login functionality integrated to it.

Now depending on the user that is logged in, we need to start a certain bundle and its dependent bundles at runtime before the workbench loads. Is this possible?

These bundles, contribute to the UI of the application. So we need to load them before the workbench loads.

If it is possible, please guide me in that direction.

Thanks
7 years ago
Hello All,

We have an RCP application. This main plugin is more like a container with just login dialog functionality (this doesn't contain any perspectives or views. Just with the login functionality).

We have 2 other plugins which actaully contributes perspectives to the main rcp application.

Now depending on the login (after authencticating), i need to display at runtime only one perspective to the login-user. How do i do that?

Currently both the perspectives are displayed to the user. Is it possible to update the PerspectiveRegistry at runtime and update the rcp application?

I have tried IPerspectiveRegistry.deletePerspective(IPerspectiveDescriptor descriptor) in the preWindowOpen() and postWindowOpen() of the WorkbenchWindowAdvisor of my application, but still both the perspectives are being displayed.

How to hide or remove one of the perspective at runtime before the workbench loads?

Any help on this is much appreciated...

Thanks
7 years ago
Hello All,

Am trying to add a log-in dialog to my application. I have added this code in the

start method of the IApplication java file:

below is the code:



Now, the issue is: when the application starts the splash screen shows up first ( i have configured the splash screen in the productconfiguration file of the application). Then the login dialog appears.

Before entering the credentials in the login dialog, if the user closes the application by selecting the "close window" conext-menu from the windows task bar, the application closes (spash screen), but the login dialog doesn't close.

The login dialog is created as below in the IApplication.java



On debugging i noticed that, if the user closes the application before entering the credentials in the login dialog, the control doesn't come to the IApplicatio.java file itself. If this is the case, how can i close my Login dialog in this scenarion

Please let me know suggestion to resolve this issue
7 years ago
Hi All,

I have a task and i need some guidelines to acheive it....

here is the task...

I need to create a plugin which adds a Menu (let's say "MyMenu") in the MenuBar of the Eclipse when it is launched. And on selection of a MenuItem (let's say "Launch My App") under MyMenu, i should be able to launch my application which is again a plugin. This MyMenu should appear in whichever Eclipse version i install my plugin (Meaning, if i copy my plugin to any of the Eclipse plugins folder and on lauching of that particular version of Eclipse, the user should be able to see MyMenu in the MenuBar).

Please let me know how to start with this...
10 years ago
AllRight.....

Guys i found out the problem where i was doing wrong...it was the layout issue. For the control on which we are going to draw the ScrolledComposite should have a "FillLayout"..this way it works...

You guys can check the modified below code which works exactly as expected...

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class ScrolledCompTest extends org.eclipse.swt.widgets.Composite {

/**
* Auto-generated main method to display this
* org.eclipse.swt.widgets.Composite inside a new Shell.
*/
public static void main(String[] args) {
showGUI();
}

/**
* Overriding checkSubclass allows this class to extend org.eclipse.swt.widgets.Composite
*/
protected void checkSubclass() {
}

/**
* Auto-generated method to display this
* org.eclipse.swt.widgets.Composite inside a new Shell.
*/
public static void showGUI() {
Display display = Display.getDefault();
Shell shell = new Shell(display);
ScrolledCompTest inst = new ScrolledCompTest(shell, SWT.NULL);
Point size = inst.getSize();
shell.setLayout(new FillLayout());
shell.layout();
if(size.x == 0 && size.y == 0) {
inst.pack();
shell.pack();
} else {
Rectangle shellBounds = shell.computeTrim(0, 0, size.x, size.y);
shell.setSize(shellBounds.width, shellBounds.height);
}
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}

public ScrolledCompTest(org.eclipse.swt.widgets.Composite parent, int style) {
super(parent, style);
initGUI();
}

private void initGUI() {
try {
FillLayout thisLayout = new FillLayout();
this.setLayout(thisLayout);
this.layout();

final ScrolledComposite scrollComposite = new ScrolledComposite(this, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
final Composite comp = new Composite(scrollComposite, SWT.NONE);
GridLayout compLyt = new GridLayout(2, false);
comp.setLayout(compLyt);

Label l = new Label(comp, SWT.BORDER);
l.setText("this is sample lable");
GridData lData = new GridData();
lData.widthHint = 200;
l.setLayoutData(lData);

Text t = new Text(comp, SWT.BORDER);
t.setText("hello");
GridData tData = new GridData();
tData.widthHint = 100;
t.setLayoutData(tData);

scrollComposite.setContent(comp);
scrollComposite.setExpandVertical(true);
scrollComposite.setExpandHorizontal(true);
scrollComposite.setMinSize(comp.computeSize(SWT.DEFAULT, SWT.DEFAULT));

} catch (Exception e) {
e.printStackTrace();
}
}

}

Anyways thanks to all the guys...who atleast gave a try on this...

cheers,
10 years ago
Hi All,


can anybody run this sample code below...and let me know why am not getting the scroll bars for the scrolledcomposite...

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;


public class ScrolledCompTest extends org.eclipse.swt.widgets.Composite {

public static void main(String[] args) {
showGUI();
}

protected void checkSubclass() {
}

public static void showGUI() {
Display display = Display.getDefault();
Shell shell = new Shell(display);
ScrolledCompTest inst = new ScrolledCompTest(shell, SWT.NULL);
Point size = inst.getSize();
shell.setLayout(new FillLayout());
shell.layout();
if(size.x == 0 && size.y == 0) {
inst.pack();
shell.pack();
} else {
Rectangle shellBounds = shell.computeTrim(0, 0, size.x, size.y);
shell.setSize(shellBounds.width, shellBounds.height);
}
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}

public ScrolledCompTest(org.eclipse.swt.widgets.Composite parent, int style) {
super(parent, style);
initGUI();
}

private void initGUI() {
try {
GridLayout thisLayout = new GridLayout();
this.setLayout(thisLayout);
this.layout();

final ScrolledComposite scrollComposite = new ScrolledComposite(this, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
GridLayout scrolCompLyt = new GridLayout(1, false);
GridData scrolCompLytData = new GridData();
scrolCompLytData.widthHint = 230;
scrolCompLytData.heightHint = 200;
scrollComposite.setLayout(scrolCompLyt);
scrollComposite.setLayoutData(scrolCompLytData);

final Composite comp = new Composite(scrollComposite, SWT.NONE);
GridLayout compLyt = new GridLayout(2, false);
GridData compLytData = new GridData();
compLytData.widthHint = 300;
compLytData.heightHint = 200;
comp.setLayout(compLyt);
comp.setLayoutData(compLytData);

Label l = new Label(comp, SWT.BORDER);
l.setText("this is sample lable");
GridData ldata = new GridData();
ldata.widthHint = 200;
l.setLayoutData(ldata);

Text t = new Text(comp, SWT.BORDER);
t.setText("hello");
GridData tdata = new GridData();
tdata.widthHint = 100;
t.setLayoutData(tdata);

scrollComposite.setContent(comp);
scrollComposite.setExpandVertical(true);
scrollComposite.setExpandHorizontal(true);

} catch (Exception e) {
e.printStackTrace();
}
}

}


Am expecting the horizontasl scrollbar to show up as you can see the textfield which has the text "Hello" is not completely visible in the UI...and when i reduce the size of this window, still the scrollbars are not shown up....can anybody tell me where am going wrong???

please help me to get this done...

Thanks,
10 years ago
Hi,

I have a composite (with SWT.H_Scroll and SWT.V_Scroll specifications when it's initialized) and have added some controls like Label and text on top of this. Am using GridLayout for this composite and have specified the grabExcessHorizontal and vertical as TRUE and also vertical and horizontalAlignment's as GridData.Fill.

But the problem is, when the screen is drawn, the scrollbars are showing by default even though its fully focus. And the other major issues is, when the workbench is resized( basically when it's minimized) these controls are going out of focus and even though the scrollbars are visible (and also selectable)...these are not functioning.

when i use the scrollbars to move....only the position of the scrolbar is moved and the composite's hidden area are is still not visible.

Can anyone suggest me anything on this issue?

The hierarchy of this composite on which its drawn is like this MyComposite -> CTabItem -> CTabFolder -> Section -> ManagedForm -> ScrolledForm -> Composite.

For all of these the layouts used is GridLayout with the similar GridData specifications as mentioned above for MyComposite....

Any suggestions at the earliest is much appreciated....

Thanks
10 years ago

Hi,

Can anybody tell me how to handle Ctrl+c and Ctrl+v key releases in an Eclipse application?

Am currently using Eclipse 3.5. The key bindings has been defined in the PlugIn.xml.

As soon as i start the application if i do Ctrl+c or Ctrl+v the events are not getting triggered.

But the event triggers only after i manuallay open the EDIT MENU (which has Copy and Paste IAction's in it..For these IAction's i have set the Accelerator's Ctrl+c and Ctrl+v respectively) . After opening the Edit menu manually now if i use the short-cut keys my application is responding to those events. Am not sure what is the problem here...

Is there a better way to handle these short-cut keys issue in Eclipse 3.5?

Any suggestions will be much appreciated....

Thanks


10 years ago

Hi All,


In our RCP application we have a StatusLine....The problem is i need to place one StatusLineContributionItem exactly at the bottom-left corner and the rest of them (2 items) should be visible in the
right-side of the status line...

But while adding the contributions items to the status line....the placing of the contribution items is starting from right-side.


Is there a way to set the positions of the contribution items in the status line?


Thanks
10 years ago

Rob Camick wrote:I've never tried it for the Caps Lock key, but you should be able to use a Global Event Listener.

Otherwise you can query the state of the key using the Toolkit.getLockingKeyState, so maybe you can periodically check the value.



Hi Rob,

Thanks for the reply...

i tried with the Toolkit.getLockingKeyState method also...but it updates only when the application starts for the first time....and it doesn't update immediately as soon as the user
releases the Caps Lock

So now am trying to get the state of this key directly from the OS...something like this

OS.GetKeyState(OS.VK_CAPITAL)...this is updating properly as soon as the user releases the key.

But am not sure whether this will be supported in all the Operating systems...and also if we are using like this Eclipse immediately show the "DisCouraged Access"....so am bit worried here!!!

Could anybody share their thoughts on the solution that i have? can i go ahead and implement this solution?


Thanks


10 years ago
Hi All,

There is an requirement in our RCP application where in if the user releases the CAPS LOCK key then we need to update something in our application based on the state of the CAPS LOCK key state.

Basically the user can be in any screen in the application and throughout the application this functionality remains the same....

I tried adding the KeyLister to the active shell in the workbench(we have only one active shell in our application)....but the keyEvents is not delegated to this shell...

Can anyone please give me some hint how to solve this issue....


quick reply is much appreciated....


Thanks
10 years ago

Hi,

Could someone please help me with a java code to get the target path of a windows shortcut?

To be more specific, i have an application icon in my desktop. I need to access the Target value which will be present in the ShortCut tab (right-click -> select Properties options -> here in the shortcut tab this value will be present).

How to access this value in java.....?


Any Suggestions will be much appreciated....

Thanks
10 years ago
Hi All,

Currently, I have two tables each with their own scrollbars. When I move one scrollbar, the other scrollbar also moves. But the other table will not scroll (so only the scrollbar moves, the table doesn't). I've tried refreshing, updating, redrawing the table, but nothing seems to make the table itself scroll.

To make the other scrollbar move, I have a SelectionListener and in widgetSelected, I set setSelection of my scrollbar with the value of the other scrollbar. And this only updates the scrollbar.
can anyone help?

thanks
11 years ago