does anyone know how to disable the possibility of resizing the main window of my Eclipse application
Thanks a lot
You can try a restrictive ShellStyle, as suggested in this thread and detailed in this one (SWT.DIALOG_TRIM):
public void preWindowOpen() {
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setInitialSize(new Point(800, 600));
configurer.setShowCoolBar(false);
configurer.setShowStatusLine(false);
configurer.setTitle("RFID demo");
}
You need to call setShellStyle(). See the Javadoc for the Shell(int) constructor for an explanation of how to form the argument.
According to WorkbenchWindowConfigurer the default value is SWT.SHELL_TRIM, which includes the SWT.RESIZE option.
You'll have to formulate a value that does not include SWT.RESIZE.
It was exactly what I was searching for,
configurer.setShellStyle(SWT.DIALOG_TRIM);
Related
I know, but we really need it.
We have a clear division of labor.
They create templates, I fill them in runtime according to some rules.
Can't teach my business to insert something like this and be sure they really did it ok(so can't move any logic to templates):
$P{risk_types}.get($F{risk_type}) ?: "UNDEFINED"
Also can not fill from files hardcoded in some adapter hadwritten by god-knows-who and unchangeable in runtime. It's a web app. Best option is to find a way to replace that file source from adapter to a ByteArrayStream.
SO:
Need to substitute contents of parameters(also default ones) at runtime.
example:
need to set JSON_INPUT_STREAM
Like this unsolved thread.
https://community.jaspersoft.com/questions/516611/changing-parameter-scriptlet
Really hope not to work on xml level, but xml also can't solve my problem as far as I tried.
Thank you!
The easiest and cleanest way we did this(bypassing usage of tons of deprecated documentation and unfinished bugged undocumented static antipatterned new features):
Create context with repository extension
SimpleJasperReportsContext jasperReportsContext = new SimpleJasperReportsContext();
jasperReportsContext.setExtensions(RepositoryService.class, Collections.singletonList(new MyRepositoryService(jasperReportsContext, yourOptionalParams)));
Fill this way(after compile and other usual actions)
JasperPrint print = JasperFillManager.getInstance(jasperReportsContext).fill(compiled, new HashMap<>());
Now your repository must extend default one to be hack-injected(cause of hodgie coded "isAssignableFrom") successfully
public class PrintFormsRepositoryService extends DefaultRepositoryService {
#Override
public InputStream getInputStream(RepositoryContext context, String uri) {
// return here your own good simple poj inputStream even from memory if you found source
// or pass to another repository service(default one probably)
return null;
}
}
I'm new at Apache Isis and I'm stuck.
I want to create my own submit form with editable parameters for search some entities and a grid with search results below.
Firstly, I created #DomainObject(nature=Nature.VIEW_MODEL) with search results collection, parameters for search and #Action for search.
After deeper research, I found out strict implementations for actions (For exapmle ActionParametersFormPanel). Can I use #Action and edit #DomainObject properties(my search parameters for action) without prompts?
Can I implement it by layout.xml?
Then I tried to change a component as described here: 6.2 Replacing page elements, but I was confused which ComponentType and IModel should I use, maybe ComponentType.PARAMETERS and ActionModel or implement my own IModel for my case.
Should I implement my own Wicket page for search and register it by PageClassList interface, as described here: 6.3 Custom pages
As I understood I need to replace page class for one of PageType, but which one should I change?
So, the question is how to implement such issues properly? Which way should I choose?
Thank you!
===================== UPDATE ===================
I've implemented HomePageViewModel in this way:
#DomainObject(
nature = Nature.VIEW_MODEL,
objectType = "homepage.HomePageViewModel"
)
#Setter #Getter
public class HomePageViewModel {
private String id;
private String type;
public TranslatableString title() {
return TranslatableString.tr("My custom search");
}
public List<SimpleObject> getObjects() {
return simpleObjectRepository.listAll();
}
#Action
public HomePageViewModel search(
#ParameterLayout(named = "Id")
String id,
#ParameterLayout(named = "Type")
String type
){
setId(id);
setType(type);
// finding objects by entered parameters is not implemented yet
return this;
}
#javax.inject.Inject
SimpleObjectRepository simpleObjectRepository;
}
And it works in this way:
I want to implement a built-in-ViewModel action with parameters without any dialog windows, smth like this:
1) Is it possible to create smth like ActionParametersFormPanel based on ComponentType.PARAMETERS and ActionModel and use this component as #Action in my ViewModel?
2) Or I should use, as you said, ComponentType.COLLECTION_CONTENTS? As I inderstand my search result grid and my search input panel will be like ONE my stub component?
Thank you.
We have a JIRA ticket in our JIRA to implement a filterable/searchable component, but it hasn't yet made it to the top of the list for implementation.
As an alternative, you could have a view model that provides the parameters you want to filter on as properties, with a table underneath. (I see you asked another question here on SO re properties on view models, so perhaps you are moving in that direction also... I've answered that question).
If you do want to have a stab at implementing that ticket, then the ComponentTYpe to use is COLLECTION_CONTENTS. If you take a look at the isisaddons, eg for excel or gmap3 then it might help get you started.
======= UPDATE TO ANSWER (based on update made to query) ==========
I have some good news for you. v1.15.0-SNAPSHOT, which should be released in the couple of weeks, has support for "inline prompts". You should find these give a user experience very similar to what you are after, with no further work needed on your part.
To try it out, check out the current trunk, and then load the simpleapp (in examples/application/simpleapp). You should see that editing properties and invoking actions uses the new inline prompt style.
HTH
Dan
FindBugs seems to show only the first occurrence of a particular bug in each method. This occurs in Eclipse as well as in the FindBugs stand-alone client.
How can I configure FindBugs to show all occurrences?
Example:
import javax.annotation.Nonnull;
public class Bar
{
public void meth(#Nonnull final String pArg) {
System.out.println(pArg);
}
public void foo() {
String s = null;
meth(s); // <<== bug marker here (NP_NONNULL_PARAM_VIOLATION)
meth(null); // no bug marker here
meth(s); // and none here either :-(
}
}
Im am using the latest FindBugs 2.0.2 Eclipse plugin (with Eclipse 3.6).
The problem appears to depend on the bug pattern. For example, I see more than one hit per method with DLS_DEAD_LOCAL_STORE, but not with NP_NONNULL_PARAM_VIOLATION. The latter is shown above.
Thanks!
It seems that Findbugs only checks those lines of code for this specific error, which can actually be reached according to a control flow analysis. With your 3 method invocations, the first one leads to a NPE, therefore the second and third will never be reached.
There have been similar bug reports for previous versions: http://sourceforge.net/p/findbugs/bugs/980/
I writing my own text editor plugin for eclipse. I am now working on my own formatter. Actually, following that link http://wiki.eclipse.org/FAQ_How_do_I_support_formatting_in_my_editor%3F.
I have written my Strategy, I have overridden getContentFormatter in my SourceViewerConfiguration..
As I run my plugin and press Ctrl+Shift+F - and nothing happens.
I think that I'm missing a step here. Should I create a handler or something?
Thanks
Might it be you skipped the last part of the linked page?
Finally, you will need to create an action that invokes the formatter. No generic formatting action is defined by the text infrastructure, but it is quite easy to create one of your own. The action’s run method can simply call the following on the source viewer to invoke the formatter:
sourceViewer.doOperation(ISourceViewer.FORMAT);
What helped me. I have created a handler with the following executors body:
//get the editorPart
if (editorPart != null) {
ITextOperationTarget target = (ITextOperationTarget) editorPart
.getAdapter(ITextOperationTarget.class);
if (target instanceof ISourceViewer) {
ISourceViewer textViewer = (ISourceViewer) target;
((ITextOperationTarget) textViewer)
.doOperation(ISourceViewer.FORMAT);
}
}
Then just create menu items and bind them to the handler.
I'd like to change at runtime the name of my eclipse RCP application, so to include the name of the project the user is working on.
This seems a pretty simple question, but I was only able to find a way to set the name statically (in the article "branding your application").
There is a simpler way to do it, after I tried to do it as suggested here, I got into problems getting a hold of the Application or WorkbenchWindowAdvisor. The solution was simply to get the shell of the workbench window and setText:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setText("My new title");
In your ApplicationWorkbenchWindowAdvisor get hold of the IWorkbenchWindowConfigurer and set the title there. e.g:
public void preWindowOpen()
{
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setTitle("Custom Name...");
}
You can update the title at any time by burrowing down through the Application object:
Application.getApplication().getWorkbenchAdvisor().getWorkbenchWindowAdvisor().setTitle();
I do the same thing. I hold the getWindowConfigurer(); in some static reference.
Utility.configurer = getWindowConfigurer();
Then use this reference anywhere to update application title.
Utility.configurer.setTitle("My New Title");