Eclipse RCP authentication - java

I would like to know how to implement authentication in Eclipse RCP. I have started an app and I have two views, one for admin and one for a regular user. At startup I want to show the login dialog and depending of type of user to show a view. Can anyone tell me which is the best way to do that? Thanks!

I'll suggest you that create a single view for both admin and regular user . Just create different widgets for the admin and regular user . Before creating the view just hook the Login Dialog and on the basis of authentication from the login dialog load the widgets in the view .

There are many different ways to do this :-)
I usually recommend using activities as these are completely independent of the code for the view, perspectives, commands, etc.
See this blog entry on how to set-up the activities.

Related

Creating setup wizard on Android App

In my application I need to ask the user some information in the beginning. Like Google asks users when they first launch the phone.
Using Java and Android, how do I make the same kind of setup wizard for my application? I could create multiple activities and when moving to the next page in the wizard I'd launch that. That doesn't seem a good way to do it.
I'd like to use Eclipse's GUI builder to design it.
Like This Image
create one activity for the setup wizard, and you change the content with fragments, or you open the setup wizard activity again with intent (close the existing one) and you pass some parameters, based on those parameters you show different content or you could use this https://github.com/romannurik/android-wizardpager

User authorization in Java using Spring, Swing and SQLite

I am create Java Swing application using Spring. I am creating two user one admin second general. There are mainly five function or menu button in my application.
For admin user I want to show all five menu button, and for general user only four.
I have created logging window, getting username and password from SQLite.
I searched on the web and found Apache Shiro and JAAS. But I have to do this urgently, and to use that framework will need more time.
Is there any simple Java code to do this? Any example similar to my problem?
No need to look very far ,
you just need to query is it type 1 or type 2 user using simple table column mechnism and hide not necessary components

Adding an help window to my android application

i need to add an help window to my android application.
But actually i don't know how to do it if there is a best practice, or some prepare objects.
I simply want to add an help option in the application menu, and when it is chooesed the help is showed. What is the best way to do that?
I think about several solution, but i'm not sure they are good.
Add another activity that contains only a text view or a webview and print the contente of the help
Use a Dialog Box? Maybe a custom dialog?
Launch a web activity and retrieve the help page from the web.
They are good ideas? Btw what is the best way to provide a basic help page into an android application?
Thanks.
Is suitable if your amount of help is small and does not need formatting
Is good for formatted text, bigger amounts of text and does not require internet connection or your server to be present when user likes to have help
Is the most flexible, as you can change help information without updating application,
but requires dedicated web page and internet connection.
Now it's your choice. My personal preference is #2.
What you want to do is make a xml layout containing all the help information and just create an activity that displays it, if you need help with code just ask me.

setup Login System and privilege and permission for Java

I'm trying to make a java program that prompt Login for the user and then some options and actions in the program will be available depend on the user permission. so for example , some user can print the picture other can not.
I'm sure this thing have been done many times. I'm looking for a tutorial or code sample to start with. I search in the interent but I couldn't find anything useful. Please help me
Thank you
and then some options and actions in the program will be available depend on the user permission
Design and build your GUI usings Actions. The Actions can be used to create your menu items and toolbar buttons.
Then, after the user is logged in you can disable the Action if the user doesn't have the permission to use that particular function.
Using this approach, the menu items and toolbar buttons will still appear in the UI, however they will be disabled so the user won't be able to use them.
You may want to look at Acegi http://www.acegisecurity.org/ , which is a java library that provides features for authorization.
Without Acegi Security (if you don't use it). First you must define all components from your application and save it to database. And then, create some tables such as role, user_role and role_components and components. Then when login, you must query this tables and check a security role from table role_components :)
CMIIW

Adding spinning tool in jDialog in java

I am working in a desktop application. In my application i am performing login operation where user enters his id and password. Login page is created in java swings using jDialog. When user enters his credentials, it takes few minutes to validate user. i want to add snipping tool with message "Please wait" which will be display, when user click on "next" button.
I didn't get any swing control which can be used as snipping tool. While searching i got some idea that ajax loader.jpg can be used as a snipping tool but not getting how can i use it in my jDialog.
Please suggest me some way to add an snipping tool.
There is spinning tool available in ajax that can be directly used by putting a lable in jPanel/jDialog and importing it as an icon image.
Here is link where you can get ajax spinning tools
http://www.andrewdavidson.com/articles/spinning-wait-icons/
Thanks for your valuable suggestions and response.
You can use a JProgressBar doing a bucle and changing the progress value.
Also take note that SwingX project offers a login dialog that does it for you.

Categories

Resources