Skip to content

Instantly share code, notes, and snippets.

View manstis's full-sized avatar

Michael Anstis manstis

  • Red Hat
  • England
View GitHub Profile
@Override
public void setSelected( final String kbase,
final String ksession ) {
boolean selected = false;
selected = selected || setSelectedValue( kbases, kbase );
selected = selected || setSelectedValue( ksessions, ksession );
if(selected) {
fireValueChanged();
}
}
@manstis
manstis / gist:cdf4fe09531eb0cefd2e
Created February 5, 2016 14:36
GuidedRuleEditorCopyHelper
/*
* Copyright 2014 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@manstis
manstis / gist:daf80716bf55dd9580cb
Created November 12, 2015 13:09
Recognise this?
<div style="overflow: auto; position: relative;" class="GKGYRBEBCAB">
<div style="position: relative;">
<div style="width: 0px; height: 0px;"> <---- Setting to a real size fixes the issue!
<!-- This is a FocusPanel -->
<div tabindex="0" style="position: relative; top: 0px; left: 0px; width: 100%; height: 100%;">
<input type="text" tabindex="-1" role="presentation" style="opacity: 0; height: 1px; width: 1px; z-index: -1; overflow: hidden; position: absolute;">
<div style="position: relative; top: 0px; left: 0px; width: 100%; height: 100%;">
<div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true">&nbsp;</div>
Authoring
- New Menu, group by category (e.g., "rule" - dtree, dtable, gre, "supporting" - dsl, enum etc)
- New Project - only at top when no project exists
- New Project - NewResourceHandler - straight to wizard
- New Project Wizard - pages for dependencies, kmodule, import suggestions, etc
Import suggestions - rename "external types"
Config tab - rename "Available types" and show types in same package by default + support for managing imports (i.e. as existing). Types in same package are not persisted in imports.
[27/10/15 13:58:57:981 GMT] 000000a8 wtp E org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl createTempZipFileStrategyIfPossible Failed to create temporary file in system defined temporary location (java.io.tmpdir) [ /tmp ].
Failed to create temporary file.
A nested strategy will be used, but this usually slows performance dramatically.
[27/10/15 13:58:57:981 GMT] 000000a8 wtp W org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl createNestedLoadStrategy Could not create temp file for base URI [ WEB-INF/lib/drools-workbench-models-guided-scorecard-6.4.0-SNAPSHOT.jar ] and temporary directory [ null ]; creating nested strategy
[27/10/15 13:58:57:982 GMT] 000000a8 wtp W org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.TempZipFile setTempFile Could not create temporary file in directory [ /tmp ]
[27/10/15 13:58:57:982 GMT] 000000a8 wtp W org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.TempZipFile trigge
@manstis
manstis / gist:264e3f6a76450c04603b
Created October 19, 2015 13:32
KObject.isFullText()
private Document newDocument( final KObject object ) {
final Document doc = new Document();
doc.add( new StringField( "id",
object.getId(),
Field.Store.YES ) );
doc.add( new StringField( "type",
object.getType().getName(),
Field.Store.YES ) );
doc.add( new TextField( "key",
SCRIPT429: Caught exception occurred : Automation server can't create object
ZeroClipboard.min.js, line 9 character 21718
SCRIPT429: Caught exception occurred : Automation server can't create object
ZeroClipboard.min.js, line 9 character 21810
SCRIPT429: Caught exception occurred : Automation server can't create object
ZeroClipboard.min.js, line 9 character 21882
SCRIPT5022: Caught exception occurred : SyntaxError
script block (1), line 2 character 10690
SCRIPT5022: Caught exception occurred : SyntaxError
script block (1), line 2 character 10915
[INFO] Kie Workbench - Common - Server Component - Backend FAILURE [ 6.377 s]
[INFO] Kie Workbench - Common - Server Component - Client . SKIPPED
[INFO] Kie Workbench - Common - Social Home Page .......... SKIPPED
[INFO] Kie Workbench - Common - Social Home Page - API .... SKIPPED
[INFO] Kie Workbench - Common - Social Home Page - Backend SKIPPED
[INFO] Kie Workbench - Common - Social Home Page - Client . SKIPPED
[INFO] Kie Workbench - Common - Contributors Screen ....... SKIPPED
[INFO] Kie Workbench - Common - Contributors - API ........ SKIPPED
[INFO] Kie Workbench - Common - Contributors - Client ..... SKIPPED
[INFO] Kie Workbench - Common - Contributors - Backend .... SKIPPED
@Override
public void deleteItem( final FolderItem folderItem ) {
getView().deleteItem( new ParameterizedCommand<String>() {
@Override
public void execute( final String comment ) {
getView().showBusyIndicator( CommonConstants.INSTANCE.Deleting() );
explorerService.call( new RemoteCallback<Object>() {
@Override
public void callback( Object o ) {
notification.fire( new NotificationEvent( CommonConstants.INSTANCE.ItemDeletedSuccessfully() ) );
@manstis
manstis / gist:7c7db162000653d6cf2f
Created July 23, 2015 16:30
uberfire-extensions: wires
//This is called whenver we do a canvas.draw() e.g panning, resizing columns etc
@Override
public void draw() {
//Have GWT schedule a call *once* per browser loop. This could well be redundant (see below)
//but I'm riding on a wave of europhoria to try removing it at the moment!
if ( !isRedrawScheduled ) {
isRedrawScheduled = true;
Scheduler.get().scheduleFinally( new Command() {
@Override